@Test public void testReplace() throws Exception { String sql = "replace xxx into replace xxx"; ASTRootNode n = new Parser(sql).parse().init(); List<Type> types = Lists.newArrayList(); ParameterContext ctx = getParameterContext(types); n.checkAndBind(ctx); InvocationContext context = DefaultInvocationContext.create(); n.render(context); BoundSql boundSql = context.getBoundSql(); assertThat(boundSql.getSql(), Matchers.equalTo("replace xxx into replace xxx")); assertThat(n.getSQLType(), is(SQLType.REPLACE)); }
final public void Replace() throws ParseException { ASTReplace jjtn000 = new ASTReplace(JJTREPLACE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1));Token t; try { t = jj_consume_token(REPLACE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtn000.jjtSetLastToken(getToken(0)); jjtn000.setValue(t.image); } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtn000.jjtSetLastToken(getToken(0)); } } }
Parser implements ParserTreeConstants, ParserConstants { final public void Replace() throws ParseException { ASTReplace jjtn000 = new ASTReplace(JJTREPLACE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1));Token t; try { t = jj_consume_token(REPLACE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtn000.jjtSetLastToken(getToken(0)); jjtn000.setValue(t.image); } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtn000.jjtSetLastToken(getToken(0)); } } } }
Parser implements ParserTreeConstants, ParserConstants { final public void Replace() throws ParseException { ASTReplace jjtn000 = new ASTReplace(JJTREPLACE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1));Token t; try { t = jj_consume_token(REPLACE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtn000.jjtSetLastToken(getToken(0)); jjtn000.setValue(t.image); } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtn000.jjtSetLastToken(getToken(0)); } } } Parser(String s);  Parser(java.io.InputStream stream);  Parser(java.io.InputStream stream, String encoding);  Parser(Reader stream);  Parser(ParserTokenManager tm); }
Parser implements ParserTreeConstants, ParserConstants { final public void Replace() throws ParseException { ASTReplace jjtn000 = new ASTReplace(JJTREPLACE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1));Token t; try { t = jj_consume_token(REPLACE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtn000.jjtSetLastToken(getToken(0)); jjtn000.setValue(t.image); } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtn000.jjtSetLastToken(getToken(0)); } } } Parser(String s);  Parser(java.io.InputStream stream);  Parser(java.io.InputStream stream, String encoding);  Parser(Reader stream);  Parser(ParserTokenManager tm); final ASTRootNode parse(); final void DML(); final void Insert(); final void Delete(); final void Update(); final void Select(); final void Replace(); final void Merge(); final void Truncate(); final void Statement(); final void JDBCParameter(); final void JDBCIterableParameter(); final void GlobalTable(); final void JoinParameter(); final void QuoteText(); final void Text(); final void Blank(); final void IfStatement(); final void ElseStatement(); final void ElseIfStatement(); final void Expression(); final void ConditionalOrExpression(); final void ConditionalAndExpression(); final void RelationalExpression(); final void UnaryExpression(); final void PrimaryExpression(); final void ExpressionParameter(); final void IntegerLiteral(); final void StringLiteral(); final void True(); final void False(); final void Null(); void ReInit(java.io.InputStream stream); void ReInit(java.io.InputStream stream, String encoding); void ReInit(Reader stream); void ReInit(ParserTokenManager tm); final Token getNextToken(); final Token getToken(int index); ParseException generateParseException(); final void enable_tracing(); final void disable_tracing(); }
Parser implements ParserTreeConstants, ParserConstants { final public void Replace() throws ParseException { ASTReplace jjtn000 = new ASTReplace(JJTREPLACE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1));Token t; try { t = jj_consume_token(REPLACE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtn000.jjtSetLastToken(getToken(0)); jjtn000.setValue(t.image); } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtn000.jjtSetLastToken(getToken(0)); } } } Parser(String s);  Parser(java.io.InputStream stream);  Parser(java.io.InputStream stream, String encoding);  Parser(Reader stream);  Parser(ParserTokenManager tm); final ASTRootNode parse(); final void DML(); final void Insert(); final void Delete(); final void Update(); final void Select(); final void Replace(); final void Merge(); final void Truncate(); final void Statement(); final void JDBCParameter(); final void JDBCIterableParameter(); final void GlobalTable(); final void JoinParameter(); final void QuoteText(); final void Text(); final void Blank(); final void IfStatement(); final void ElseStatement(); final void ElseIfStatement(); final void Expression(); final void ConditionalOrExpression(); final void ConditionalAndExpression(); final void RelationalExpression(); final void UnaryExpression(); final void PrimaryExpression(); final void ExpressionParameter(); final void IntegerLiteral(); final void StringLiteral(); final void True(); final void False(); final void Null(); void ReInit(java.io.InputStream stream); void ReInit(java.io.InputStream stream, String encoding); void ReInit(Reader stream); void ReInit(ParserTokenManager tm); final Token getNextToken(); final Token getToken(int index); ParseException generateParseException(); final void enable_tracing(); final void disable_tracing(); public ParserTokenManager token_source; public Token token; public Token jj_nt; }