use of org.antlr.runtime.TokenRewriteStream in project hive by apache.
the class ParseDriver method parseTriggerActionExpression.
public ASTNode parseTriggerActionExpression(String command) throws ParseException {
HiveLexerX lexer = new HiveLexerX(new ANTLRNoCaseStringStream(command));
TokenRewriteStream tokens = new TokenRewriteStream(lexer);
HiveParser parser = new HiveParser(tokens);
parser.setTreeAdaptor(adaptor);
HiveParser_ResourcePlanParser.triggerActionExpressionStandalone_return r = null;
try {
r = parser.gResourcePlanParser.triggerActionExpressionStandalone();
} catch (RecognitionException e) {
e.printStackTrace();
throw new ParseException(parser.errors);
}
if (lexer.getErrors().size() != 0) {
throw new ParseException(lexer.getErrors());
} else if (parser.errors.size() != 0) {
throw new ParseException(parser.errors);
}
return r.getTree();
}
Aggregations