Search in sources :

Example 6 with Operation2

use of lucee.runtime.sql.exp.op.Operation2 in project Lucee by lucee.

the class SelectParser method expoOp.

private Expression expoOp(ParserString raw) throws SQLParserException {
    Expression exp = negateMinusOp(raw);
    // Modulus Operation
    while (raw.forwardIfCurrent('^')) {
        raw.removeSpace();
        exp = new Operation2(exp, negateMinusOp(raw), Operation.OPERATION2_EXP);
    }
    return exp;
}
Also used : ColumnExpression(lucee.runtime.sql.exp.ColumnExpression) Expression(lucee.runtime.sql.exp.Expression) Operation2(lucee.runtime.sql.exp.op.Operation2)

Example 7 with Operation2

use of lucee.runtime.sql.exp.op.Operation2 in project Lucee by lucee.

the class SelectParser method xorOp.

private Expression xorOp(ParserString raw) throws SQLParserException {
    Expression expr = orOp(raw);
    while (raw.forwardIfCurrentAndNoWordNumberAfter("xor")) {
        raw.removeSpace();
        expr = new Operation2(expr, orOp(raw), Operation.OPERATION2_XOR);
    }
    return expr;
}
Also used : ColumnExpression(lucee.runtime.sql.exp.ColumnExpression) Expression(lucee.runtime.sql.exp.Expression) Operation2(lucee.runtime.sql.exp.op.Operation2)

Example 8 with Operation2

use of lucee.runtime.sql.exp.op.Operation2 in project Lucee by lucee.

the class SelectParser method plusMinusOp.

private Expression plusMinusOp(ParserString raw) throws SQLParserException {
    Expression expr = modOp(raw);
    while (!raw.isLast()) {
        // Plus Operation
        if (raw.forwardIfCurrent('+')) {
            raw.removeSpace();
            expr = new Operation2(expr, modOp(raw), Operation.OPERATION2_PLUS);
        } else // Minus Operation
        if (raw.forwardIfCurrent('-')) {
            raw.removeSpace();
            expr = new Operation2(expr, modOp(raw), Operation.OPERATION2_MINUS);
        } else
            break;
    }
    return expr;
}
Also used : ColumnExpression(lucee.runtime.sql.exp.ColumnExpression) Expression(lucee.runtime.sql.exp.Expression) Operation2(lucee.runtime.sql.exp.op.Operation2)

Example 9 with Operation2

use of lucee.runtime.sql.exp.op.Operation2 in project Lucee by lucee.

the class SelectParser method divMultiOp.

private Expression divMultiOp(ParserString raw) throws SQLParserException {
    Expression expr = expoOp(raw);
    while (!raw.isLast()) {
        // Multiply Operation
        if (raw.forwardIfCurrent('*')) {
            raw.removeSpace();
            expr = new Operation2(expr, expoOp(raw), Operation.OPERATION2_MULTIPLY);
        } else // Divide Operation
        if (raw.forwardIfCurrent('/')) {
            raw.removeSpace();
            expr = new Operation2(expr, expoOp(raw), Operation.OPERATION2_DIVIDE);
        } else {
            break;
        }
    }
    return expr;
}
Also used : ColumnExpression(lucee.runtime.sql.exp.ColumnExpression) Expression(lucee.runtime.sql.exp.Expression) Operation2(lucee.runtime.sql.exp.op.Operation2)

Aggregations

ColumnExpression (lucee.runtime.sql.exp.ColumnExpression)9 Expression (lucee.runtime.sql.exp.Expression)9 Operation2 (lucee.runtime.sql.exp.op.Operation2)9 Operation1 (lucee.runtime.sql.exp.op.Operation1)2 Operation3 (lucee.runtime.sql.exp.op.Operation3)2 OperationN (lucee.runtime.sql.exp.op.OperationN)2 DatabaseException (lucee.runtime.exp.DatabaseException)1 BracketExpression (lucee.runtime.sql.exp.BracketExpression)1