use of org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.MathExpr in project scout.rt by eclipse.
the class SqlParser method parseMathExpr.
private MathExpr parseMathExpr(List<IToken> list, ParseContext ctx) {
// _simpleExpr (BinaryOp _simpleExpr)*
ParseStep lock = ctx.checkAndAdd("MathExpr", list);
if (lock == null) {
return null;
}
try {
IToken se = parseSimpleExpr(list, ctx);
if (se == null) {
return null;
}
MathExpr me = new MathExpr();
me.addChild(se);
MathOp mo;
while ((mo = removeToken(list, MathOp.class)) != null && (se = parseSimpleExpr(list, ctx)) != null) {
me.addChild(mo);
me.addChild(se);
}
// restore incomplete
if (mo != null) {
list.add(0, mo);
}
return me;
} finally {
ctx.remove(lock);
}
}