KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ppg > atoms > TerminalList


1 package ppg.atoms;
2
3 import java.util.*;
4
5 public class TerminalList
6 {
7     private String JavaDoc type;
8     private Vector symbols;
9     
10     public TerminalList(String JavaDoc type, Vector syms) {
11         this.type = type;
12         symbols = syms;
13     }
14     
15     public String JavaDoc toString() {
16         String JavaDoc result = "TERMINAL ";
17         if (type != null)
18             result += type;
19         
20         for (int i=0; i < symbols.size(); i++) {
21             result += (String JavaDoc)symbols.elementAt(i);
22             if (i < symbols.size() - 1)
23                 result += ", ";
24         }
25         return result + ";";
26     }
27 }
28
Popular Tags