PageRenderTime 49ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://github.com/w4x/boolangstudio
C# | 242 lines | 173 code | 39 blank | 30 comment | 36 complexity | beab7ac0769478059b09f0a3bda57bdd 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 ParameterDeclaration : Node, INodeWithAttributes
  39. {
  40. protected string _name;
  41. protected TypeReference _type;
  42. protected ParameterModifiers _modifiers;
  43. protected AttributeCollection _attributes;
  44. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  45. new public ParameterDeclaration CloneNode()
  46. {
  47. return Clone() as ParameterDeclaration;
  48. }
  49. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  50. override public NodeType NodeType
  51. {
  52. get
  53. {
  54. return NodeType.ParameterDeclaration;
  55. }
  56. }
  57. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  58. override public void Accept(IAstVisitor visitor)
  59. {
  60. visitor.OnParameterDeclaration(this);
  61. }
  62. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  63. override public bool Matches(Node node)
  64. {
  65. ParameterDeclaration other = node as ParameterDeclaration;
  66. if (null == other) return false;
  67. if (_name != other._name) return NoMatch("ParameterDeclaration._name");
  68. if (!Node.Matches(_type, other._type)) return NoMatch("ParameterDeclaration._type");
  69. if (_modifiers != other._modifiers) return NoMatch("ParameterDeclaration._modifiers");
  70. if (!Node.AllMatch(_attributes, other._attributes)) return NoMatch("ParameterDeclaration._attributes");
  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 (_type == existing)
  81. {
  82. this.Type = (TypeReference)newNode;
  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. return false;
  98. }
  99. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  100. override public object Clone()
  101. {
  102. ParameterDeclaration clone = (ParameterDeclaration)FormatterServices.GetUninitializedObject(typeof(ParameterDeclaration));
  103. clone._lexicalInfo = _lexicalInfo;
  104. clone._endSourceLocation = _endSourceLocation;
  105. clone._documentation = _documentation;
  106. if (_annotations != null) clone._annotations = (Hashtable)_annotations.Clone();
  107. clone._name = _name;
  108. if (null != _type)
  109. {
  110. clone._type = _type.Clone() as TypeReference;
  111. clone._type.InitializeParent(clone);
  112. }
  113. clone._modifiers = _modifiers;
  114. if (null != _attributes)
  115. {
  116. clone._attributes = _attributes.Clone() as AttributeCollection;
  117. clone._attributes.InitializeParent(clone);
  118. }
  119. return clone;
  120. }
  121. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  122. override internal void ClearTypeSystemBindings()
  123. {
  124. _annotations = null;
  125. if (null != _type)
  126. {
  127. _type.ClearTypeSystemBindings();
  128. }
  129. if (null != _attributes)
  130. {
  131. _attributes.ClearTypeSystemBindings();
  132. }
  133. }
  134. [System.Xml.Serialization.XmlAttribute]
  135. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  136. public string Name
  137. {
  138. get
  139. {
  140. return _name;
  141. }
  142. set
  143. {
  144. _name = value;
  145. }
  146. }
  147. [System.Xml.Serialization.XmlElement]
  148. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  149. public TypeReference Type
  150. {
  151. get
  152. {
  153. return _type;
  154. }
  155. set
  156. {
  157. if (_type != value)
  158. {
  159. _type = value;
  160. if (null != _type)
  161. {
  162. _type.InitializeParent(this);
  163. }
  164. }
  165. }
  166. }
  167. [System.Xml.Serialization.XmlAttribute,
  168. System.ComponentModel.DefaultValue(ParameterModifiers.None)]
  169. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  170. public ParameterModifiers Modifiers
  171. {
  172. get
  173. {
  174. return _modifiers;
  175. }
  176. set
  177. {
  178. _modifiers = value;
  179. }
  180. }
  181. [System.Xml.Serialization.XmlElement]
  182. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  183. public AttributeCollection Attributes
  184. {
  185. get
  186. {
  187. if (_attributes == null) _attributes = new AttributeCollection(this);
  188. return _attributes;
  189. }
  190. set
  191. {
  192. if (_attributes != value)
  193. {
  194. _attributes = value;
  195. if (null != _attributes)
  196. {
  197. _attributes.InitializeParent(this);
  198. }
  199. }
  200. }
  201. }
  202. }
  203. }