/** Parses a numeric literal (can be signed) */ final public SqlLiteral NumericLiteral() throws ParseException { final SqlNumericLiteral num; final Span s; if (jj_2_324(2)) { jj_consume_token(PLUS); num = UnsignedNumericLiteral(); {if (true) return num;} } else if (jj_2_325(2)) { jj_consume_token(MINUS); s = span(); num = UnsignedNumericLiteral(); {if (true) return SqlLiteral.createNegative(num, s.end(this));} } else if (jj_2_326(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 { final SqlNumericLiteral num; final Span s; if (jj_2_324(2)) { jj_consume_token(PLUS); num = UnsignedNumericLiteral(); {if (true) return num;} } else if (jj_2_325(2)) { jj_consume_token(MINUS); s = span(); num = UnsignedNumericLiteral(); {if (true) return SqlLiteral.createNegative(num, s.end(this));} } else if (jj_2_326(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 {final SqlNumericLiteral num; final Span s; if (jj_2_329(2)) { jj_consume_token(PLUS); num = UnsignedNumericLiteral(); {if ("" != null) return num;} } else if (jj_2_330(2)) { jj_consume_token(MINUS); s = span(); num = UnsignedNumericLiteral(); {if ("" != null) return SqlLiteral.createNegative(num, s.end(this));} } else if (jj_2_331(2)) { num = UnsignedNumericLiteral(); {if ("" != null) return num;} } else { jj_consume_token(-1); throw new ParseException(); } throw new Error("Missing return statement in function"); }
private static SqlNode convert(PrecedenceClimbingParser.Token token) { switch (token.type) { case ATOM: return (SqlNode) token.o; case CALL: final PrecedenceClimbingParser.Call call = (PrecedenceClimbingParser.Call) token; final List<SqlNode> list = new ArrayList<>(); for (PrecedenceClimbingParser.Token arg : call.args) { list.add(convert(arg)); } final ToTreeListItem item = (ToTreeListItem) call.op.o; if (item.op == SqlStdOperatorTable.UNARY_MINUS && list.size() == 1 && list.get(0) instanceof SqlNumericLiteral) { return SqlLiteral.createNegative((SqlNumericLiteral) list.get(0), item.pos.plusAll(list)); } if (item.op == SqlStdOperatorTable.UNARY_PLUS && list.size() == 1 && list.get(0) instanceof SqlNumericLiteral) { return list.get(0); } return item.op.createCall(item.pos.plusAll(list), list); default: throw new AssertionError(token); } }
private static SqlNode convert(PrecedenceClimbingParser.Token token) { switch (token.type) { case ATOM: return (SqlNode) token.o; case CALL: final PrecedenceClimbingParser.Call call = (PrecedenceClimbingParser.Call) token; final List<SqlNode> list = new ArrayList<>(); for (PrecedenceClimbingParser.Token arg : call.args) { list.add(convert(arg)); } final ToTreeListItem item = (ToTreeListItem) call.op.o; if (item.op == SqlStdOperatorTable.UNARY_MINUS && list.size() == 1 && list.get(0) instanceof SqlNumericLiteral) { return SqlLiteral.createNegative((SqlNumericLiteral) list.get(0), item.pos.plusAll(list)); } if (item.op == SqlStdOperatorTable.UNARY_PLUS && list.size() == 1 && list.get(0) instanceof SqlNumericLiteral) { return list.get(0); } return item.op.createCall(item.pos.plusAll(list), list); default: throw new AssertionError(token); } }
/** Parses a numeric literal (can be signed) */ final public SqlLiteral NumericLiteral() throws ParseException { final SqlNumericLiteral num; final Span s; if (jj_2_458(2)) { jj_consume_token(PLUS); num = UnsignedNumericLiteral(); {if (true) return num;} } else if (jj_2_459(2)) { jj_consume_token(MINUS); s = span(); num = UnsignedNumericLiteral(); {if (true) return SqlLiteral.createNegative(num, s.end(this));} } else if (jj_2_460(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 { final SqlNumericLiteral num; final Span s; if (jj_2_332(2)) { jj_consume_token(PLUS); num = UnsignedNumericLiteral(); {if (true) return num;} } else if (jj_2_333(2)) { jj_consume_token(MINUS); s = span(); num = UnsignedNumericLiteral(); {if (true) return SqlLiteral.createNegative(num, s.end(this));} } else if (jj_2_334(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 { final SqlNumericLiteral num; final Span s; if (jj_2_321(2)) { jj_consume_token(PLUS); num = UnsignedNumericLiteral(); {if (true) return num;} } else if (jj_2_322(2)) { jj_consume_token(MINUS); s = span(); num = UnsignedNumericLiteral(); {if (true) return SqlLiteral.createNegative(num, s.end(this));} } else if (jj_2_323(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 { final SqlNumericLiteral num; final Span s; if (jj_2_308(2)) { jj_consume_token(PLUS); num = UnsignedNumericLiteral(); {if (true) return num;} } else if (jj_2_309(2)) { jj_consume_token(MINUS); s = span(); num = UnsignedNumericLiteral(); {if (true) return SqlLiteral.createNegative(num, s.end(this));} } else if (jj_2_310(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 { final SqlNumericLiteral num; final Span s; if (jj_2_362(2)) { jj_consume_token(PLUS); num = UnsignedNumericLiteral(); {if (true) return num;} } else if (jj_2_363(2)) { jj_consume_token(MINUS); s = span(); num = UnsignedNumericLiteral(); {if (true) return SqlLiteral.createNegative(num, s.end(this));} } else if (jj_2_364(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 { final SqlNumericLiteral num; final Span s; if (jj_2_368(2)) { jj_consume_token(PLUS); num = UnsignedNumericLiteral(); {if (true) return num;} } else if (jj_2_369(2)) { jj_consume_token(MINUS); s = span(); num = UnsignedNumericLiteral(); {if (true) return SqlLiteral.createNegative(num, s.end(this));} } else if (jj_2_370(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_264(2)) { jj_consume_token(PLUS); num = UnsignedNumericLiteral(); {if (true) return num;} } else if (jj_2_265(2)) { jj_consume_token(MINUS); pos = getPos(); num = UnsignedNumericLiteral(); {if (true) return SqlLiteral.createNegative(num, pos.plus(getPos()));} } else if (jj_2_266(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 { final SqlNumericLiteral num; final Span s; if (jj_2_327(2)) { jj_consume_token(PLUS); num = UnsignedNumericLiteral(); {if (true) return num;} } else if (jj_2_328(2)) { jj_consume_token(MINUS); s = span(); num = UnsignedNumericLiteral(); {if (true) return SqlLiteral.createNegative(num, s.end(this));} } else if (jj_2_329(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_264(2)) { jj_consume_token(PLUS); num = UnsignedNumericLiteral(); {if (true) return num;} } else if (jj_2_265(2)) { jj_consume_token(MINUS); pos = getPos(); num = UnsignedNumericLiteral(); {if (true) return SqlLiteral.createNegative(num, pos.plus(getPos()));} } else if (jj_2_266(2)) { num = UnsignedNumericLiteral(); {if (true) return num;} } else { jj_consume_token(-1); throw new ParseException(); } throw new Error("Missing return statement in function"); }