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

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

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