1 package persistence.antlr; 2 3 8 9 class TokenRefElement extends GrammarAtom { 10 11 public TokenRefElement(Grammar g, 12 Token t, 13 boolean inverted, 14 int autoGenType) { 15 super(g, t, autoGenType); 16 not = inverted; 17 TokenSymbol ts = grammar.tokenManager.getTokenSymbol(atomText); 18 if (ts == null) { 19 g.antlrTool.error("Undefined token symbol: " + 20 atomText, grammar.getFilename(), t.getLine(), t.getColumn()); 21 } 22 else { 23 tokenType = ts.getTokenType(); 24 setASTNodeType(ts.getASTNodeType()); 28 } 29 line = t.getLine(); 30 } 31 32 public void generate() { 33 grammar.generator.gen(this); 34 } 35 36 public Lookahead look(int k) { 37 return grammar.theLLkAnalyzer.look(k, this); 38 } 39 } 40 | Popular Tags |