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 WildcardElement extends GrammarAtom {
09: protected String label;
10:
11: public WildcardElement(Grammar g, Token t, int autoGenType) {
12: super (g, t, autoGenType);
13: line = t.getLine();
14: }
15:
16: public void generate(Context context) {
17: grammar.generator.gen(this , context);
18: }
19:
20: public String getLabel() {
21: return label;
22: }
23:
24: public Lookahead look(int k) {
25: return grammar.theLLkAnalyzer.look(k, this );
26: }
27:
28: public void setLabel(String label_) {
29: label = label_;
30: }
31:
32: public String toString() {
33: String s = " ";
34: if (label != null)
35: s += label + ":";
36: return s + ".";
37: }
38: }
|