01: package persistence.antlr;
02:
03: /* ANTLR Translator Generator
04: * Project led by Terence Parr at http://www.jGuru.com
05: * Software rights: http://www.antlr.org/license.html
06: *
07: */
08:
09: /** A CommonAST whose initialization copies hidden token
10: * information from the Token used to create a node.
11: */
12: public class CommonASTWithHiddenTokens extends CommonAST {
13: protected CommonHiddenStreamToken hiddenBefore, hiddenAfter; // references to hidden tokens
14:
15: public CommonASTWithHiddenTokens() {
16: super ();
17: }
18:
19: public CommonASTWithHiddenTokens(Token tok) {
20: super (tok);
21: }
22:
23: public CommonHiddenStreamToken getHiddenAfter() {
24: return hiddenAfter;
25: }
26:
27: public CommonHiddenStreamToken getHiddenBefore() {
28: return hiddenBefore;
29: }
30:
31: public void initialize(Token tok) {
32: CommonHiddenStreamToken t = (CommonHiddenStreamToken) tok;
33: super.initialize(t);
34: hiddenBefore = t.getHiddenBefore();
35: hiddenAfter = t.getHiddenAfter();
36: }
37: }
|