private Var setIndex(int start, int end, HplsqlParser.For_range_stmtContext ctx) {

    if (ctx.T_REVERSE() == null)
      return new Var(ctx.L_ID().getText(), Long.valueOf(start));
    else
      return new Var(ctx.L_ID().getText(), Long.valueOf(end));
  }
To set the Value index for FOR Statement
hplsql/src/main/java/org/apache/hive/hplsql/Stmt.java