KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > persistence > antlr > WildcardElement


1 package persistence.antlr;
2
3 /* ANTLR Translator Generator
4  * Project led by Terence Parr at http://www.jGuru.com
5  * Software rights: http://www.antlr.org/license.html
6  *
7  */

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