- NaiveGenerator ng = new NaiveGenerator(state);
- ng.generate(gcode);
- //WorklistGenerator wg = new WorklistGenerator(state);
- //wg.generate(gcode);
- gcode.close();
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(-1);
- }
-
- if (state.debug) {
- System.out.println("Compilation of " + state.infile + " successful.");
- System.out.println("#SUCCESS#");
- }
- } else if (cli.target == CLI.INTER) {
- if (state.debug) {
- System.out.println("Semantic analysis for " + cli.infile + ".");
- }
-
- success = scan(state) || error(state, "Scanning failed, not attempting to parse.");
- success = parse(state) || error(state, "Parsing failed, not attempting semantic analysis.");
- success = semantics(state) || error(state, "Semantic analysis failed.");
-
- if (state.debug) {
- System.out.println("Semantic analysis of " + state.infile + " successful.");
- System.out.println("#SUCCESS#");
- }
- } else if (cli.target == CLI.PARSE) {
- if (state.debug) {
- System.out.println("Parsing " + cli.infile + ".");
- }
-
- success = scan(state) || error(state, "Scanning failed, not attempting to parse.");
- success = parse(state) || error(state, "Parsing failed.");
-
- if (state.debug) {
- System.out.println("Parsing of " + state.infile + " successful.");
- System.out.println("#SUCCESS#");
- }
- } else if (cli.target == CLI.SCAN) {
- if (state.debug) {
- System.out.println("Scanning " + cli.infile + ".");
- }
-
- success = scan(state) || error(state, "Scanning failed.");
-
- if (state.debug) {
- System.out.println("Scanning of " + state.infile + " successful.");
- System.out.println("#SUCCESS#");
- }
- }
+ state.setanalysis=new SetAnalysis(state);
+ Termination termination=null;
+ /* Check partition constraints */
+ (new ImplicitSchema(state)).update();
+ termination=new Termination(state);
+
+ state.printall();
+ (new DependencyBuilder(state)).calculate();
+
+ try {
+ Vector nodes = new Vector(state.constraintnodes.values());
+ nodes.addAll(state.rulenodes.values());
+
+ FileOutputStream dotfile;
+
+ dotfile = new FileOutputStream(cli.infile + ".dependencies.dot");
+ GraphNode.DOTVisitor.visit(dotfile, nodes);
+ dotfile.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+
+ try {
+ FileOutputStream gcode = new FileOutputStream(cli.infile + ".c");
+
+
+ // do model optimizations
+ //(new Optimizer(state)).optimize();
+
+ FileOutputStream gcode2 = new FileOutputStream(cli.infile + "_aux.c");
+ FileOutputStream gcode3 = new FileOutputStream(cli.infile + "_aux.h");
+ RepairGenerator wg = new RepairGenerator(state,termination);
+ wg.generate(gcode,gcode2,gcode3, cli.infile + "_aux.h");
+ gcode2.close();
+ gcode3.close();
+ /* } else {
+ WorklistGenerator ng = new WorklistGenerator(state);
+ SetInclusion.worklist=true;
+ RelationInclusion.worklist=true;
+ ng.generate(gcode);
+ }*/
+ gcode.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+
+ if (state.debug) {
+ System.out.println("Compilation of " + state.infile + " successful.");
+ System.out.println("#SUCCESS#");
+ }