KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > antlr > CommonASTWithHiddenTokens


1 package antlr;
2
3 /* ANTLR Translator Generator
4  * Project led by Terence Parr at http://www.jGuru.com
5  * Software rights: http://www.antlr.org/RIGHTS.html
6  *
7  * $Id: //depot/code/org.antlr/main/main/antlr/CommonASTWithHiddenTokens.java#5 $
8  */

9
10 /** A CommonAST whose initialization copies hidden token
11  * information from the Token used to create a node.
12  */

13 public class CommonASTWithHiddenTokens extends CommonAST {
14     protected CommonHiddenStreamToken hiddenBefore, hiddenAfter; // references to hidden tokens
15

16     public CommonASTWithHiddenTokens() {
17         super();
18     }
19
20     public CommonASTWithHiddenTokens(Token tok) {
21         super(tok);
22     }
23
24     public CommonHiddenStreamToken getHiddenAfter() {
25         return hiddenAfter;
26     }
27
28     public CommonHiddenStreamToken getHiddenBefore() {
29         return hiddenBefore;
30     }
31
32     public void initialize(Token tok) {
33         CommonHiddenStreamToken t = (CommonHiddenStreamToken)tok;
34         super.initialize(t);
35         hiddenBefore = t.getHiddenBefore();
36         hiddenAfter = t.getHiddenAfter();
37     }
38 }
39
Popular Tags