1 package ppg.cmds; 2 3 import java.util.*; 4 import ppg.atoms.*; 5 import ppg.util.*; 6 public class DropCmd implements Command 7 { 8 private Production prod; private Vector sym; 11 19 20 public DropCmd(Vector symbols) 21 { 22 sym = symbols; 23 prod = null; 24 } 25 26 public DropCmd(Production productions) 27 { 28 prod = productions; 29 sym = null; 30 } 31 32 public boolean isProdDrop() { return prod != null; } 33 public boolean isSymbolDrop() { return sym != null; } 34 35 public Production getProduction() { return prod; } 36 public Vector getSymbols() { return sym; } 37 38 public void unparse(CodeWriter cw) { 39 cw.write("DropCmd"); 41 cw.allowBreak(0); 42 if (prod != null) 43 prod.unparse(cw); 44 else 45 for (int i=0; i < sym.size(); i++) { 46 cw.write((String )sym.elementAt(i)); 47 } 48 } 50 51 } 52 | Popular Tags |