public ASTNode parseTriggerExpression(String command) throws ParseException {
    GenericHiveLexer lexer = GenericHiveLexer.of(command, null);
    TokenRewriteStream tokens = new TokenRewriteStream(lexer);
    HiveParser parser = new HiveParser(tokens);
    parser.setTreeAdaptor(adaptor);
    ParserRuleReturnScope r;
    try {
      r = parser.triggerExpressionStandalone();
    } catch (RecognitionException e) {
      throw new ParseException(parser.errors, e);
    }
    if (lexer.getErrors().size() != 0) {
      throw new ParseException(lexer.getErrors());
    } else if (parser.errors.size() != 0) {
      throw new ParseException(parser.errors);
    }

    return (ASTNode) r.getTree();
  }
Parses a command, optionally assigning the parser's token stream to the
given context.

@param command
         command to parse

@param configuration
         hive configuration

@return parsed AST
parser/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java