PageRenderTime 25ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://github.com/w4x/boolangstudio
C# | 214 lines | 158 code | 26 blank | 30 comment | 41 complexity | b0d5989ffa7e24715a6fdac0c87de87e 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 SpliceTypeMember : TypeMember
  39. {
  40. protected TypeMember _typeMember;
  41. protected Expression _nameExpression;
  42. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  43. new public SpliceTypeMember CloneNode()
  44. {
  45. return Clone() as SpliceTypeMember;
  46. }
  47. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  48. override public NodeType NodeType
  49. {
  50. get
  51. {
  52. return NodeType.SpliceTypeMember;
  53. }
  54. }
  55. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  56. override public void Accept(IAstVisitor visitor)
  57. {
  58. visitor.OnSpliceTypeMember(this);
  59. }
  60. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  61. override public bool Matches(Node node)
  62. {
  63. SpliceTypeMember other = node as SpliceTypeMember;
  64. if (null == other) return false;
  65. if (_modifiers != other._modifiers) return NoMatch("SpliceTypeMember._modifiers");
  66. if (_name != other._name) return NoMatch("SpliceTypeMember._name");
  67. if (!Node.AllMatch(_attributes, other._attributes)) return NoMatch("SpliceTypeMember._attributes");
  68. if (!Node.Matches(_typeMember, other._typeMember)) return NoMatch("SpliceTypeMember._typeMember");
  69. if (!Node.Matches(_nameExpression, other._nameExpression)) return NoMatch("SpliceTypeMember._nameExpression");
  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 (_typeMember == existing)
  92. {
  93. this.TypeMember = (TypeMember)newNode;
  94. return true;
  95. }
  96. if (_nameExpression == existing)
  97. {
  98. this.NameExpression = (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. SpliceTypeMember clone = (SpliceTypeMember)FormatterServices.GetUninitializedObject(typeof(SpliceTypeMember));
  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 != _typeMember)
  119. {
  120. clone._typeMember = _typeMember.Clone() as TypeMember;
  121. clone._typeMember.InitializeParent(clone);
  122. }
  123. if (null != _nameExpression)
  124. {
  125. clone._nameExpression = _nameExpression.Clone() as Expression;
  126. clone._nameExpression.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 != _typeMember)
  139. {
  140. _typeMember.ClearTypeSystemBindings();
  141. }
  142. if (null != _nameExpression)
  143. {
  144. _nameExpression.ClearTypeSystemBindings();
  145. }
  146. }
  147. [System.Xml.Serialization.XmlElement]
  148. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  149. public TypeMember TypeMember
  150. {
  151. get
  152. {
  153. return _typeMember;
  154. }
  155. set
  156. {
  157. if (_typeMember != value)
  158. {
  159. _typeMember = value;
  160. if (null != _typeMember)
  161. {
  162. _typeMember.InitializeParent(this);
  163. }
  164. }
  165. }
  166. }
  167. [System.Xml.Serialization.XmlElement]
  168. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  169. public Expression NameExpression
  170. {
  171. get
  172. {
  173. return _nameExpression;
  174. }
  175. set
  176. {
  177. if (_nameExpression != value)
  178. {
  179. _nameExpression = value;
  180. if (null != _nameExpression)
  181. {
  182. _nameExpression.InitializeParent(this);
  183. }
  184. }
  185. }
  186. }
  187. }
  188. }