Search in sources :

Example 6 with Expression

use of org.apache.qpid.server.filter.Expression in project qpid-broker-j by apache.

the class SelectorParser method unaryExpr.

public final Expression unaryExpr() throws ParseException {
    String s = null;
    Expression left = null;
    if (jj_2_6(2147483647)) {
        jj_consume_token(36);
        left = unaryExpr();
    } else {
        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case 37:
                jj_consume_token(37);
                left = unaryExpr();
                left = UnaryExpression.createNegate(left);
                break;
            case NOT:
                jj_consume_token(NOT);
                left = unaryExpr();
                left = UnaryExpression.createNOT(asBooleanExpression(left));
                break;
            case TRUE:
            case FALSE:
            case NULL:
            case DECIMAL_LITERAL:
            case HEX_LITERAL:
            case OCTAL_LITERAL:
            case FLOATING_POINT_LITERAL:
            case STRING_LITERAL:
            case ID:
            case QUOTED_ID:
            case 33:
                left = primaryExpr();
                break;
            default:
                jj_consume_token(-1);
                throw new ParseException();
        }
    }
    {
        if (true)
            return left;
    }
    throw new Error("Missing return statement in function");
}
Also used : ArithmeticExpression(org.apache.qpid.server.filter.ArithmeticExpression) ConstantExpression(org.apache.qpid.server.filter.ConstantExpression) PropertyExpression(org.apache.qpid.server.filter.PropertyExpression) ComparisonExpression(org.apache.qpid.server.filter.ComparisonExpression) Expression(org.apache.qpid.server.filter.Expression) LogicExpression(org.apache.qpid.server.filter.LogicExpression) BooleanExpression(org.apache.qpid.server.filter.BooleanExpression) UnaryExpression(org.apache.qpid.server.filter.UnaryExpression)

Example 7 with Expression

use of org.apache.qpid.server.filter.Expression in project qpid-broker-j by apache.

the class SelectorParser method equalityExpression.

public final Expression equalityExpression() throws ParseException {
    Expression left;
    Expression right;
    left = comparisonExpression();
    label_3: while (true) {
        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case IS:
            case 27:
            case 28:
                ;
                break;
            default:
                break label_3;
        }
        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case 27:
                jj_consume_token(27);
                right = comparisonExpression();
                left = ComparisonExpression.createEqual(left, right);
                break;
            case 28:
                jj_consume_token(28);
                right = comparisonExpression();
                left = ComparisonExpression.createNotEqual(left, right);
                break;
            default:
                if (jj_2_1(2)) {
                    jj_consume_token(IS);
                    jj_consume_token(NULL);
                    left = ComparisonExpression.createIsNull(left);
                } else {
                    switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                        case IS:
                            jj_consume_token(IS);
                            jj_consume_token(NOT);
                            jj_consume_token(NULL);
                            left = ComparisonExpression.createIsNotNull(left);
                            break;
                        default:
                            jj_consume_token(-1);
                            throw new ParseException();
                    }
                }
        }
    }
    {
        if (true)
            return left;
    }
    throw new Error("Missing return statement in function");
}
Also used : ArithmeticExpression(org.apache.qpid.server.filter.ArithmeticExpression) ConstantExpression(org.apache.qpid.server.filter.ConstantExpression) PropertyExpression(org.apache.qpid.server.filter.PropertyExpression) ComparisonExpression(org.apache.qpid.server.filter.ComparisonExpression) Expression(org.apache.qpid.server.filter.Expression) LogicExpression(org.apache.qpid.server.filter.LogicExpression) BooleanExpression(org.apache.qpid.server.filter.BooleanExpression) UnaryExpression(org.apache.qpid.server.filter.UnaryExpression)

Example 8 with Expression

use of org.apache.qpid.server.filter.Expression in project qpid-broker-j by apache.

the class SelectorParser method primaryExpr.

