{
queryTree = (CommonTree)(parser.root().getTree());
}
catch (RecognitionException e)
{
throw new ParseException(parser.getErrors());
}
catch (RewriteEmptyStreamException e)
{
throw new ParseException(parser.getErrors());
}
if (!parser.getErrors().isEmpty())
{
throw new ParseException(parser.getErrors());
}
if (!parser.errors.isEmpty())
{
throw new ParseException("parser error");
}
// Semantic analysis and code-gen.
// Eventually, I anticipate, I'll be forking these off into two separate phases.
return SemanticPhase.doSemanticAnalysis(queryTree);