@Override public int reduceExpr(int ordinal, List<Object> list) { SqlNode left = (SqlNode) list.get(ordinal - 1); SqlNode right = (SqlNode) list.get(ordinal + 1); final SqlParserUtil.ToTreeListItem treeListItem = (SqlParserUtil.ToTreeListItem) list.get(ordinal); SqlParserUtil.replaceSublist( list, ordinal - 1, ordinal + 2, createCall( left.getParserPosition() .plus(right.getParserPosition()) .plus(treeListItem.getPos()), left, right)); return ordinal - 1; }
@Override public int reduceExpr(int ordinal, List<Object> list) { SqlNode left = (SqlNode) list.get(ordinal - 1); SqlNode right = (SqlNode) list.get(ordinal + 1); final SqlParserUtil.ToTreeListItem treeListItem = (SqlParserUtil.ToTreeListItem) list.get(ordinal); SqlParserUtil.replaceSublist( list, ordinal - 1, ordinal + 2, createCall( left.getParserPosition() .plus(right.getParserPosition()) .plus(treeListItem.getPos()), left, right)); return ordinal - 1; }
/** * Parses one or more rows in a VALUES expression. */ final public SqlNodeList RowConstructorList(SqlParserPos pos) throws ParseException { List<SqlNode> list = new ArrayList<SqlNode>(); SqlNode rowConstructor; rowConstructor = RowConstructor(); list.add(rowConstructor); label_7: while (true) { if (jj_2_101(2)) { ; } else { break label_7; } jj_consume_token(COMMA); rowConstructor = RowConstructor(); list.add(rowConstructor); } {if (true) return new SqlNodeList(list, pos.plus(getPos()));} throw new Error("Missing return statement in function"); }
/** * Parses one or more rows in a VALUES expression. */ final public SqlNodeList RowConstructorList(SqlParserPos pos) throws ParseException { List list = new ArrayList(); SqlNode rowConstructor; rowConstructor = RowConstructor(); list.add(rowConstructor); label_7: while (true) { if (jj_2_100(2)) { ; } else { break label_7; } jj_consume_token(COMMA); rowConstructor = RowConstructor(); list.add(rowConstructor); } {if (true) return new SqlNodeList(list, pos.plus(getPos()));} throw new Error("Missing return statement in function"); }
/** * Parses a list of expressions separated by commas. */ final public SqlNodeList ExpressionCommaList(SqlParserPos pos, ExprContext exprContext) throws ParseException { List<SqlNode> list; SqlNode e; e = Expression(exprContext); if (pos == null) { pos = getPos(); } pos = pos.plus(getPos()); list = startList(e); label_8: while (true) { if (jj_2_109(2)) { ; } else { break label_8; } jj_consume_token(COMMA); e = Expression(ExprContext.ACCEPT_SUBQUERY); list.add(e); pos = pos.plus(getPos()); } {if (true) return new SqlNodeList(list, pos);} throw new Error("Missing return statement in function"); }
/** * Parses a list of expressions separated by commas. */ final public SqlNodeList ExpressionCommaList(SqlParserPos pos, ExprContext exprContext) throws ParseException { List list; SqlNode e; e = Expression(exprContext); if (pos == null) { pos = getPos(); } pos = pos.plus(getPos()); list = startList(e); label_8: while (true) { if (jj_2_108(2)) { ; } else { break label_8; } jj_consume_token(COMMA); e = Expression(ExprContext.ACCEPT_SUBQUERY); list.add(e); pos = pos.plus(getPos()); } {if (true) return new SqlNodeList(list, pos);} throw new Error("Missing return statement in function"); }
/** * Parses a VALUES leaf query expression. */ final public SqlNode TableConstructor() throws ParseException { SqlNodeList rowConstructorList; SqlParserPos pos; jj_consume_token(VALUES); pos = getPos(); rowConstructorList = RowConstructorList(pos); {if (true) return SqlStdOperatorTable.valuesOperator.createCall( pos.plus(getPos()), rowConstructorList.toArray());} throw new Error("Missing return statement in function"); }
/** * List of simple identifiers in parentheses. The position extends from the * open parenthesis to the close parenthesis. */ final public SqlNodeList ParenthesizedSimpleIdentifierList() throws ParseException { SqlParserPos pos; SqlNodeList list; jj_consume_token(LPAREN); pos = getPos(); list = SimpleIdentifierCommaList(); jj_consume_token(RPAREN); {if (true) return list.clone(pos.plus(getPos()));} throw new Error("Missing return statement in function"); }
/** * Parses a VALUES leaf query expression. */ final public SqlNode TableConstructor() throws ParseException { SqlNodeList rowConstructorList; SqlParserPos pos; jj_consume_token(VALUES); pos = getPos(); rowConstructorList = RowConstructorList(pos); {if (true) return SqlStdOperatorTable.VALUES.createCall( pos.plus(getPos()), rowConstructorList.toArray());} throw new Error("Missing return statement in function"); }
final public SqlNode NamedRoutineCall(SqlFunctionCategory routineType, ExprContext exprContext) throws ParseException { SqlIdentifier name; SqlNodeList args; SqlParserPos pos; name = CompoundIdentifier(); pos = getPos(); if (jj_2_44(2)) { jj_consume_token(LPAREN); pos = getPos(); jj_consume_token(RPAREN); pos = pos.plus(getPos()); args = new SqlNodeList(pos); } else if (jj_2_45(2)) { args = ParenthesizedQueryOrCommaList(exprContext); pos = pos.plus(getPos()); } else { jj_consume_token(-1); throw new ParseException(); } SqlNode function = createCall( name, pos, routineType, null, SqlParserUtil.toNodeArray(args)); {if (true) return function;} throw new Error("Missing return statement in function"); }
/** * Parses one item in a select list. */ final public SqlNode SelectItem() throws ParseException { SqlNode e; SqlIdentifier id; SqlParserPos pos; e = SelectExpression(); if (jj_2_63(2)) { if (jj_2_62(2)) { jj_consume_token(AS); } else { ; } id = SimpleIdentifier(); pos = e.getParserPosition().plus(getPos()); e = SqlStdOperatorTable.asOperator.createCall(pos, e, id); } else { ; } {if (true) return e;} throw new Error("Missing return statement in function"); }
final public SqlNode NamedRoutineCall(SqlFunctionCategory routineType, ExprContext exprContext) throws ParseException { SqlIdentifier name; SqlNodeList args; SqlParserPos pos; name = CompoundIdentifier(); pos = getPos(); if (jj_2_45(2)) { jj_consume_token(LPAREN); pos = getPos(); jj_consume_token(RPAREN); pos = pos.plus(getPos()); args = new SqlNodeList(pos); } else if (jj_2_46(2)) { args = ParenthesizedQueryOrCommaList(exprContext); pos = pos.plus(getPos()); } else { jj_consume_token(-1); throw new ParseException(); } SqlNode function = createCall( name, pos, routineType, null, SqlParserUtil.toNodeArray(args)); {if (true) return function;} throw new Error("Missing return statement in function"); }
/** * Parses one item in a select list. */ final public SqlNode SelectItem() throws ParseException { SqlNode e; SqlIdentifier id; SqlParserPos pos; e = SelectExpression(); if (jj_2_64(2)) { if (jj_2_63(2)) { jj_consume_token(AS); } else { ; } id = SimpleIdentifier(); pos = e.getParserPosition().plus(getPos()); e = SqlStdOperatorTable.AS.createCall(pos, e, id); } else { ; } {if (true) return e;} throw new Error("Missing return statement in function"); }
ImmutableList.of(id, "*"), null, pos.plus(starPos), ImmutableList.of(pos, starPos));} } else if (jj_2_66(2)) {
/** Parses a numeric literal (can be signed) */ final public SqlLiteral NumericLiteral() throws ParseException { SqlNumericLiteral num; SqlParserPos pos; if (jj_2_204(2)) { jj_consume_token(PLUS); num = UnsignedNumericLiteral(); {if (true) return num;} } else if (jj_2_205(2)) { jj_consume_token(MINUS); pos = getPos(); num = UnsignedNumericLiteral(); {if (true) return SqlLiteral.createNegative(num, pos.plus(getPos()));} } else if (jj_2_206(2)) { num = UnsignedNumericLiteral(); {if (true) return num;} } else { jj_consume_token(-1); throw new ParseException(); } throw new Error("Missing return statement in function"); }
/** Parses a numeric literal (can be signed) */ final public SqlLiteral NumericLiteral() throws ParseException { SqlNumericLiteral num; SqlParserPos pos; if (jj_2_195(2)) { jj_consume_token(PLUS); num = UnsignedNumericLiteral(); {if (true) return num;} } else if (jj_2_196(2)) { jj_consume_token(MINUS); pos = getPos(); num = UnsignedNumericLiteral(); {if (true) return SqlLiteral.createNegative(num, pos.plus(getPos()));} } else if (jj_2_197(2)) { num = UnsignedNumericLiteral(); {if (true) return num;} } else { jj_consume_token(-1); throw new ParseException(); } throw new Error("Missing return statement in function"); }
throw new ParseException(); {if (true) return new SqlSetOption(pos.plus(getPos()), scope, name, val);} throw new Error("Missing return statement in function");
p = token.image; intervalQualifier = IntervalQualifier(); {if (true) return parseIntervalLiteral(pos.plus(getPos()), sign, p, intervalQualifier);} throw new Error("Missing return statement in function");
p = token.image; intervalQualifier = IntervalQualifier(); {if (true) return parseIntervalLiteral(pos.plus(getPos()), sign, p, intervalQualifier);} throw new Error("Missing return statement in function");