public final Expression primaryExpr() throws ParseException {
    Expression left = null;
    switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
        case TRUE:
        case FALSE:
        case NULL:
        case DECIMAL_LITERAL:
        case HEX_LITERAL:
        case OCTAL_LITERAL:
        case FLOATING_POINT_LITERAL:
        case STRING_LITERAL:
            left = literal();
            break;
        case ID:
        case QUOTED_ID:
            left = variable();
            break;
        case 33:
            jj_consume_token(33);
            left = orExpression();
            jj_consume_token(35);
            break;
        default:
            jj_consume_token(-1);
            throw new ParseException();
    }
    {
        if (true)
            return left;
    }
    throw new Error("Missing return statement in function");
}
Also used : ArithmeticExpression(org.apache.qpid.server.filter.ArithmeticExpression) ConstantExpression(org.apache.qpid.server.filter.ConstantExpression) PropertyExpression(org.apache.qpid.server.filter.PropertyExpression) ComparisonExpression(org.apache.qpid.server.filter.ComparisonExpression) Expression(org.apache.qpid.server.filter.Expression) LogicExpression(org.apache.qpid.server.filter.LogicExpression) BooleanExpression(org.apache.qpid.server.filter.BooleanExpression) UnaryExpression(org.apache.qpid.server.filter.UnaryExpression)

Example 9 with Expression

use of org.apache.qpid.server.filter.Expression in project qpid-broker-j by apache.

the class ConfiguredObjectFilterParser method andExpression.

public final Expression andExpression() throws ParseException {
    Expression left;
    Expression right;
    left = equalityExpression();
    label_2: while (true) {
        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case AND:
                ;
                break;
            default:
                break label_2;
        }
        jj_consume_token(AND);
        right = equalityExpression();
        left = LogicExpression.createAND(asBooleanExpression(left), asBooleanExpression(right));
    }
    {
        if (true)
            return left;
    }
    throw new Error("Missing return statement in function");
}
Also used : ArithmeticExpression(org.apache.qpid.server.filter.ArithmeticExpression) NamedExpression(org.apache.qpid.server.filter.NamedExpression) ComparisonExpression(org.apache.qpid.server.filter.ComparisonExpression) LogicExpression(org.apache.qpid.server.filter.LogicExpression) OrderByExpression(org.apache.qpid.server.filter.OrderByExpression) UnaryExpression(org.apache.qpid.server.filter.UnaryExpression) ConstantExpression(org.apache.qpid.server.filter.ConstantExpression) Expression(org.apache.qpid.server.filter.Expression) BooleanExpression(org.apache.qpid.server.filter.BooleanExpression)

Example 10 with Expression

use of org.apache.qpid.server.filter.Expression in project qpid-broker-j by apache.

the class ConfiguredObjectFilterParser method addExpression.

public final Expression addExpression() throws ParseException {
    Expression left;
    Expression right;
    left = multExpr();
    label_7: while (true) {
        if (jj_2_5(2147483647)) {
            ;
        } else {
            break label_7;
        }
        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case 40:
                jj_consume_token(40);
                right = multExpr();
                left = ArithmeticExpression.createPlus(left, right);
                break;
            case 41:
                jj_consume_token(41);
                right = multExpr();
                left = ArithmeticExpression.createMinus(left, right);
                break;
            default:
                jj_consume_token(-1);
                throw new ParseException();
        }
    }
    {
        if (true)
            return left;
    }
    throw new Error("Missing return statement in function");
}
Also used : ArithmeticExpression(org.apache.qpid.server.filter.ArithmeticExpression) NamedExpression(org.apache.qpid.server.filter.NamedExpression) ComparisonExpression(org.apache.qpid.server.filter.ComparisonExpression) LogicExpression(org.apache.qpid.server.filter.LogicExpression) OrderByExpression(org.apache.qpid.server.filter.OrderByExpression) UnaryExpression(org.apache.qpid.server.filter.UnaryExpression) ConstantExpression(org.apache.qpid.server.filter.ConstantExpression) Expression(org.apache.qpid.server.filter.Expression) BooleanExpression(org.apache.qpid.server.filter.BooleanExpression)

Aggregations

BooleanExpression (org.apache.qpid.server.filter.BooleanExpression)23 Expression (org.apache.qpid.server.filter.Expression)23 ArithmeticExpression (org.apache.qpid.server.filter.ArithmeticExpression)21 ComparisonExpression (org.apache.qpid.server.filter.ComparisonExpression)21 ConstantExpression (org.apache.qpid.server.filter.ConstantExpression)21 LogicExpression (org.apache.qpid.server.filter.LogicExpression)21 UnaryExpression (org.apache.qpid.server.filter.UnaryExpression)21 OrderByExpression (org.apache.qpid.server.filter.OrderByExpression)14 NamedExpression (org.apache.qpid.server.filter.NamedExpression)12 PropertyExpression (org.apache.qpid.server.filter.PropertyExpression)9 ArrayList (java.util.ArrayList)4 SelectorParsingException (org.apache.qpid.server.filter.SelectorParsingException)2 Map (java.util.Map)1