KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > antlr > WildcardElement


1 package antlr;
2
3 /* ANTLR Translator Generator
4  * Project led by Terence Parr at http://www.jGuru.com
5  * Software rights: http://www.antlr.org/RIGHTS.html
6  *
7  * $Id: //depot/code/org.antlr/main/main/antlr/WildcardElement.java#4 $
8  */

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