PageRenderTime 50ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

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

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