PageRenderTime 42ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

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

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