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

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

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