public StreamlineParser(String s) { this.impl = new StreamlineParserImpl(new StringReader(s)); this.impl.setTabSize(1); this.impl.setQuotedCasing(Lex.ORACLE.quotedCasing); this.impl.setUnquotedCasing(Lex.ORACLE.unquotedCasing); this.impl.setIdentifierMaxLength(DEFAULT_IDENTIFIER_MAX_LENGTH); /* * By default parser uses [ ] for quoting identifiers. Switching to DQID (double quoted identifiers) * is needed for array and map access (m['x'] = 1 or arr[2] = 10 etc) to work. */ this.impl.switchTo("DQID"); }
final List<SqlNode> list = Lists.newArrayList(); final SqlParserPos pos; name = CompoundIdentifier(); pos = getPos(); jj_consume_token(LPAREN); if (jj_2_79(2)) { Arg0(list, exprContext); label_4: while (true) { if (jj_2_78(2)) { jj_consume_token(COMMA); checkNonQueryExpression(exprContext); Arg(list, exprContext); jj_consume_token(RPAREN); SqlNode function = createCall( name, pos.plus(getPos()), routineType, null, SqlParserUtil.toNodeArray(list)); {if (true) return function;} throw new Error("Missing return statement in function");
SqlNode e; SqlParserPos pos; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case DATE: case FALSE: case PLUS: case MINUS: e = Literal(); {if (true) return e;} break; default: jj_la1[0] = jj_gen; if (jj_2_230(2)) { e = DynamicParam(); {if (true) return e;} } else if (jj_2_231(2)) { e = BuiltinFunctionCall(); {if (true) return e;} } else if (jj_2_232(2)) { e = JdbcFunctionCall(); {if (true) return e;} } else if (jj_2_233(2)) { e = MultisetConstructor(); {if (true) return e;} } else if (jj_2_234(2)) { e = ArrayConstructor(); {if (true) return e;} } else if (jj_2_235(2)) {
TimeUnit interval; SqlNode node; if (jj_2_486(2)) { jj_consume_token(CAST); pos = getPos(); jj_consume_token(LPAREN); e = Expression(ExprContext.ACCEPT_SUB_QUERY); args = startList(e); jj_consume_token(AS); if (jj_2_464(2)) { dt = DataType(); args.add(dt); } else if (jj_2_465(2)) { jj_consume_token(INTERVAL); e = IntervalQualifier(); args.add(e); } else { jj_consume_token(-1); throw new ParseException(); jj_consume_token(RPAREN); {if (true) return SqlStdOperatorTable.CAST.createCall( pos.plus(getPos()), SqlParserUtil.toNodeArray(args));} } else if (jj_2_487(2)) { jj_consume_token(EXTRACT); pos = getPos(); TimeUnit unit; jj_consume_token(LPAREN); unit = TimeUnit();
SqlNode e; SqlOperator op; SqlParserPos pos = getPos(); Expression2b(exprContext, list); if (jj_2_221(2)) { label_18: while (true) { if (jj_2_214(2)) { checkNonQueryExpression(exprContext); if (jj_2_198(2)) { jj_consume_token(NOT); jj_consume_token(IN); op = SqlStdOperatorTable.NOT_IN; pos = getPos(); } else if (jj_2_199(2)) { jj_consume_token(IN); op = SqlStdOperatorTable.IN; pos = getPos(); } else { jj_consume_token(-1); throw new ParseException(); nodeList = ParenthesizedQueryOrCommaList(ExprContext.ACCEPT_NONCURSOR); list.add(new SqlParserUtil.ToTreeListItem(op, pos)); pos = pos.plus(getPos()); } else if (jj_2_215(2)) { checkNonQueryExpression(exprContext); if (jj_2_206(2)) {
if (jj_2_603(2)) { jj_consume_token(EQ); {if (true) return SqlStdOperatorTable.EQUALS;} } else if (jj_2_604(2)) { jj_consume_token(GT); {if (true) return SqlStdOperatorTable.GREATER_THAN;} } else if (jj_2_605(2)) { jj_consume_token(LT); {if (true) return SqlStdOperatorTable.LESS_THAN;} } else if (jj_2_606(2)) { jj_consume_token(LE); {if (true) return SqlStdOperatorTable.LESS_THAN_OR_EQUAL;} } else if (jj_2_607(2)) { jj_consume_token(GE); {if (true) return SqlStdOperatorTable.GREATER_THAN_OR_EQUAL;} } else if (jj_2_608(2)) { jj_consume_token(NE); {if (true) return SqlStdOperatorTable.NOT_EQUALS;} } else if (jj_2_609(2)) { jj_consume_token(NE2); if (!this.conformance.isBangEqualAllowed()) { {if (true) throw new ParseException(RESOURCE.bangEqualNotAllowed().str());} } else if (jj_2_610(2)) { jj_consume_token(PLUS); {if (true) return SqlStdOperatorTable.PLUS;} } else if (jj_2_611(2)) { jj_consume_token(MINUS); {if (true) return SqlStdOperatorTable.MINUS;}
SqlParserPos pos; SqlParserPos prefixRowOpPos; if (jj_2_226(2)) { e = AtomicRowExpression(); checkNonQueryExpression(exprContext); {if (true) return e;} } else if (jj_2_227(2)) { e = CursorExpression(exprContext); {if (true) return e;} } else if (jj_2_228(3)) { jj_consume_token(ROW); list = ParenthesizedSimpleIdentifierList(); pos = getPos(); if (exprContext != ExprContext.ACCEPT_ALL && exprContext != ExprContext.ACCEPT_CURSOR) } else if (jj_2_229(2)) { pos = getPos(); if (jj_2_222(2)) { jj_consume_token(ROW); pos = getPos(); rowSeen = true; } else { list1 = ParenthesizedQueryOrCommaList(exprContext); if (rowSeen) { if (jj_2_225(2)) { if (jj_2_223(2)) { jj_consume_token(OVERLAPS);
SqlNode e = null; List list = new ArrayList(); jj_consume_token(LPAREN); if (jj_2_20(2)) { if (jj_2_18(2)) { jj_consume_token(DISTINCT); e = SqlSelectKeyword.DISTINCT.symbol(getPos()); } else if (jj_2_19(2)) { jj_consume_token(ALL); e = SqlSelectKeyword.ALL.symbol(getPos()); } else { jj_consume_token(-1); throw new ParseException(); Arg0(list, exprContext); label_2: while (true) { if (jj_2_21(2)) { jj_consume_token(COMMA); checkNonQueryExpression(exprContext); Arg(list, exprContext); jj_consume_token(RPAREN); {if (true) return list;} throw new Error("Missing return statement in function");
SqlParserPos withPos; List<Object> list; if (jj_2_191(2)) { withList = WithList(); } else { e = LeafQueryOrExpr(exprContext); list = startList(e); label_15: while (true) { if (jj_2_192(2)) { checkNonQueryExpression(ExprContext.ACCEPT_QUERY); op = BinaryQueryOperator(); pos = getPos(); checkQueryExpression(exprContext); e = LeafQueryOrExpr(ExprContext.ACCEPT_QUERY); list.add(new SqlParserUtil.ToTreeListItem(op, pos)); list.add(e);
public SqlAbstractParserImpl getParser(Reader stream) { return new StreamlineParserImpl(stream); } };
TimeUnit interval; SqlNode node; if (jj_2_486(2)) { jj_consume_token(CAST); pos = getPos(); jj_consume_token(LPAREN); e = Expression(ExprContext.ACCEPT_SUB_QUERY); args = startList(e); jj_consume_token(AS); if (jj_2_464(2)) { dt = DataType(); args.add(dt); } else if (jj_2_465(2)) { jj_consume_token(INTERVAL); e = IntervalQualifier(); args.add(e); } else { jj_consume_token(-1); throw new ParseException(); jj_consume_token(RPAREN); {if (true) return SqlStdOperatorTable.CAST.createCall( pos.plus(getPos()), SqlParserUtil.toNodeArray(args));} } else if (jj_2_487(2)) { jj_consume_token(EXTRACT); pos = getPos(); TimeUnit unit; jj_consume_token(LPAREN); unit = TimeUnit();
SqlNode e; SqlOperator op; SqlParserPos pos = getPos(); Expression2b(exprContext, list); if (jj_2_221(2)) { label_18: while (true) { if (jj_2_214(2)) { checkNonQueryExpression(exprContext); if (jj_2_198(2)) { jj_consume_token(NOT); jj_consume_token(IN); op = SqlStdOperatorTable.NOT_IN; pos = getPos(); } else if (jj_2_199(2)) { jj_consume_token(IN); op = SqlStdOperatorTable.IN; pos = getPos(); } else { jj_consume_token(-1); throw new ParseException(); nodeList = ParenthesizedQueryOrCommaList(ExprContext.ACCEPT_NONCURSOR); list.add(new SqlParserUtil.ToTreeListItem(op, pos)); pos = pos.plus(getPos()); } else if (jj_2_215(2)) { checkNonQueryExpression(exprContext); if (jj_2_206(2)) {
if (jj_2_603(2)) { jj_consume_token(EQ); {if (true) return SqlStdOperatorTable.EQUALS;} } else if (jj_2_604(2)) { jj_consume_token(GT); {if (true) return SqlStdOperatorTable.GREATER_THAN;} } else if (jj_2_605(2)) { jj_consume_token(LT); {if (true) return SqlStdOperatorTable.LESS_THAN;} } else if (jj_2_606(2)) { jj_consume_token(LE); {if (true) return SqlStdOperatorTable.LESS_THAN_OR_EQUAL;} } else if (jj_2_607(2)) { jj_consume_token(GE); {if (true) return SqlStdOperatorTable.GREATER_THAN_OR_EQUAL;} } else if (jj_2_608(2)) { jj_consume_token(NE); {if (true) return SqlStdOperatorTable.NOT_EQUALS;} } else if (jj_2_609(2)) { jj_consume_token(NE2); if (!this.conformance.isBangEqualAllowed()) { {if (true) throw new ParseException(RESOURCE.bangEqualNotAllowed().str());} } else if (jj_2_610(2)) { jj_consume_token(PLUS); {if (true) return SqlStdOperatorTable.PLUS;} } else if (jj_2_611(2)) { jj_consume_token(MINUS); {if (true) return SqlStdOperatorTable.MINUS;}
SqlParserPos pos; SqlParserPos prefixRowOpPos; if (jj_2_226(2)) { e = AtomicRowExpression(); checkNonQueryExpression(exprContext); {if (true) return e;} } else if (jj_2_227(2)) { e = CursorExpression(exprContext); {if (true) return e;} } else if (jj_2_228(3)) { jj_consume_token(ROW); list = ParenthesizedSimpleIdentifierList(); pos = getPos(); if (exprContext != ExprContext.ACCEPT_ALL && exprContext != ExprContext.ACCEPT_CURSOR) } else if (jj_2_229(2)) { pos = getPos(); if (jj_2_222(2)) { jj_consume_token(ROW); pos = getPos(); rowSeen = true; } else { list1 = ParenthesizedQueryOrCommaList(exprContext); if (rowSeen) { if (jj_2_225(2)) { if (jj_2_223(2)) { jj_consume_token(OVERLAPS);
SqlNode e = null; List list = new ArrayList(); jj_consume_token(LPAREN); if (jj_2_20(2)) { if (jj_2_18(2)) { jj_consume_token(DISTINCT); e = SqlSelectKeyword.DISTINCT.symbol(getPos()); } else if (jj_2_19(2)) { jj_consume_token(ALL); e = SqlSelectKeyword.ALL.symbol(getPos()); } else { jj_consume_token(-1); throw new ParseException(); Arg0(list, exprContext); label_2: while (true) { if (jj_2_21(2)) { jj_consume_token(COMMA); checkNonQueryExpression(exprContext); Arg(list, exprContext); jj_consume_token(RPAREN); {if (true) return list;} throw new Error("Missing return statement in function");
SqlParserPos withPos; List<Object> list; if (jj_2_191(2)) { withList = WithList(); } else { e = LeafQueryOrExpr(exprContext); list = startList(e); label_15: while (true) { if (jj_2_192(2)) { checkNonQueryExpression(ExprContext.ACCEPT_QUERY); op = BinaryQueryOperator(); pos = getPos(); checkQueryExpression(exprContext); e = LeafQueryOrExpr(ExprContext.ACCEPT_QUERY); list.add(new SqlParserUtil.ToTreeListItem(op, pos)); list.add(e);
public Metadata getMetadata() { synchronized (StreamlineParserImpl.class) { if (metadata == null) { metadata = new MetadataImpl( new StreamlineParserImpl(new java.io.StringReader(""))); } return metadata; } }
SqlNode e; SqlParserPos pos; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case DATE: case FALSE: case PLUS: case MINUS: e = Literal(); {if (true) return e;} break; default: jj_la1[0] = jj_gen; if (jj_2_230(2)) { e = DynamicParam(); {if (true) return e;} } else if (jj_2_231(2)) { e = BuiltinFunctionCall(); {if (true) return e;} } else if (jj_2_232(2)) { e = JdbcFunctionCall(); {if (true) return e;} } else if (jj_2_233(2)) { e = MultisetConstructor(); {if (true) return e;} } else if (jj_2_234(2)) { e = ArrayConstructor(); {if (true) return e;} } else if (jj_2_235(2)) {
final List<SqlNode> list = Lists.newArrayList(); final SqlParserPos pos; name = CompoundIdentifier(); pos = getPos(); jj_consume_token(LPAREN); if (jj_2_79(2)) { Arg0(list, exprContext); label_4: while (true) { if (jj_2_78(2)) { jj_consume_token(COMMA); checkNonQueryExpression(exprContext); Arg(list, exprContext); jj_consume_token(RPAREN); SqlNode function = createCall( name, pos.plus(getPos()), routineType, null, SqlParserUtil.toNodeArray(list)); {if (true) return function;} throw new Error("Missing return statement in function");
public SqlAbstractParserImpl getParser(Reader stream) { return new StreamlineParserImpl(stream); } };