private ParserRuleContext parse(StoredProcedure proc) {
    HplsqlLexer lexer = new HplsqlLexer(new ANTLRInputStream(proc.getSource()));
    CommonTokenStream tokens = new CommonTokenStream(lexer);
    HplsqlParser parser = new HplsqlParser(tokens);
    ProcVisitor visitor = new ProcVisitor();
    parser.program().accept(visitor);
    return visitor.func != null ? visitor.func : visitor.proc;
  }
Execute a stored procedure using CALL or EXEC statement passing parameters
hplsql/src/main/java/org/apache/hive/hplsql/functions/HmsFunctionRegistry.java