Search in sources :

Example 1 with ComparisonExpression

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

the class ConfiguredObjectFilterParser 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 31:
            case 32:
                ;
                break;
            default:
                break label_3;
        }
        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case 31:
                jj_consume_token(31);
                right = comparisonExpression();
                left = ComparisonExpression.createEqual(left, right);
                break;
            case 32:
                jj_consume_token(32);
                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) 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 2 with ComparisonExpression

use of org.apache.qpid.server.filter.ComparisonExpression 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 3 with ComparisonExpression

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

the class ConfiguredObjectFilterParser method comparisonExpression.

public final Expression comparisonExpression() throws ParseException {
    Expression left;
    Expression right;
    Expression low;
    Expression high;
    String t, u;
    boolean not;
    ArrayList list;
    left = addExpression();
    label_4: while (true) {
        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case NOT:
            case BETWEEN:
            case LIKE:
            case IN:
            case 33:
            case 34:
            case 35:
            case 36:
                ;
                break;
            default:
                break label_4;
        }
        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case 33:
                jj_consume_token(33);
                right = addExpression();
                left = ComparisonExpression.createGreaterThan(left, right);
                break;
            case 34:
                jj_consume_token(34);
                right = addExpression();
                left = ComparisonExpression.createGreaterThanEqual(left, right);
                break;
            case 35:
                jj_consume_token(35);
                right = addExpression();
                left = ComparisonExpression.createLessThan(left, right);
                break;
            case 36:
                jj_consume_token(36);
                right = addExpression();
                left = ComparisonExpression.createLessThanEqual(left, right);
                break;
            case LIKE:
                u = null;
                jj_consume_token(LIKE);
                t = stringLiteral();
                switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                    case ESCAPE:
                        jj_consume_token(ESCAPE);
                        u = stringLiteral();
                        break;
                    default:
                        ;
                }
                left = ComparisonExpression.createLike(left, t, u);
                break;
            default:
                if (jj_2_2(2)) {
                    u = null;
                    jj_consume_token(NOT);
                    jj_consume_token(LIKE);
                    t = stringLiteral();
                    switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                        case ESCAPE:
                            jj_consume_token(ESCAPE);
                            u = stringLiteral();
                            break;
                        default:
                            ;
                    }
                    left = ComparisonExpression.createNotLike(left, t, u);
                } else {
                    switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                        case BETWEEN:
                            jj_consume_token(BETWEEN);
                            low = addExpression();
                            jj_consume_token(AND);
                            high = addExpression();
                            left = ComparisonExpression.createBetween(left, low, high);
                            break;
                        default:
                            if (jj_2_3(2)) {
                                jj_consume_token(NOT);
                                jj_consume_token(BETWEEN);
                                low = addExpression();
                                jj_consume_token(AND);
                                high = addExpression();
                                left = ComparisonExpression.createNotBetween(left, low, high);
                            } else {
                                switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                                    case IN:
                                        jj_consume_token(IN);
                                        jj_consume_token(37);
                                        right = primaryExpr();
                                        list = new ArrayList();
                                        list.add(right);
                                        label_5: while (true) {
                                            switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                                                case 38:
                                                    ;
                                                    break;
                                                default:
                                                    break label_5;
                                            }
                                            jj_consume_token(38);
                                            right = primaryExpr();
                                            list.add(right);
                                        }
                                        jj_consume_token(39);
                                        left = ComparisonExpression.createInFilter(left, list, true);
                                        break;
                                    default:
                                        if (jj_2_4(2)) {
                                            jj_consume_token(NOT);
                                            jj_consume_token(IN);
                                            jj_consume_token(37);
                                            right = primaryExpr();
                                            list = new ArrayList();
                                            list.add(right);
                                            label_6: while (true) {
                                                switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                                                    case 38:
                                                        ;
                                                        break;
                                                    default:
                                                        break label_6;
                                                }
                                                jj_consume_token(38);
                                                right = primaryExpr();
                                                list.add(right);
                                            }
                                            jj_consume_token(39);
                                            left = ComparisonExpression.createNotInFilter(left, list, true);
                                        } else {
                                            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) ArrayList(java.util.ArrayList)

Example 4 with ComparisonExpression

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

the class SelectorParser method comparisonExpression.

