1 9 package org.lsmp.djep.xjep; 10 import java.util.*; 11 import org.nfunk.jep.*; 12 13 19 public class XSymbolTable extends SymbolTable 20 { 21 24 public XSymbolTable(VariableFactory varFac) 25 { 26 super(varFac); 27 } 28 29 30 public SymbolTable newInstance() 31 { 32 return new XSymbolTable(vf); 33 } 34 35 36 public void print(PrintVisitor pv) 37 { 38 for(Enumeration e = this.elements(); e.hasMoreElements(); ) 39 { 40 XVariable var = (XVariable) e.nextElement(); 41 pv.append(var.toString(pv)+"\n"); 42 } 44 } 45 46 47 public void copyConstants(SymbolTable symTab) 48 { 49 for(Enumeration e = symTab.elements(); e.hasMoreElements(); ) 50 { 51 Variable var = (Variable) e.nextElement(); 52 if(var.isConstant()) 53 this.addConstant(var.getName(),var.getValue()); 54 } 55 } 56 } 57 | Popular Tags |