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

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

https://github.com/w4x/boolangstudio
C# | 245 lines | 183 code | 32 blank | 30 comment | 45 complexity | ca81140c95853931712568560e25dd2d 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 IfStatement : Statement
  39. {
  40. protected Expression _condition;
  41. protected Block _trueBlock;
  42. protected Block _falseBlock;
  43. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  44. new public IfStatement CloneNode()
  45. {
  46. return Clone() as IfStatement;
  47. }
  48. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  49. override public NodeType NodeType
  50. {
  51. get
  52. {
  53. return NodeType.IfStatement;
  54. }
  55. }
  56. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  57. override public void Accept(IAstVisitor visitor)
  58. {
  59. visitor.OnIfStatement(this);
  60. }
  61. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  62. override public bool Matches(Node node)
  63. {
  64. IfStatement other = node as IfStatement;
  65. if (null == other) return false;
  66. if (!Node.Matches(_modifier, other._modifier)) return NoMatch("IfStatement._modifier");
  67. if (!Node.Matches(_condition, other._condition)) return NoMatch("IfStatement._condition");
  68. if (!Node.Matches(_trueBlock, other._trueBlock)) return NoMatch("IfStatement._trueBlock");
  69. if (!Node.Matches(_falseBlock, other._falseBlock)) return NoMatch("IfStatement._falseBlock");
  70. return true;
  71. }
  72. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  73. override public bool Replace(Node existing, Node newNode)
  74. {
  75. if (base.Replace(existing, newNode))
  76. {
  77. return true;
  78. }
  79. if (_modifier == existing)
  80. {
  81. this.Modifier = (StatementModifier)newNode;
  82. return true;
  83. }
  84. if (_condition == existing)
  85. {
  86. this.Condition = (Expression)newNode;
  87. return true;
  88. }
  89. if (_trueBlock == existing)
  90. {
  91. this.TrueBlock = (Block)newNode;
  92. return true;
  93. }
  94. if (_falseBlock == existing)
  95. {
  96. this.FalseBlock = (Block)newNode;
  97. return true;
  98. }
  99. return false;
  100. }
  101. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  102. override public object Clone()
  103. {
  104. IfStatement clone = (IfStatement)FormatterServices.GetUninitializedObject(typeof(IfStatement));
  105. clone._lexicalInfo = _lexicalInfo;
  106. clone._endSourceLocation = _endSourceLocation;
  107. clone._documentation = _documentation;
  108. if (_annotations != null) clone._annotations = (Hashtable)_annotations.Clone();
  109. if (null != _modifier)
  110. {
  111. clone._modifier = _modifier.Clone() as StatementModifier;
  112. clone._modifier.InitializeParent(clone);
  113. }
  114. if (null != _condition)
  115. {
  116. clone._condition = _condition.Clone() as Expression;
  117. clone._condition.InitializeParent(clone);
  118. }
  119. if (null != _trueBlock)
  120. {
  121. clone._trueBlock = _trueBlock.Clone() as Block;
  122. clone._trueBlock.InitializeParent(clone);
  123. }
  124. if (null != _falseBlock)
  125. {
  126. clone._falseBlock = _falseBlock.Clone() as Block;
  127. clone._falseBlock.InitializeParent(clone);
  128. }
  129. return clone;
  130. }
  131. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  132. override internal void ClearTypeSystemBindings()
  133. {
  134. _annotations = null;
  135. if (null != _modifier)
  136. {
  137. _modifier.ClearTypeSystemBindings();
  138. }
  139. if (null != _condition)
  140. {
  141. _condition.ClearTypeSystemBindings();
  142. }
  143. if (null != _trueBlock)
  144. {
  145. _trueBlock.ClearTypeSystemBindings();
  146. }
  147. if (null != _falseBlock)
  148. {
  149. _falseBlock.ClearTypeSystemBindings();
  150. }
  151. }
  152. [System.Xml.Serialization.XmlElement]
  153. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  154. public Expression Condition
  155. {
  156. get
  157. {
  158. return _condition;
  159. }
  160. set
  161. {
  162. if (_condition != value)
  163. {
  164. _condition = value;
  165. if (null != _condition)
  166. {
  167. _condition.InitializeParent(this);
  168. }
  169. }
  170. }
  171. }
  172. [System.Xml.Serialization.XmlElement]
  173. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  174. public Block TrueBlock
  175. {
  176. get
  177. {
  178. return _trueBlock;
  179. }
  180. set
  181. {
  182. if (_trueBlock != value)
  183. {
  184. _trueBlock = value;
  185. if (null != _trueBlock)
  186. {
  187. _trueBlock.InitializeParent(this);
  188. }
  189. }
  190. }
  191. }
  192. [System.Xml.Serialization.XmlElement]
  193. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  194. public Block FalseBlock
  195. {
  196. get
  197. {
  198. return _falseBlock;
  199. }
  200. set
  201. {
  202. if (_falseBlock != value)
  203. {
  204. _falseBlock = value;
  205. if (null != _falseBlock)
  206. {
  207. _falseBlock.InitializeParent(this);
  208. }
  209. }
  210. }
  211. }
  212. }
  213. }