PageRenderTime 56ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 1ms

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

https://github.com/w4x/boolangstudio
C# | 373 lines | 304 code | 39 blank | 30 comment | 98 complexity | 66bdc0479dbbc5f9811cec61c993777a 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 Method : CallableDefinition, IExplicitMember
  39. {
  40. protected Block _body;
  41. protected LocalCollection _locals;
  42. protected MethodImplementationFlags _implementationFlags;
  43. protected ExplicitMemberInfo _explicitInfo;
  44. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  45. new public Method CloneNode()
  46. {
  47. return Clone() as Method;
  48. }
  49. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  50. override public NodeType NodeType
  51. {
  52. get
  53. {
  54. return NodeType.Method;
  55. }
  56. }
  57. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  58. override public void Accept(IAstVisitor visitor)
  59. {
  60. visitor.OnMethod(this);
  61. }
  62. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  63. override public bool Matches(Node node)
  64. {
  65. Method other = node as Method;
  66. if (null == other) return false;
  67. if (_modifiers != other._modifiers) return NoMatch("Method._modifiers");
  68. if (_name != other._name) return NoMatch("Method._name");
  69. if (!Node.AllMatch(_attributes, other._attributes)) return NoMatch("Method._attributes");
  70. if (!Node.AllMatch(_parameters, other._parameters)) return NoMatch("Method._parameters");
  71. if (!Node.AllMatch(_genericParameters, other._genericParameters)) return NoMatch("Method._genericParameters");
  72. if (!Node.Matches(_returnType, other._returnType)) return NoMatch("Method._returnType");
  73. if (!Node.AllMatch(_returnTypeAttributes, other._returnTypeAttributes)) return NoMatch("Method._returnTypeAttributes");
  74. if (!Node.Matches(_body, other._body)) return NoMatch("Method._body");
  75. if (!Node.AllMatch(_locals, other._locals)) return NoMatch("Method._locals");
  76. if (_implementationFlags != other._implementationFlags) return NoMatch("Method._implementationFlags");
  77. if (!Node.Matches(_explicitInfo, other._explicitInfo)) return NoMatch("Method._explicitInfo");
  78. return true;
  79. }
  80. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  81. override public bool Replace(Node existing, Node newNode)
  82. {
  83. if (base.Replace(existing, newNode))
  84. {
  85. return true;
  86. }
  87. if (_attributes != null)
  88. {
  89. Attribute item = existing as Attribute;
  90. if (null != item)
  91. {
  92. Attribute newItem = (Attribute)newNode;
  93. if (_attributes.Replace(item, newItem))
  94. {
  95. return true;
  96. }
  97. }
  98. }
  99. if (_parameters != null)
  100. {
  101. ParameterDeclaration item = existing as ParameterDeclaration;
  102. if (null != item)
  103. {
  104. ParameterDeclaration newItem = (ParameterDeclaration)newNode;
  105. if (_parameters.Replace(item, newItem))
  106. {
  107. return true;
  108. }
  109. }
  110. }
  111. if (_genericParameters != null)
  112. {
  113. GenericParameterDeclaration item = existing as GenericParameterDeclaration;
  114. if (null != item)
  115. {
  116. GenericParameterDeclaration newItem = (GenericParameterDeclaration)newNode;
  117. if (_genericParameters.Replace(item, newItem))
  118. {
  119. return true;
  120. }
  121. }
  122. }
  123. if (_returnType == existing)
  124. {
  125. this.ReturnType = (TypeReference)newNode;
  126. return true;
  127. }
  128. if (_returnTypeAttributes != null)
  129. {
  130. Attribute item = existing as Attribute;
  131. if (null != item)
  132. {
  133. Attribute newItem = (Attribute)newNode;
  134. if (_returnTypeAttributes.Replace(item, newItem))
  135. {
  136. return true;
  137. }
  138. }
  139. }
  140. if (_body == existing)
  141. {
  142. this.Body = (Block)newNode;
  143. return true;
  144. }
  145. if (_locals != null)
  146. {
  147. Local item = existing as Local;
  148. if (null != item)
  149. {
  150. Local newItem = (Local)newNode;
  151. if (_locals.Replace(item, newItem))
  152. {
  153. return true;
  154. }
  155. }
  156. }
  157. if (_explicitInfo == existing)
  158. {
  159. this.ExplicitInfo = (ExplicitMemberInfo)newNode;
  160. return true;
  161. }
  162. return false;
  163. }
  164. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  165. override public object Clone()
  166. {
  167. Method clone = (Method)FormatterServices.GetUninitializedObject(typeof(Method));
  168. clone._lexicalInfo = _lexicalInfo;
  169. clone._endSourceLocation = _endSourceLocation;
  170. clone._documentation = _documentation;
  171. if (_annotations != null) clone._annotations = (Hashtable)_annotations.Clone();
  172. clone._modifiers = _modifiers;
  173. clone._name = _name;
  174. if (null != _attributes)
  175. {
  176. clone._attributes = _attributes.Clone() as AttributeCollection;
  177. clone._attributes.InitializeParent(clone);
  178. }
  179. if (null != _parameters)
  180. {
  181. clone._parameters = _parameters.Clone() as ParameterDeclarationCollection;
  182. clone._parameters.InitializeParent(clone);
  183. }
  184. if (null != _genericParameters)
  185. {
  186. clone._genericParameters = _genericParameters.Clone() as GenericParameterDeclarationCollection;
  187. clone._genericParameters.InitializeParent(clone);
  188. }
  189. if (null != _returnType)
  190. {
  191. clone._returnType = _returnType.Clone() as TypeReference;
  192. clone._returnType.InitializeParent(clone);
  193. }
  194. if (null != _returnTypeAttributes)
  195. {
  196. clone._returnTypeAttributes = _returnTypeAttributes.Clone() as AttributeCollection;
  197. clone._returnTypeAttributes.InitializeParent(clone);
  198. }
  199. if (null != _body)
  200. {
  201. clone._body = _body.Clone() as Block;
  202. clone._body.InitializeParent(clone);
  203. }
  204. if (null != _locals)
  205. {
  206. clone._locals = _locals.Clone() as LocalCollection;
  207. clone._locals.InitializeParent(clone);
  208. }
  209. clone._implementationFlags = _implementationFlags;
  210. if (null != _explicitInfo)
  211. {
  212. clone._explicitInfo = _explicitInfo.Clone() as ExplicitMemberInfo;
  213. clone._explicitInfo.InitializeParent(clone);
  214. }
  215. return clone;
  216. }
  217. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  218. override internal void ClearTypeSystemBindings()
  219. {
  220. _annotations = null;
  221. if (null != _attributes)
  222. {
  223. _attributes.ClearTypeSystemBindings();
  224. }
  225. if (null != _parameters)
  226. {
  227. _parameters.ClearTypeSystemBindings();
  228. }
  229. if (null != _genericParameters)
  230. {
  231. _genericParameters.ClearTypeSystemBindings();
  232. }
  233. if (null != _returnType)
  234. {
  235. _returnType.ClearTypeSystemBindings();
  236. }
  237. if (null != _returnTypeAttributes)
  238. {
  239. _returnTypeAttributes.ClearTypeSystemBindings();
  240. }
  241. if (null != _body)
  242. {
  243. _body.ClearTypeSystemBindings();
  244. }
  245. if (null != _locals)
  246. {
  247. _locals.ClearTypeSystemBindings();
  248. }
  249. if (null != _explicitInfo)
  250. {
  251. _explicitInfo.ClearTypeSystemBindings();
  252. }
  253. }
  254. [System.Xml.Serialization.XmlElement]
  255. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  256. public Block Body
  257. {
  258. get
  259. {
  260. if (_body == null)
  261. {
  262. _body = new Block();
  263. _body.InitializeParent(this);
  264. }
  265. return _body;
  266. }
  267. set
  268. {
  269. if (_body != value)
  270. {
  271. _body = value;
  272. if (null != _body)
  273. {
  274. _body.InitializeParent(this);
  275. }
  276. }
  277. }
  278. }
  279. [System.Xml.Serialization.XmlElement]
  280. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  281. public LocalCollection Locals
  282. {
  283. get
  284. {
  285. if (_locals == null) _locals = new LocalCollection(this);
  286. return _locals;
  287. }
  288. set
  289. {
  290. if (_locals != value)
  291. {
  292. _locals = value;
  293. if (null != _locals)
  294. {
  295. _locals.InitializeParent(this);
  296. }
  297. }
  298. }
  299. }
  300. [System.Xml.Serialization.XmlElement]
  301. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  302. public MethodImplementationFlags ImplementationFlags
  303. {
  304. get
  305. {
  306. return _implementationFlags;
  307. }
  308. set
  309. {
  310. _implementationFlags = value;
  311. }
  312. }
  313. [System.Xml.Serialization.XmlElement]
  314. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  315. public ExplicitMemberInfo ExplicitInfo
  316. {
  317. get
  318. {
  319. return _explicitInfo;
  320. }
  321. set
  322. {
  323. if (_explicitInfo != value)
  324. {
  325. _explicitInfo = value;
  326. if (null != _explicitInfo)
  327. {
  328. _explicitInfo.InitializeParent(this);
  329. }
  330. }
  331. }
  332. }
  333. }
  334. }