Added the name of the file to the error report.
authorcristic <cristic>
Thu, 15 Apr 2004 20:20:48 +0000 (20:20 +0000)
committercristic <cristic>
Thu, 15 Apr 2004 20:20:48 +0000 (20:20 +0000)
Changed some error msgs.

Repair/RepairCompiler/MCC/CDL.cup
Repair/RepairCompiler/MCC/Compiler.java
Repair/RepairCompiler/MCC/MDL.cup
Repair/RepairCompiler/MCC/SDL.cup
Repair/RepairCompiler/MCC/TDL.cup
Repair/RepairCompiler/compiler-steps.txt
Repair/RepairCompiler/java_cup/runtime/lr_parser.class
Repair/RepairCompiler/java_cup/runtime/lr_parser.java
Repair/RepairCompiler/java_cup/runtime/virtual_parse_stack.class

index e6df103acbbac122346598cce8833221ebf1e77e..e77068d0b550de52ebbf8582d8c6b42ca4195017 100755 (executable)
@@ -56,13 +56,15 @@ action code {:
 init with {: :}
 
 parser code {:
+
+       public String filename;
        
        public void syntax_error (java_cup.runtime.Symbol current) {
 
                CUP$CDLParser$actions.errors = true;
                Symbol symbol = (Symbol) current;
-               report_error("CDL: Syntax error at line " + (symbol.line + 1)
-               + ", column " + LineCount.getColumn(symbol.left) + ": " + current.value, current);
+               report_error(filename+":"+(symbol.line+1)+": Syntax error at column " + LineCount.getColumn(symbol.left) +": " + current.value, current);
+               System.exit(0);
        }
 
        public void report_fatal_error (String message, Object info) {
index cc1f0de61a8a18e37997339710e098ac879ab23c..c2d16124949e68e7e20c68ec03a2d55d3fbd9e63 100755 (executable)
@@ -249,6 +249,7 @@ public class Compiler {
             LineCount.reset();
             FileInputStream infile = new FileInputStream(state.infile + ".struct");
             TDLParser parser = new TDLParser(new Lexer(infile));
+           parser.filename = state.infile + ".struct";
             CUP$TDLParser$actions.debug = state.verbose > 1 ;
             state.ptStructures = (ParseNode) parser.parse().value;
         } catch (FileNotFoundException fnfe) {
@@ -284,6 +285,7 @@ public class Compiler {
             LineCount.reset();
             FileInputStream infile = new FileInputStream(state.infile + ".space");
             SDLParser parser = new SDLParser(new Lexer(infile));
+           parser.filename = state.infile + ".space";
             CUP$SDLParser$actions.debug = state.verbose > 1 ;
             state.ptSpace = (ParseNode) parser.parse().value;
         } catch (FileNotFoundException fnfe) {
@@ -301,6 +303,7 @@ public class Compiler {
             LineCount.reset();
             FileInputStream infile = new FileInputStream(state.infile + ".constraints");
             CDLParser parser = new CDLParser(new Lexer(infile));
+           parser.filename = state.infile + ".constraints";
             CUP$CDLParser$actions.debug = state.verbose > 1 ;
             state.ptConstraints = (ParseNode) parser.parse().value;
         } catch (FileNotFoundException fnfe) {
index b8a2ad16e16e96205ba9c2a63e6347ad1ce67b2f..0a3aa0975b37d95b206f2c023e7db0178c02ae69 100755 (executable)
@@ -63,9 +63,8 @@ parser code {:
 
                CUP$MDLParser$actions.errors = true;
                Symbol symbol = (Symbol) current;
-               report_error(filename+": Syntax error at line " +
-(symbol.line + 1) + ", column " + LineCount.getColumn(symbol.left) +
-": " + current.value, current);
+               report_error(filename+":"+(symbol.line+1)+": Syntax error at column " + LineCount.getColumn(symbol.left) +": " + current.value, current);
+               System.exit(0);
        }
 
        public void report_fatal_error (String message, Object info) {
index f8997e99e4efa38b12a377f7723d1e0a224a8ecf..ee5172cba3e07342d01cac27efd37297c0626fbd 100755 (executable)
@@ -56,13 +56,16 @@ action code {:
 init with {: :}
 
 parser code {:
+
+       public String filename;
        
        public void syntax_error (java_cup.runtime.Symbol current) {
 
                CUP$SDLParser$actions.errors = true;
                Symbol symbol = (Symbol) current;
-               report_error("SDL: Syntax error at line " + (symbol.line + 1)
+               report_error("TDL: Syntax error at line " + (symbol.line + 1)
                + ", column " + LineCount.getColumn(symbol.left) + ": " + current.value, current);
+               System.exit(0);
        }
 
        public void report_fatal_error (String message, Object info) {
index c616b94395dd1c9df0cc43928f80ce0af3fad521..db35ad5cc0af5510ec2bceabb34eab2a5f15378c 100755 (executable)
@@ -56,13 +56,15 @@ action code {:
 init with {: :}
 
 parser code {:
+
+       public String filename;
        
        public void syntax_error (java_cup.runtime.Symbol current) {
 
                CUP$TDLParser$actions.errors = true;
                Symbol symbol = (Symbol) current;
-               report_error("TDL: Syntax error at line " + (symbol.line + 1)
-               + ", column " + LineCount.getColumn(symbol.left) + ": " + current.value, current);
+               report_error(filename+":"+(symbol.line+1)+": Syntax error at column " + LineCount.getColumn(symbol.left) +": " + current.value, current);
+               System.exit(0);
        }
 
        public void report_fatal_error (String message, Object info) {
index 8c321b4d08d08ac2db5b1afda6fb522cb6079c9a..336662fbcb0847d9484604cd01d3332ed0aedbcf 100755 (executable)
@@ -1,27 +1,33 @@
-1. Copy SimpleHash.h and .c to the working directory and add 
-   include "Simplehash.h"
+Step 1: Building Compiler
+-------------------------
+cd RepairCompiler/MCC
+make clean
+make
 
-2. Create function 
-   void assertvalidmemory(int low, int high) {
-   }
-       
-3. Create function 
-   void calltool(Type name)
-   * this is equiv to establishing a mapping in the interpreter version
-   * Type should be the type of the variable being mapped      
-   * the name of the formal paremater should be the name of the variable
-     used in the specs
-   * multiple parameters for multiple mappings 
-   * the body of the function should contain only
-     #include "spec-file.cc", 
-     where the files spec-file.* contain the specs 
 
-4. Declare global variables in specs.struct
+Step 2: Run Compiler
+--------------------
+Example: 
+For the specifs in ex.constraints, ex.struct, ex.space, ex.abstract, ex.model 
+in directory Repair/Ex:
 
-5. In RepairCompiler/MCC, generate the .cc file:
-   java -cp ../ MCC.Compiler spec-file,
-   where spec-file.* contain the specs
+A) cd Ex
+B) java -classpath <path to RepairCompiler> MCC.Compiler ex
 
-6. Compile the program under analysis
-   g++ program.c SimpleHash.cc libchecker.a -o program
\ No newline at end of file
+which builds:
+  ex.cc
+  ex_aux.h
+  ex_aux.cc
+  size.h
+  size.cc
+  
+
+Step 3: Compile checker
+-----------------------
+
+A) copy generated files into Runtime directory
+B) remove old object files rm *.o
+C) run ./buildruntime
+D) build checking object: g++ -g -c ex_aux.cc
+E) g++ -g ex_test.cc *.o
+F) run ./a.out
index 13347a8f0e15e093acb450494e59dd995858bd2f..f7b0ffab586802823ffb19feec9f137f7cebade5 100755 (executable)
Binary files a/Repair/RepairCompiler/java_cup/runtime/lr_parser.class and b/Repair/RepairCompiler/java_cup/runtime/lr_parser.class differ
index 3c8335cb25248cc6619f8f5324ce30d08b5e5543..0687120d8f3542d99d1d3a61c1674614752e6dfe 100755 (executable)
@@ -377,8 +377,8 @@ public abstract class lr_parser {
       System.err.print(message);
       if (info instanceof Symbol)
        if (((Symbol)info).left != -1)
-       System.err.println(" at character " + ((Symbol)info).left + 
-                          " of input");
+           //System.err.println(" at character " + ((Symbol)info).left + " of input");
+           System.err.println(" not expected here.");
        else System.err.println("");
       else System.err.println("");
     }
index a9c1b2a8c4237ec1c9d8db94a7eaf80461a7e64f..987c6acd3bd34477b5ddb53e694f4f248fda5b7c 100755 (executable)
Binary files a/Repair/RepairCompiler/java_cup/runtime/virtual_parse_stack.class and b/Repair/RepairCompiler/java_cup/runtime/virtual_parse_stack.class differ