1 20 21 22 25 class Tparlist implements AST { 26 Tparlist parlist; Tident ident; 29 public Tparlist(Tparlist p, Tident i) { 30 parlist=p; 31 ident=i; 32 } 33 34 public Tparlist(Tident i) { 35 parlist=null; 36 ident=i; 37 } 38 39 public String toString() { 40 if (parlist!=null) 41 return parlist+","+ident; 42 else 43 return ident.toString(); 44 } 45 46 public void setSymtab(SymTab st, boolean isInput, int index) { 47 boolean isNew = st.enter(ident.toString(), 48 new STEvar(ident.toString(), isInput, index)); 49 50 if (!isNew) Main.error("Variable "+ident+" defined twice!"); 51 if (parlist!=null) parlist.setSymtab(st, isInput, index+1); 52 } 53 } 54 55 | Popular Tags |