Search in sources :

Example 1 with MinusExpr

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

the class SqlParser method parseMinusExpr.

private MinusExpr parseMinusExpr(List<IToken> list, ParseContext ctx) {
    // BinaryOp['-'] Atom
    ParseStep lock = ctx.checkAndAdd("MinusExpr", list);
    if (lock == null) {
        return null;
    }
    try {
        MathOp mo = null;
        IToken a = null;
        if ((mo = removeToken(list, MathOp.class, "-")) != null && (a = parseAtom(list, ctx)) != null) {
        // ok
        } else {
            // restore incomplete
            if (mo != null) {
                list.add(0, mo);
            }
            return null;
        }
        MinusExpr e = new MinusExpr();
        e.addChild(mo);
        e.addChild(a);
        return e;
    } finally {
        ctx.remove(lock);
    }
}
Also used : IToken(org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.IToken) MathOp(org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.MathOp) MinusExpr(org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.MinusExpr)

Aggregations

IToken (org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.IToken)1 MathOp (org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.MathOp)1 MinusExpr (org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.MinusExpr)1