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

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

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