PageRenderTime 25ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/Dependencies/boo/src/Boo.Lang.Compiler/Ast/Impl/ConditionalExpressionImpl.cs

https://github.com/w4x/boolangstudio
C# | 232 lines | 170 code | 32 blank | 30 comment | 38 complexity | dd36c7af8ad34aac96d031a0f396785a MD5 | raw file
Possible License(s): GPL-2.0
  1. #region license
  2. // Copyright (c) 2003, 2004, 2005 Rodrigo B. de Oliveira (rbo@acm.org)
  3. // All rights reserved.
  4. //
  5. // Redistribution and use in source and binary forms, with or without modification,
  6. // are permitted provided that the following conditions are met:
  7. //
  8. // * Redistributions of source code must retain the above copyright notice,
  9. // this list of conditions and the following disclaimer.
  10. // * Redistributions in binary form must reproduce the above copyright notice,
  11. // this list of conditions and the following disclaimer in the documentation
  12. // and/or other materials provided with the distribution.
  13. // * Neither the name of Rodrigo B. de Oliveira nor the names of its
  14. // contributors may be used to endorse or promote products derived from this
  15. // software without specific prior written permission.
  16. //
  17. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  18. // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  19. // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  20. // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
  21. // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22. // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  23. // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  24. // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  25. // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  26. // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. #endregion
  28. //
  29. // DO NOT EDIT THIS FILE!
  30. //
  31. // This file was generated automatically by astgen.boo.
  32. //
  33. namespace Boo.Lang.Compiler.Ast
  34. {
  35. using System.Collections;
  36. using System.Runtime.Serialization;
  37. [System.Serializable]
  38. public partial class ConditionalExpression : Expression
  39. {
  40. protected Expression _condition;
  41. protected Expression _trueValue;
  42. protected Expression _falseValue;
  43. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  44. new public ConditionalExpression CloneNode()
  45. {
  46. return Clone() as ConditionalExpression;
  47. }
  48. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  49. override public NodeType NodeType
  50. {
  51. get
  52. {
  53. return NodeType.ConditionalExpression;
  54. }
  55. }
  56. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  57. override public void Accept(IAstVisitor visitor)
  58. {
  59. visitor.OnConditionalExpression(this);
  60. }
  61. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  62. override public bool Matches(Node node)
  63. {
  64. ConditionalExpression other = node as ConditionalExpression;
  65. if (null == other) return false;
  66. if (!Node.Matches(_condition, other._condition)) return NoMatch("ConditionalExpression._condition");
  67. if (!Node.Matches(_trueValue, other._trueValue)) return NoMatch("ConditionalExpression._trueValue");
  68. if (!Node.Matches(_falseValue, other._falseValue)) return NoMatch("ConditionalExpression._falseValue");
  69. return true;
  70. }
  71. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  72. override public bool Replace(Node existing, Node newNode)
  73. {
  74. if (base.Replace(existing, newNode))
  75. {
  76. return true;
  77. }
  78. if (_condition == existing)
  79. {
  80. this.Condition = (Expression)newNode;
  81. return true;
  82. }
  83. if (_trueValue == existing)
  84. {
  85. this.TrueValue = (Expression)newNode;
  86. return true;
  87. }
  88. if (_falseValue == existing)
  89. {
  90. this.FalseValue = (Expression)newNode;
  91. return true;
  92. }
  93. return false;
  94. }
  95. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  96. override public object Clone()
  97. {
  98. ConditionalExpression clone = (ConditionalExpression)FormatterServices.GetUninitializedObject(typeof(ConditionalExpression));
  99. clone._lexicalInfo = _lexicalInfo;
  100. clone._endSourceLocation = _endSourceLocation;
  101. clone._documentation = _documentation;
  102. if (_annotations != null) clone._annotations = (Hashtable)_annotations.Clone();
  103. clone._expressionType = _expressionType;
  104. if (null != _condition)
  105. {
  106. clone._condition = _condition.Clone() as Expression;
  107. clone._condition.InitializeParent(clone);
  108. }
  109. if (null != _trueValue)
  110. {
  111. clone._trueValue = _trueValue.Clone() as Expression;
  112. clone._trueValue.InitializeParent(clone);
  113. }
  114. if (null != _falseValue)
  115. {
  116. clone._falseValue = _falseValue.Clone() as Expression;
  117. clone._falseValue.InitializeParent(clone);
  118. }
  119. return clone;
  120. }
  121. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  122. override internal void ClearTypeSystemBindings()
  123. {
  124. _annotations = null;
  125. _expressionType = null;
  126. if (null != _condition)
  127. {
  128. _condition.ClearTypeSystemBindings();
  129. }
  130. if (null != _trueValue)
  131. {
  132. _trueValue.ClearTypeSystemBindings();
  133. }
  134. if (null != _falseValue)
  135. {
  136. _falseValue.ClearTypeSystemBindings();
  137. }
  138. }
  139. [System.Xml.Serialization.XmlElement]
  140. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  141. public Expression Condition
  142. {
  143. get
  144. {
  145. return _condition;
  146. }
  147. set
  148. {
  149. if (_condition != value)
  150. {
  151. _condition = value;
  152. if (null != _condition)
  153. {
  154. _condition.InitializeParent(this);
  155. }
  156. }
  157. }
  158. }
  159. [System.Xml.Serialization.XmlElement]
  160. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  161. public Expression TrueValue
  162. {
  163. get
  164. {
  165. return _trueValue;
  166. }
  167. set
  168. {
  169. if (_trueValue != value)
  170. {
  171. _trueValue = value;
  172. if (null != _trueValue)
  173. {
  174. _trueValue.InitializeParent(this);
  175. }
  176. }
  177. }
  178. }
  179. [System.Xml.Serialization.XmlElement]
  180. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  181. public Expression FalseValue
  182. {
  183. get
  184. {
  185. return _falseValue;
  186. }
  187. set
  188. {
  189. if (_falseValue != value)
  190. {
  191. _falseValue = value;
  192. if (null != _falseValue)
  193. {
  194. _falseValue.InitializeParent(this);
  195. }
  196. }
  197. }
  198. }
  199. }
  200. }