8 public State(ParseNode parsetree) {
9 this.parsetree=parsetree;
10 this.classes=new SymbolTable();
11 this.treemethodmap=new Hashtable();
12 this.flatmethodmap=new Hashtable();
15 public SymbolTable classes;
16 public ParseNode parsetree;
17 public Hashtable treemethodmap;
18 public Hashtable flatmethodmap;
20 public static TypeDescriptor getTypeDescriptor(int t) {
21 TypeDescriptor td=new TypeDescriptor(t);
25 public static TypeDescriptor getTypeDescriptor(NameDescriptor n) {
26 TypeDescriptor td=new TypeDescriptor(n);
30 public void addClass(ClassDescriptor tdn) {
31 if (classes.contains(tdn.getSymbol()))
32 throw new Error("Class "+tdn.getSymbol()+" defined twice");
36 public BlockNode getMethodBody(MethodDescriptor md) {
37 return (BlockNode)treemethodmap.get(md);
40 public SymbolTable getClassSymbolTable() {
44 public FlatMethod getMethodFlat(MethodDescriptor md) {
45 return (FlatMethod)flatmethodmap.get(md);
48 public void addTreeCode(MethodDescriptor md, BlockNode bn) {
49 treemethodmap.put(md,bn);
52 public void addFlatCode(MethodDescriptor md, FlatMethod bn) {
53 flatmethodmap.put(md,bn);