PageRenderTime 48ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

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

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