OK, the parser now looks more decent.
[repair.git] / Repair / RepairCompiler / MCC / TDL.cup
index 0fbfa83897de08aeb05e38da12a47c0173a61801..25ba2dd3e9e850ac635e2e45135be25f7f4114ce 100755 (executable)
@@ -56,13 +56,17 @@ 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)+1) +": " + current.value, current);
+               System.out.println();
+               System.exit(0);
        }
 
        public void report_fatal_error (String message, Object info) {
@@ -142,6 +146,7 @@ parser code {:
 
     terminal IMPLIES;
     terminal TRUE;
+    terminal FALSE;
     terminal ISVALID;
     terminal FOR;
     terminal TO;
@@ -505,6 +510,12 @@ literal ::=
        RESULT = (new ParseNode("literal", parser.curLine(1))).addChild("boolean").addChild("true").getRoot();
        :}
         
+       | FALSE
+       {:
+       debugMessage(PRODSTRING);
+       RESULT = (new ParseNode("literal", parser.curLine(1))).addChild("boolean").addChild("false").getRoot();
+       :}
+        
        | DECIMAL:dec
        {:
        debugMessage(PRODSTRING);