PageRenderTime 40ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

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

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