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) {
terminal SUB;
terminal MULT;
terminal DIV;
+ terminal SUM;
terminal NOT;
terminal LT;
terminal FORALL;
terminal IN;
terminal INTEST;
+ terminal THIS;
terminal COMMA;
terminal SIZEOF;
terminal LABEL;
terminal INT;
terminal SUBTYPE;
+ terminal SUBCLASS;
terminal OF;
terminal SEMICOLON;