throws IOException
{
super.lexer = new ScenarioLexer(data);
CommonTokenStream tokens = new CommonTokenStream(lexer);
ScenarioParser thisParser = new ScenarioParser(tokens);
parser = thisParser;
((ScenarioLexer)lexer).enableErrorMessageCollection(true);
thisParser.enableErrorMessageCollection(true);
try
{
thisParser.start();
if (((ScenarioLexer)lexer).hasExceptions())
{
List<RecognitionException> exps = ((ScenarioLexer)lexer).getExceptions();
addErrorsLexer(source, exps);
return null;
}
if (thisParser.hasExceptions())
{
List<RecognitionException> exps = thisParser.getExceptions();
addErrorsParser(source, exps);
} else
{
return thisParser.getScenario();
}
} catch (RecognitionException errEx)
{
errEx.printStackTrace();
addError(new ParseError(source, errEx.line, errEx.charPositionInLine, getErrorMessage(errEx, parser.getTokenNames())));