11 this.classes=new SymbolTable();
12 this.treemethodmap=new Hashtable();
13 this.flatmethodmap=new Hashtable();
14 this.parsetrees=new HashSet();
15 this.arraytypes=new HashSet();
16 this.arraytonumber=new Hashtable();
19 public void addParseNode(ParseNode parsetree) {
20 parsetrees.add(parsetree);
23 public SymbolTable classes;
24 public Set parsetrees;
25 public Hashtable treemethodmap;
26 public Hashtable flatmethodmap;
27 private HashSet arraytypes;
28 public Hashtable arraytonumber;
29 private int numclasses=0;
30 private int arraycount=0;
32 public void addArrayType(TypeDescriptor td) {
33 if (!arraytypes.contains(td)) {
35 arraytonumber.put(td,new Integer(arraycount++));
39 public Iterator getArrayIterator() {
40 return arraytypes.iterator();
43 public int getArrayNumber(TypeDescriptor td) {
44 return ((Integer)arraytonumber.get(td)).intValue();
47 public int numArrays() {
48 return arraytypes.size();
51 public static TypeDescriptor getTypeDescriptor(int t) {
52 TypeDescriptor td=new TypeDescriptor(t);
56 public static TypeDescriptor getTypeDescriptor(NameDescriptor n) {
57 TypeDescriptor td=new TypeDescriptor(n);
61 public void addClass(ClassDescriptor tdn) {
62 if (classes.contains(tdn.getSymbol()))
63 throw new Error("Class "+tdn.getSymbol()+" defined twice");
68 public int numClasses() {
72 public BlockNode getMethodBody(MethodDescriptor md) {
73 return (BlockNode)treemethodmap.get(md);
76 public SymbolTable getClassSymbolTable() {
80 public FlatMethod getMethodFlat(MethodDescriptor md) {
81 return (FlatMethod)flatmethodmap.get(md);
84 public void addTreeCode(MethodDescriptor md, BlockNode bn) {
85 treemethodmap.put(md,bn);
88 public void addTreeCode(TaskDescriptor td, BlockNode bn) {
89 treemethodmap.put(td,bn);
92 public void addFlatCode(MethodDescriptor md, FlatMethod bn) {
93 flatmethodmap.put(md,bn);