KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ppg > atoms > GrammarSymbol


1 package ppg.atoms;
2
3 import ppg.util.*;
4
5 public abstract class GrammarSymbol extends GrammarPart implements Equatable
6 {
7     protected String JavaDoc name, label;
8
9     public String JavaDoc getName() {
10         return name;
11     }
12
13     public void unparse(CodeWriter cw) {
14         cw.begin(0);
15         cw.write(name);
16         if (label != null)
17             cw.write(":" + label);
18         cw.end();
19     }
20     
21     public String JavaDoc toString() {
22         String JavaDoc result = name;
23         if (label != null)
24             result += ":" + label;
25         return result;
26     }
27     
28 }
29
Popular Tags