PageRenderTime 46ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

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

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