1 package antlr; 2 3 9 10 class ActionElement extends AlternativeElement { 11 protected String actionText; 12 protected boolean isSemPred = false; 13 14 15 public ActionElement(Grammar g, Token t) { 16 super(g); 17 actionText = t.getText(); 18 line = t.getLine(); 19 column = t.getColumn(); 20 } 21 22 public void generate() { 23 grammar.generator.gen(this); 24 } 25 26 public Lookahead look(int k) { 27 return grammar.theLLkAnalyzer.look(k, this); 28 } 29 30 public String toString() { 31 return " " + actionText + (isSemPred?"?":""); 32 } 33 } 34 | Popular Tags |