PageRenderTime 50ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://github.com/w4x/boolangstudio
C# | 214 lines | 158 code | 26 blank | 30 comment | 41 complexity | 51a5bc10bc86bd8e4288269bbd64df2b 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 Field : TypeMember
  39. {
  40. protected TypeReference _type;
  41. protected Expression _initializer;
  42. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  43. new public Field CloneNode()
  44. {
  45. return Clone() as Field;
  46. }
  47. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  48. override public NodeType NodeType
  49. {
  50. get
  51. {
  52. return NodeType.Field;
  53. }
  54. }
  55. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  56. override public void Accept(IAstVisitor visitor)
  57. {
  58. visitor.OnField(this);
  59. }
  60. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  61. override public bool Matches(Node node)
  62. {
  63. Field other = node as Field;
  64. if (null == other) return false;
  65. if (_modifiers != other._modifiers) return NoMatch("Field._modifiers");
  66. if (_name != other._name) return NoMatch("Field._name");
  67. if (!Node.AllMatch(_attributes, other._attributes)) return NoMatch("Field._attributes");
  68. if (!Node.Matches(_type, other._type)) return NoMatch("Field._type");
  69. if (!Node.Matches(_initializer, other._initializer)) return NoMatch("Field._initializer");
  70. return true;
  71. }
  72. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  73. override public bool Replace(Node existing, Node newNode)
  74. {
  75. if (base.Replace(existing, newNode))
  76. {
  77. return true;
  78. }
  79. if (_attributes != null)
  80. {
  81. Attribute item = existing as Attribute;
  82. if (null != item)
  83. {
  84. Attribute newItem = (Attribute)newNode;
  85. if (_attributes.Replace(item, newItem))
  86. {
  87. return true;
  88. }
  89. }
  90. }
  91. if (_type == existing)
  92. {
  93. this.Type = (TypeReference)newNode;
  94. return true;
  95. }
  96. if (_initializer == existing)
  97. {
  98. this.Initializer = (Expression)newNode;
  99. return true;
  100. }
  101. return false;
  102. }
  103. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  104. override public object Clone()
  105. {
  106. Field clone = (Field)FormatterServices.GetUninitializedObject(typeof(Field));
  107. clone._lexicalInfo = _lexicalInfo;
  108. clone._endSourceLocation = _endSourceLocation;
  109. clone._documentation = _documentation;
  110. if (_annotations != null) clone._annotations = (Hashtable)_annotations.Clone();
  111. clone._modifiers = _modifiers;
  112. clone._name = _name;
  113. if (null != _attributes)
  114. {
  115. clone._attributes = _attributes.Clone() as AttributeCollection;
  116. clone._attributes.InitializeParent(clone);
  117. }
  118. if (null != _type)
  119. {
  120. clone._type = _type.Clone() as TypeReference;
  121. clone._type.InitializeParent(clone);
  122. }
  123. if (null != _initializer)
  124. {
  125. clone._initializer = _initializer.Clone() as Expression;
  126. clone._initializer.InitializeParent(clone);
  127. }
  128. return clone;
  129. }
  130. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  131. override internal void ClearTypeSystemBindings()
  132. {
  133. _annotations = null;
  134. if (null != _attributes)
  135. {
  136. _attributes.ClearTypeSystemBindings();
  137. }
  138. if (null != _type)
  139. {
  140. _type.ClearTypeSystemBindings();
  141. }
  142. if (null != _initializer)
  143. {
  144. _initializer.ClearTypeSystemBindings();
  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.XmlElement]
  168. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  169. public Expression Initializer
  170. {
  171. get
  172. {
  173. return _initializer;
  174. }
  175. set
  176. {
  177. if (_initializer != value)
  178. {
  179. _initializer = value;
  180. if (null != _initializer)
  181. {
  182. _initializer.InitializeParent(this);
  183. }
  184. }
  185. }
  186. }
  187. }
  188. }