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

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

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