correct
[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     public HashSet noupdate;
39
40     public SetAnalysis setanalysis;
41     State() {
42         vConstraints = null;
43         vRules = null;
44
45         stTypes = null;
46         stSets = null;
47         stRelations = null;
48         stGlobals = null;
49
50         ptStructures = null;
51         ptModel = null;
52         ptConstraints = null;
53         ptSpace = null;
54         implicitrule=new Hashtable();
55         implicitruleinv=new Hashtable();
56         noupdate=new HashSet();
57     }
58
59     void printall() {
60         for(int i=0;i<vRules.size();i++) {
61             Rule r=(Rule)vRules.get(i);
62             System.out.println(r.toString());
63         }
64         for(int i=0;i<vConstraints.size();i++) {
65             Constraint c=(Constraint)vConstraints.get(i);
66             System.out.println(c.toString());
67         }
68     }
69
70 }