AS3Parser parser,
RecognitionException e)
{
String msg;
if (e instanceof NoViableAltException) {
NoViableAltException ex = (NoViableAltException)e;
msg = "Unexpected token "+tokenName(parser, ex.getUnexpectedType());
if (statement != null) {
msg += " in "+ActionScriptFactory.str(statement);
}
} else if (e instanceof MismatchedTokenException) {
MismatchedTokenException ex = (MismatchedTokenException)e;
msg = "Unexpected token "+tokenName(parser, ex.getUnexpectedType())+" (expecting "+tokenName(parser, ex.expecting)+")";
if (statement != null) {
msg += " in "+ActionScriptFactory.str(statement);
}
} else {
if (statement == null) {