use of org.apache.qpid.server.filter.Expression in project qpid-broker-j by apache.
the class SelectorParser method multExpr.
public final Expression multExpr() throws ParseException {
Expression left;
Expression right;
left = unaryExpr();
label_8: while (true) {
switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case 38:
case 39:
case 40:
;
break;
default:
break label_8;
}
switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case 38:
jj_consume_token(38);
right = unaryExpr();
left = ArithmeticExpression.createMultiply(left, right);
break;
case 39:
jj_consume_token(39);
right = unaryExpr();
left = ArithmeticExpression.createDivide(left, right);
break;
case 40:
jj_consume_token(40);
right = unaryExpr();
left = ArithmeticExpression.createMod(left, right);
break;
default:
jj_consume_token(-1);
throw new ParseException();
}
}
{
if (true)
return left;
}
throw new Error("Missing return statement in function");
}
use of org.apache.qpid.server.filter.Expression 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");
}
use of org.apache.qpid.server.filter.Expression in project qpid-broker-j by apache.
the class SelectorParser method JmsSelector.
// ----------------------------------------------------------------------------
// Grammer
// ----------------------------------------------------------------------------
public final BooleanExpression JmsSelector() throws ParseException {
Expression left = null;
left = orExpression();
jj_consume_token(0);
{
if (true)
return asBooleanExpression(left);
}
throw new Error("Missing return statement in function");
}
Aggregations