X-Git-Url: http://plrg.eecs.uci.edu/git/?p=repair.git;a=blobdiff_plain;f=Repair%2FRepairCompiler%2FMCC%2FMDL.cup;h=b8a2ad16e16e96205ba9c2a63e6347ad1ce67b2f;hp=44a64df09fbd37623cd46d93406299924ee4bbb8;hb=b63f5f1f7c6292259d7e322f4b89b8cf43891f0d;hpb=6eb0d44a90242a5a01db9b8c5c0acebf2bd42347 diff --git a/Repair/RepairCompiler/MCC/MDL.cup b/Repair/RepairCompiler/MCC/MDL.cup index 44a64df..b8a2ad1 100755 --- a/Repair/RepairCompiler/MCC/MDL.cup +++ b/Repair/RepairCompiler/MCC/MDL.cup @@ -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) { @@ -142,6 +145,7 @@ parser code {: terminal IMPLIES; terminal TRUE; + terminal FALSE; terminal ISVALID; terminal FOR; terminal TO; @@ -604,12 +608,19 @@ expr ::= /** standard *********************************/ literal ::= + TRUE {: debugMessage(PRODSTRING); 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);