Changed some error msgs.
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) {
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) {
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) {
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) {
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) {
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) {
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) {
-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
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("");
}