Search in sources :

Example 1 with CloseBracketToken

use of org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.CloseBracketToken in project scout.rt by eclipse.

the class SqlFormatter method formatBracketExpr.

private void formatBracketExpr(BracketExpr stm, FormatContext ctx) {
    boolean multiline = isMultiline(stm);
    for (IToken t : stm.getChildren()) {
        if (t instanceof OpenBracketToken) {
            formatDefault(t, ctx);
            if (multiline) {
                ctx.println();
                ctx.in();
            }
        } else if (t instanceof CloseBracketToken) {
            if (multiline) {
                ctx.out();
            }
            formatDefault(t, ctx);
        } else if (t instanceof Statement) {
            formatStatement((Statement) t, ctx);
        } else if (t instanceof SingleStatement) {
            formatSingleStatement((SingleStatement) t, ctx);
        } else if (t instanceof ListExpr) {
            formatListExpr((ListExpr) t, multiline, ctx);
        } else {
            formatDefault(t, ctx);
        }
    }
}
Also used : CloseBracketToken(org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.CloseBracketToken) IToken(org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.IToken) Statement(org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.Statement) SingleStatement(org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.SingleStatement) SingleStatement(org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.SingleStatement) ListExpr(org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.ListExpr) OpenBracketToken(org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.OpenBracketToken)

Aggregations

CloseBracketToken (org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.CloseBracketToken)1 IToken (org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.IToken)1 ListExpr (org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.ListExpr)1 OpenBracketToken (org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.OpenBracketToken)1 SingleStatement (org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.SingleStatement)1 Statement (org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.Statement)1