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

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

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