public final Expression comparisonExpression() throws ParseException {
    Expression left;
    Expression right;
    Expression low;
    Expression high;
    String t, u;
    boolean not;
    ArrayList list;
    left = addExpression();
    label_4: while (true) {
        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case NOT:
            case BETWEEN:
            case LIKE:
            case IN:
            case 29:
            case 30:
            case 31:
            case 32:
                ;
                break;
            default:
                break label_4;
        }
        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case 29:
                jj_consume_token(29);
                right = addExpression();
                left = ComparisonExpression.createGreaterThan(left, right);
                break;
            case 30:
                jj_consume_token(30);
                right = addExpression();
                left = ComparisonExpression.createGreaterThanEqual(left, right);
                break;
            case 31:
                jj_consume_token(31);
                right = addExpression();
                left = ComparisonExpression.createLessThan(left, right);
                break;
            case 32:
                jj_consume_token(32);
                right = addExpression();
                left = ComparisonExpression.createLessThanEqual(left, right);
                break;
            case LIKE:
                u = null;
                jj_consume_token(LIKE);
                t = stringLiteral();
                switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                    case ESCAPE:
                        jj_consume_token(ESCAPE);
                        u = stringLiteral();
                        break;
                    default:
                        ;
                }
                left = ComparisonExpression.createLike(left, t, u);
                break;
            default:
                if (jj_2_2(2)) {
                    u = null;
                    jj_consume_token(NOT);
                    jj_consume_token(LIKE);
                    t = stringLiteral();
                    switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                        case ESCAPE:
                            jj_consume_token(ESCAPE);
                            u = stringLiteral();
                            break;
                        default:
                            ;
                    }
                    left = ComparisonExpression.createNotLike(left, t, u);
                } else {
                    switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                        case BETWEEN:
                            jj_consume_token(BETWEEN);
                            low = addExpression();
                            jj_consume_token(AND);
                            high = addExpression();
                            left = ComparisonExpression.createBetween(left, low, high);
                            break;
                        default:
                            if (jj_2_3(2)) {
                                jj_consume_token(NOT);
                                jj_consume_token(BETWEEN);
                                low = addExpression();
                                jj_consume_token(AND);
                                high = addExpression();
                                left = ComparisonExpression.createNotBetween(left, low, high);
                            } else {
                                switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                                    case IN:
                                        jj_consume_token(IN);
                                        jj_consume_token(33);
                                        t = stringLiteral();
                                        list = new ArrayList();
                                        list.add(t);
                                        label_5: while (true) {
                                            switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                                                case 34:
                                                    ;
                                                    break;
                                                default:
                                                    break label_5;
                                            }
                                            jj_consume_token(34);
                                            t = stringLiteral();
                                            list.add(t);
                                        }
                                        jj_consume_token(35);
                                        left = ComparisonExpression.createInFilter(left, list, false);
                                        break;
                                    default:
                                        if (jj_2_4(2)) {
                                            jj_consume_token(NOT);
                                            jj_consume_token(IN);
                                            jj_consume_token(33);
                                            t = stringLiteral();
                                            list = new ArrayList();
                                            list.add(t);
                                            label_6: while (true) {
                                                switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                                                    case 34:
                                                        ;
                                                        break;
                                                    default:
                                                        break label_6;
                                                }
                                                jj_consume_token(34);
                                                t = stringLiteral();
                                                list.add(t);
                                            }
                                            jj_consume_token(35);
                                            left = ComparisonExpression.createNotInFilter(left, list, false);
                                        } else {
                                            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) ArrayList(java.util.ArrayList)

Aggregations

ArithmeticExpression (org.apache.qpid.server.filter.ArithmeticExpression)4 BooleanExpression (org.apache.qpid.server.filter.BooleanExpression)4 ComparisonExpression (org.apache.qpid.server.filter.ComparisonExpression)4 ConstantExpression (org.apache.qpid.server.filter.ConstantExpression)4 Expression (org.apache.qpid.server.filter.Expression)4 LogicExpression (org.apache.qpid.server.filter.LogicExpression)4 UnaryExpression (org.apache.qpid.server.filter.UnaryExpression)4 ArrayList (java.util.ArrayList)2 NamedExpression (org.apache.qpid.server.filter.NamedExpression)2 OrderByExpression (org.apache.qpid.server.filter.OrderByExpression)2 PropertyExpression (org.apache.qpid.server.filter.PropertyExpression)2