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:
09: class ActionElement extends AlternativeElement {
10: protected String actionText;
11: protected boolean isSemPred = false;
12:
13: public ActionElement(Grammar g, Token t) {
14: super (g);
15: actionText = t.getText();
16: line = t.getLine();
17: column = t.getColumn();
18: }
19:
20: public void generate() {
21: grammar.generator.gen(this );
22: }
23:
24: public Lookahead look(int k) {
25: return grammar.theLLkAnalyzer.look(k, this );
26: }
27:
28: public String toString() {
29: return " " + actionText + (isSemPred ? "?" : "");
30: }
31: }
|