if (message != null) {
m = message;
}
if (re instanceof NoViableAltException) {
NoViableAltException ec = (NoViableAltException) re;
if (message == null || ec.token.getText() == null) {
m = ec.toString();
} else {
m = "Syntax Error:" + message + " : " + ec.token.getText();
}
String[] messages = { m };
int st = converter.convert(ec.token.getLine(), ec.token.getCharPositionInLine());
String sm = ec.token.getText();
int et = st + ec.token.getText().length();
if (st == -1)
return;
DefaultProblem defaultProblem = new DefaultProblem("", messages[0], 0, new String[] {},
ProblemSeverities.Error, st, et, ec.token.getLine());
if (!problems.contains(defaultProblem)) {
reporter.reportProblem(defaultProblem);
problems.add(defaultProblem);
System.out.println(messages[0] + " ### line " + ec.token.getLine());
}
} else if (re instanceof MismatchedTokenException) {
MismatchedTokenException ec = (MismatchedTokenException) re;
if (message == null || ec.token.getText() == null) {
m = ec.toString();
} else {
m = "mismatched input: " + message + " : " + ec.token.getText();
}
// if (message == null) {
// message = "mismatched input "