KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > persistence > antlr > preprocessor > Option


1 package persistence.antlr.preprocessor;
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 import persistence.antlr.collections.impl.Vector;
10
11 class Option {
12     protected String JavaDoc name;
13     protected String JavaDoc rhs;
14     protected Grammar enclosingGrammar;
15
16     public Option(String JavaDoc n, String JavaDoc rhs, Grammar gr) {
17         name = n;
18         this.rhs = rhs;
19         setEnclosingGrammar(gr);
20     }
21
22     public Grammar getEnclosingGrammar() {
23         return enclosingGrammar;
24     }
25
26     public String JavaDoc getName() {
27         return name;
28     }
29
30     public String JavaDoc getRHS() {
31         return rhs;
32     }
33
34     public void setEnclosingGrammar(Grammar g) {
35         enclosingGrammar = g;
36     }
37
38     public void setName(String JavaDoc n) {
39         name = n;
40     }
41
42     public void setRHS(String JavaDoc rhs) {
43         this.rhs = rhs;
44     }
45
46     public String JavaDoc toString() {
47         return "\t" + name + "=" + rhs;
48     }
49 }
50
Popular Tags