01: package antlr;
02:
03: /* ANTLR Translator Generator
04: * Project led by Terence Parr at http://www.cs.usfca.edu
05: * Software rights: http://www.antlr.org/license.html
06: */
07:
08: class ActionElement extends AlternativeElement {
09: protected String actionText;
10: protected boolean isSemPred = false;
11:
12: public ActionElement(Grammar g, Token t) {
13: super (g);
14: actionText = t.getText();
15: line = t.getLine();
16: column = t.getColumn();
17: }
18:
19: public void generate(Context context) {
20: grammar.generator.gen(this , context);
21: }
22:
23: public Lookahead look(int k) {
24: return grammar.theLLkAnalyzer.look(k, this );
25: }
26:
27: public String toString() {
28: return " " + actionText + (isSemPred ? "?" : "");
29: }
30: }
|