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

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

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