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

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

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