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: import persistence.antlr.Token;
09: import persistence.antlr.collections.AST;
10:
11: public class ParseTreeToken extends ParseTree {
12: protected Token token;
13:
14: public ParseTreeToken(Token token) {
15: this .token = token;
16: }
17:
18: protected int getLeftmostDerivation(StringBuffer buf, int step) {
19: buf.append(' ');
20: buf.append(toString());
21: return step; // did on replacements
22: }
23:
24: public String toString() {
25: if (token != null) {
26: return token.getText();
27: }
28: return "<missing token>";
29: }
30: }
|