X-Git-Url: http://plrg.eecs.uci.edu/git/?p=repair.git;a=blobdiff_plain;f=Repair%2FRepairCompiler%2FMCC%2FMDL.cup;h=efd49425a8caba6817f45243149a42306158cf8e;hp=0a3aa0975b37d95b206f2c023e7db0178c02ae69;hb=e05cc9652fbed7559107e24ade77d4656b35233e;hpb=2aa90220f8a6a51dc84abb6c1dbb85db0b204f42 diff --git a/Repair/RepairCompiler/MCC/MDL.cup b/Repair/RepairCompiler/MCC/MDL.cup index 0a3aa09..efd4942 100755 --- a/Repair/RepairCompiler/MCC/MDL.cup +++ b/Repair/RepairCompiler/MCC/MDL.cup @@ -63,7 +63,26 @@ parser code {: CUP$MDLParser$actions.errors = true; Symbol symbol = (Symbol) current; - report_error(filename+":"+(symbol.line+1)+": Syntax error at column " + LineCount.getColumn(symbol.left) +": " + current.value, current); + + //System.out.println("current.value = "+current.value + " " + current.value.equals("true")); + //System.out.println("current = " + current); + + boolean isInteger = true; + try{ + Integer.parseInt(current.value.toString()); + } catch(NumberFormatException e) { isInteger = false;} + + report_error(filename+":"+(symbol.line+1)+": Syntax error at column " + + (LineCount.getColumn(symbol.left)+1) +": " + current.value, current); + + if (current.value.equals("true") || isInteger) + System.out.println("Did you mean literal("+current.value+")?"); + + if (LineCount.getColumn(symbol.left) == 0) + System.out.println("Did you forget a semicolon on the previous line?"); + + + System.out.println(); System.exit(0); }