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

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

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