PageRenderTime 43ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

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

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