diff --git a/src/main/resources/org/sablecc/sablecc/parser.txt b/src/main/resources/org/sablecc/sablecc/parser.txt index abccfcf66d8552d86945c2bbddea46108f98e5cf..359406afe47517a3ec16a988c430194d720cf399 100644 --- a/src/main/resources/org/sablecc/sablecc/parser.txt +++ b/src/main/resources/org/sablecc/sablecc/parser.txt @@ -382,7 +382,7 @@ Macro:ParserParseTail } case ERROR: throw new ParserException(this.last_token, - "[" + this.last_line + "," + this.last_pos + "] " + + "[" + this.last_line + "," + this.last_pos + "] " , Parser.errorMessages[Parser.errors[this.action[1]]]); } } @@ -673,6 +673,7 @@ import $1$.*; public class ParserException extends Exception { Token token; + String realMsg; public ParserException( Token token, String message) { @@ -680,10 +681,22 @@ public class ParserException extends Exception this.token = token; } + public ParserException( Token token, String prefix, String message) + { + super(prefix+message); + this.realMsg = message; + this.token = token; + } + public Token getToken() { return this.token; } + + public Token getRealMsg() + { + return this.realMsg; + } } $