private Map<Integer, ASTNode> findParams(ASTNode executeRoot) {
    Preconditions.checkArgument(executeRoot.getType() == HiveParser.TOK_EXECUTE,
        "Unexpected ASTNode type");
    ASTNode executeParamList = (ASTNode)executeRoot.getChildren().get(0);
    Preconditions.checkArgument(executeParamList.getType() == HiveParser.TOK_EXECUTE_PARAM_LIST,
        "Unexpected execute parameter type");

    Map<Integer, ASTNode> paramMap = new HashMap<>();

    int idx=0;
    for (int i=0; i<executeParamList.getChildCount(); i++) {
      ASTNode param = (ASTNode)executeParamList.getChild(i);
      paramMap.put(++idx, param);
    }
    return paramMap;
  }
Given an AST root at EXECUTE node this method parses the tree to build a map
with key as monotonically increasing integer and value as the node representing value
of the parameter
ql/src/java/org/apache/hadoop/hive/ql/parse/ExecuteStatementAnalyzer.java