let command line define flags optionally
[repair.git] / Repair / RepairCompiler / MCC / SDL.cup
index f8997e99e4efa38b12a377f7723d1e0a224a8ecf..920181896ac55657642d76ccef8c7c5ab8881f53 100755 (executable)
@@ -56,13 +56,19 @@ 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)
-               + ", column " + LineCount.getColumn(symbol.left) + ": " + current.value, current);
+               Symbol symbol = (Symbol) current;               
+
+               report_error(filename+":"+(symbol.line+1)+": Syntax error at column " 
+                + (LineCount.getColumn(symbol.left)+1) +": " + current.value, current);
+
+               System.out.println();
+               System.exit(0);
        }
 
        public void report_fatal_error (String message, Object info) {
@@ -116,6 +122,7 @@ parser code {:
     terminal SUB; 
     terminal MULT; 
     terminal DIV;
+    terminal SUM;
 
     terminal NOT;
     terminal LT;
@@ -128,6 +135,7 @@ parser code {:
     terminal FORALL;
     terminal IN;
     terminal INTEST;
+    terminal THIS;
 
     terminal COMMA;
     terminal SIZEOF;
@@ -158,6 +166,7 @@ parser code {:
     terminal LABEL;
     terminal INT;
     terminal SUBTYPE;
+    terminal SUBCLASS;
     terminal OF;
 
     terminal SEMICOLON;