d30e7cc4af074909c953d8085b7148b0a36e5e59
[repair.git] / Repair / RepairCompiler / MCC / State.java
1 package MCC;
2 // base package
3 // this class stores all the information needed for between passes
4
5 import MCC.IR.*;
6 import java.util.*;
7
8 public class State {
9     
10     public static State currentState = null;
11
12     public static boolean failed = false;
13     public static boolean debug = false;
14     public static int verbose = 0;
15
16     public static String infile;
17     public static String outfile;
18
19     public static final int VERBOSE_TOKENS = 1;
20
21     public ParseNode ptStructures;
22     public ParseNode ptModel;
23     public ParseNode ptConstraints;
24     public ParseNode ptSpace;
25
26     public SymbolTable stSets;
27     public SymbolTable stRelations;
28     public SymbolTable stTypes;
29     public SymbolTable stGlobals;
30
31     public Vector vConstraints;
32     public Vector vRules;
33
34     public Hashtable rulenodes;
35     public Hashtable constraintnodes;    
36     public Hashtable implicitrule;
37     public Hashtable implicitruleinv;
38
39     public SetAnalysis setanalysis;
40     State() {
41         vConstraints = null;
42         vRules = null;
43
44         stTypes = null;
45         stSets = null;
46         stRelations = null;
47         stGlobals = null;
48
49         ptStructures = null;
50         ptModel = null;
51         ptConstraints = null;
52         ptSpace = null;
53         implicitrule=new Hashtable();
54         implicitruleinv=new Hashtable();
55     }
56
57     void printall() {
58         for(int i=0;i<vRules.size();i++) {
59             Rule r=(Rule)vRules.get(i);
60             System.out.println(r.toString());
61         }
62         for(int i=0;i<vConstraints.size();i++) {
63             Constraint c=(Constraint)vConstraints.get(i);
64             System.out.println(c.toString());
65         }
66     }
67     
68 }