2 using AST
= antlr
.collections
.AST
;
6 /*ANTLR Translator Generator
7 * Project led by Terence Parr at http://www.jGuru.com
8 * Software rights: http://www.antlr.org/license.html
14 // ANTLR C# Code Generator by Micheal Jordan
15 // Kunle Odutola : kunle UNDERSCORE odutola AT hotmail DOT com
16 // Anthony Oguntimehin
18 // With many thanks to Eric V. Smith from the ANTLR list.
21 /*A CommonAST whose initialization copies hidden token
22 * information from the Token used to create a node.
25 public class CommonASTWithHiddenTokens
: CommonAST
27 new public static readonly CommonASTWithHiddenTokens
.CommonASTWithHiddenTokensCreator Creator
= new CommonASTWithHiddenTokensCreator();
29 protected internal IHiddenStreamToken hiddenBefore
, hiddenAfter
; // references to hidden tokens
31 public CommonASTWithHiddenTokens() : base()
35 public CommonASTWithHiddenTokens(IToken tok
) : base(tok
)
39 [Obsolete("Deprecated since version 2.7.2. Use ASTFactory.dup() instead.", false)]
40 protected CommonASTWithHiddenTokens(CommonASTWithHiddenTokens another
) : base(another
)
42 hiddenBefore
= another
.hiddenBefore
;
43 hiddenAfter
= another
.hiddenAfter
;
46 public virtual IHiddenStreamToken
getHiddenAfter()
51 public virtual IHiddenStreamToken
getHiddenBefore()
56 override public void initialize(AST t
)
58 hiddenBefore
= ((CommonASTWithHiddenTokens
) t
).getHiddenBefore();
59 hiddenAfter
= ((CommonASTWithHiddenTokens
) t
).getHiddenAfter();
63 override public void initialize(IToken tok
)
65 IHiddenStreamToken t
= (IHiddenStreamToken
) tok
;
67 hiddenBefore
= t
.getHiddenBefore();
68 hiddenAfter
= t
.getHiddenAfter();
71 #region Implementation of ICloneable
72 [Obsolete("Deprecated since version 2.7.2. Use ASTFactory.dup() instead.", false)]
73 override public object Clone()
75 return new CommonASTWithHiddenTokens(this);
79 public class CommonASTWithHiddenTokensCreator
: ASTNodeCreator
81 public CommonASTWithHiddenTokensCreator() {}
84 /// Returns the fully qualified name of the AST type that this
87 public override string ASTNodeTypeName
91 return typeof(antlr
.CommonASTWithHiddenTokens
).FullName
;;
96 /// Constructs a <see cref="AST"/> instance.
98 public override AST
Create()
100 return new CommonASTWithHiddenTokens();