KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ppg > cmds > TransferCmd


1 package ppg.cmds;
2
3 import java.util.*;
4 import ppg.atoms.*;
5 import ppg.util.*;
6
7 public class TransferCmd implements Command
8 {
9     private Nonterminal nonterminal;
10     private Vector transferList;
11     
12     public TransferCmd(String JavaDoc nt, Vector tlist) {
13         nonterminal = new Nonterminal(nt);
14         transferList = tlist;
15     }
16
17     public Nonterminal getSource() { return nonterminal; }
18     public Vector getTransferList() { return transferList; }
19     
20     public void unparse(CodeWriter cw) {
21         //cw.begin(0);
22
cw.write("TransferCmd");
23         cw.allowBreak(2);
24         cw.write(nonterminal + " to ");
25         Production prod;
26         for (int i=0; i < transferList.size(); i++) {
27             prod = (Production) transferList.elementAt(i);
28             prod.unparse(cw);
29         }
30         //cw.end();
31
}
32     
33 }
34
Popular Tags