X-Git-Url: http://plrg.eecs.uci.edu/git/?p=repair.git;a=blobdiff_plain;f=Repair%2FRepairCompiler%2FMCC%2FTDL.cup;h=db35ad5cc0af5510ec2bceabb34eab2a5f15378c;hp=0fbfa83897de08aeb05e38da12a47c0173a61801;hb=2aa90220f8a6a51dc84abb6c1dbb85db0b204f42;hpb=6eb0d44a90242a5a01db9b8c5c0acebf2bd42347 diff --git a/Repair/RepairCompiler/MCC/TDL.cup b/Repair/RepairCompiler/MCC/TDL.cup index 0fbfa83..db35ad5 100755 --- a/Repair/RepairCompiler/MCC/TDL.cup +++ b/Repair/RepairCompiler/MCC/TDL.cup @@ -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) { @@ -142,6 +144,7 @@ parser code {: terminal IMPLIES; terminal TRUE; + terminal FALSE; terminal ISVALID; terminal FOR; terminal TO; @@ -505,6 +508,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);