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