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