Some modifications to allow to print the name of the file when a syntax error is...
[repair.git] / Repair / RepairCompiler / MCC / MDL.cup
index 7014831781db21cc2748038f01058459147d429d..b8a2ad16e16e96205ba9c2a63e6347ad1ce67b2f 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$MDLParser$actions.errors = true;
                Symbol symbol = (Symbol) current;
-               report_error("MDL: Syntax error at line " + (symbol.line + 1)
-               + ", column " + LineCount.getColumn(symbol.left) + ": " + current.value, current);
+               report_error(filename+": Syntax error at line " +
+(symbol.line + 1) + ", column " + LineCount.getColumn(symbol.left) +
+": " + current.value, current);
        }
 
        public void report_fatal_error (String message, Object info) {