11 this.classes=new SymbolTable();
12 this.tasks=new SymbolTable();
13 this.treemethodmap=new Hashtable();
14 this.flatmethodmap=new Hashtable();
15 this.parsetrees=new HashSet();
16 this.arraytypes=new HashSet();
17 this.arraytonumber=new Hashtable();
20 public void addParseNode(ParseNode parsetree) {
21 parsetrees.add(parsetree);
24 public SymbolTable classes;
25 public SymbolTable tasks;
26 public Set parsetrees;
27 public Hashtable treemethodmap;
28 public Hashtable flatmethodmap;
29 private HashSet arraytypes;
30 public Hashtable arraytonumber;
31 private int numclasses=0;
32 private int numtasks=0;
33 private int arraycount=0;
35 public void addArrayType(TypeDescriptor td) {
36 if (!arraytypes.contains(td)) {
38 arraytonumber.put(td,new Integer(arraycount++));
42 public Iterator getArrayIterator() {
43 return arraytypes.iterator();
46 public int getArrayNumber(TypeDescriptor td) {
47 return ((Integer)arraytonumber.get(td)).intValue();
50 public int numArrays() {
51 return arraytypes.size();
54 public static TypeDescriptor getTypeDescriptor(int t) {
55 TypeDescriptor td=new TypeDescriptor(t);
59 public static TypeDescriptor getTypeDescriptor(NameDescriptor n) {
60 TypeDescriptor td=new TypeDescriptor(n);
64 public void addClass(ClassDescriptor tdn) {
65 if (classes.contains(tdn.getSymbol()))
66 throw new Error("Class "+tdn.getSymbol()+" defined twice");
71 public int numClasses() {
75 public BlockNode getMethodBody(MethodDescriptor md) {
76 return (BlockNode)treemethodmap.get(md);
79 public BlockNode getMethodBody(TaskDescriptor td) {
80 return (BlockNode)treemethodmap.get(td);
83 public SymbolTable getClassSymbolTable() {
87 public SymbolTable getTaskSymbolTable() {
91 public FlatMethod getMethodFlat(MethodDescriptor md) {
92 return (FlatMethod)flatmethodmap.get(md);
95 public void addTreeCode(MethodDescriptor md, BlockNode bn) {
96 treemethodmap.put(md,bn);
99 public void addTreeCode(TaskDescriptor td, BlockNode bn) {
100 treemethodmap.put(td,bn);
103 public void addFlatCode(MethodDescriptor md, FlatMethod bn) {
104 flatmethodmap.put(md,bn);
107 public void addFlatCode(TaskDescriptor td, FlatMethod bn) {
108 flatmethodmap.put(td,bn);
111 public void addTask(TaskDescriptor td) {
112 if (tasks.contains(td.getSymbol()))
113 throw new Error("Task "+td.getSymbol()+" defined twice");