PageRenderTime 48ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://github.com/w4x/boolangstudio
C# | 298 lines | 230 code | 38 blank | 30 comment | 63 complexity | bef2c6016db8776b280ceff222524e60 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 Event : TypeMember
  39. {
  40. protected Method _add;
  41. protected Method _remove;
  42. protected Method _raise;
  43. protected TypeReference _type;
  44. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  45. new public Event CloneNode()
  46. {
  47. return Clone() as Event;
  48. }
  49. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  50. override public NodeType NodeType
  51. {
  52. get
  53. {
  54. return NodeType.Event;
  55. }
  56. }
  57. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  58. override public void Accept(IAstVisitor visitor)
  59. {
  60. visitor.OnEvent(this);
  61. }
  62. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  63. override public bool Matches(Node node)
  64. {
  65. Event other = node as Event;
  66. if (null == other) return false;
  67. if (_modifiers != other._modifiers) return NoMatch("Event._modifiers");
  68. if (_name != other._name) return NoMatch("Event._name");
  69. if (!Node.AllMatch(_attributes, other._attributes)) return NoMatch("Event._attributes");
  70. if (!Node.Matches(_add, other._add)) return NoMatch("Event._add");
  71. if (!Node.Matches(_remove, other._remove)) return NoMatch("Event._remove");
  72. if (!Node.Matches(_raise, other._raise)) return NoMatch("Event._raise");
  73. if (!Node.Matches(_type, other._type)) return NoMatch("Event._type");
  74. return true;
  75. }
  76. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  77. override public bool Replace(Node existing, Node newNode)
  78. {
  79. if (base.Replace(existing, newNode))
  80. {
  81. return true;
  82. }
  83. if (_attributes != null)
  84. {
  85. Attribute item = existing as Attribute;
  86. if (null != item)
  87. {
  88. Attribute newItem = (Attribute)newNode;
  89. if (_attributes.Replace(item, newItem))
  90. {
  91. return true;
  92. }
  93. }
  94. }
  95. if (_add == existing)
  96. {
  97. this.Add = (Method)newNode;
  98. return true;
  99. }
  100. if (_remove == existing)
  101. {
  102. this.Remove = (Method)newNode;
  103. return true;
  104. }
  105. if (_raise == existing)
  106. {
  107. this.Raise = (Method)newNode;
  108. return true;
  109. }
  110. if (_type == existing)
  111. {
  112. this.Type = (TypeReference)newNode;
  113. return true;
  114. }
  115. return false;
  116. }
  117. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  118. override public object Clone()
  119. {
  120. Event clone = (Event)FormatterServices.GetUninitializedObject(typeof(Event));
  121. clone._lexicalInfo = _lexicalInfo;
  122. clone._endSourceLocation = _endSourceLocation;
  123. clone._documentation = _documentation;
  124. if (_annotations != null) clone._annotations = (Hashtable)_annotations.Clone();
  125. clone._modifiers = _modifiers;
  126. clone._name = _name;
  127. if (null != _attributes)
  128. {
  129. clone._attributes = _attributes.Clone() as AttributeCollection;
  130. clone._attributes.InitializeParent(clone);
  131. }
  132. if (null != _add)
  133. {
  134. clone._add = _add.Clone() as Method;
  135. clone._add.InitializeParent(clone);
  136. }
  137. if (null != _remove)
  138. {
  139. clone._remove = _remove.Clone() as Method;
  140. clone._remove.InitializeParent(clone);
  141. }
  142. if (null != _raise)
  143. {
  144. clone._raise = _raise.Clone() as Method;
  145. clone._raise.InitializeParent(clone);
  146. }
  147. if (null != _type)
  148. {
  149. clone._type = _type.Clone() as TypeReference;
  150. clone._type.InitializeParent(clone);
  151. }
  152. return clone;
  153. }
  154. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  155. override internal void ClearTypeSystemBindings()
  156. {
  157. _annotations = null;
  158. if (null != _attributes)
  159. {
  160. _attributes.ClearTypeSystemBindings();
  161. }
  162. if (null != _add)
  163. {
  164. _add.ClearTypeSystemBindings();
  165. }
  166. if (null != _remove)
  167. {
  168. _remove.ClearTypeSystemBindings();
  169. }
  170. if (null != _raise)
  171. {
  172. _raise.ClearTypeSystemBindings();
  173. }
  174. if (null != _type)
  175. {
  176. _type.ClearTypeSystemBindings();
  177. }
  178. }
  179. [System.Xml.Serialization.XmlElement]
  180. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  181. public Method Add
  182. {
  183. get
  184. {
  185. return _add;
  186. }
  187. set
  188. {
  189. if (_add != value)
  190. {
  191. _add = value;
  192. if (null != _add)
  193. {
  194. _add.InitializeParent(this);
  195. }
  196. }
  197. }
  198. }
  199. [System.Xml.Serialization.XmlElement]
  200. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  201. public Method Remove
  202. {
  203. get
  204. {
  205. return _remove;
  206. }
  207. set
  208. {
  209. if (_remove != value)
  210. {
  211. _remove = value;
  212. if (null != _remove)
  213. {
  214. _remove.InitializeParent(this);
  215. }
  216. }
  217. }
  218. }
  219. [System.Xml.Serialization.XmlElement]
  220. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  221. public Method Raise
  222. {
  223. get
  224. {
  225. return _raise;
  226. }
  227. set
  228. {
  229. if (_raise != value)
  230. {
  231. _raise = value;
  232. if (null != _raise)
  233. {
  234. _raise.InitializeParent(this);
  235. }
  236. }
  237. }
  238. }
  239. [System.Xml.Serialization.XmlElement]
  240. [System.CodeDom.Compiler.GeneratedCodeAttribute("astgen.boo", "1")]
  241. public TypeReference Type
  242. {
  243. get
  244. {
  245. return _type;
  246. }
  247. set
  248. {
  249. if (_type != value)
  250. {
  251. _type = value;
  252. if (null != _type)
  253. {
  254. _type.InitializeParent(this);
  255. }
  256. }
  257. }
  258. }
  259. }
  260. }