PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://github.com/w4x/boolangstudio
C# | 212 lines | 150 code | 32 blank | 30 comment | 29 complexity | 655ebbb006d89e38ae8275a045ecfc2f 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 BinaryExpression : Expression
  39. {
  40. protected BinaryOperatorType _operator;
  41. protected Expression _left;
  42. protected Expression _right;
  43. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  44. new public BinaryExpression CloneNode()
  45. {
  46. return Clone() as BinaryExpression;
  47. }
  48. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  49. override public NodeType NodeType
  50. {
  51. get
  52. {
  53. return NodeType.BinaryExpression;
  54. }
  55. }
  56. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  57. override public void Accept(IAstVisitor visitor)
  58. {
  59. visitor.OnBinaryExpression(this);
  60. }
  61. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  62. override public bool Matches(Node node)
  63. {
  64. BinaryExpression other = node as BinaryExpression;
  65. if (null == other) return false;
  66. if (_operator != other._operator) return NoMatch("BinaryExpression._operator");
  67. if (!Node.Matches(_left, other._left)) return NoMatch("BinaryExpression._left");
  68. if (!Node.Matches(_right, other._right)) return NoMatch("BinaryExpression._right");
  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 (_left == existing)
  79. {
  80. this.Left = (Expression)newNode;
  81. return true;
  82. }
  83. if (_right == existing)
  84. {
  85. this.Right = (Expression)newNode;
  86. return true;
  87. }
  88. return false;
  89. }
  90. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  91. override public object Clone()
  92. {
  93. BinaryExpression clone = (BinaryExpression)FormatterServices.GetUninitializedObject(typeof(BinaryExpression));
  94. clone._lexicalInfo = _lexicalInfo;
  95. clone._endSourceLocation = _endSourceLocation;
  96. clone._documentation = _documentation;
  97. if (_annotations != null) clone._annotations = (Hashtable)_annotations.Clone();
  98. clone._expressionType = _expressionType;
  99. clone._operator = _operator;
  100. if (null != _left)
  101. {
  102. clone._left = _left.Clone() as Expression;
  103. clone._left.InitializeParent(clone);
  104. }
  105. if (null != _right)
  106. {
  107. clone._right = _right.Clone() as Expression;
  108. clone._right.InitializeParent(clone);
  109. }
  110. return clone;
  111. }
  112. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  113. override internal void ClearTypeSystemBindings()
  114. {
  115. _annotations = null;
  116. _expressionType = null;
  117. if (null != _left)
  118. {
  119. _left.ClearTypeSystemBindings();
  120. }
  121. if (null != _right)
  122. {
  123. _right.ClearTypeSystemBindings();
  124. }
  125. }
  126. [System.Xml.Serialization.XmlElement]
  127. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  128. public BinaryOperatorType Operator
  129. {
  130. get
  131. {
  132. return _operator;
  133. }
  134. set
  135. {
  136. _operator = value;
  137. }
  138. }
  139. [System.Xml.Serialization.XmlElement]
  140. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  141. public Expression Left
  142. {
  143. get
  144. {
  145. return _left;
  146. }
  147. set
  148. {
  149. if (_left != value)
  150. {
  151. _left = value;
  152. if (null != _left)
  153. {
  154. _left.InitializeParent(this);
  155. }
  156. }
  157. }
  158. }
  159. [System.Xml.Serialization.XmlElement]
  160. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  161. public Expression Right
  162. {
  163. get
  164. {
  165. return _right;
  166. }
  167. set
  168. {
  169. if (_right != value)
  170. {
  171. _right = value;
  172. if (null != _right)
  173. {
  174. _right.InitializeParent(this);
  175. }
  176. }
  177. }
  178. }
  179. }
  180. }