use of org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.UnaryPrefix in project scout.rt by eclipse.
the class SqlParser method parseUnaryPrefixExpr.
private UnaryPrefixExpr parseUnaryPrefixExpr(List<IToken> list, ParseContext ctx) {
// UnaryPrefix Atom
ParseStep lock = ctx.checkAndAdd("UnaryPrefixExpr", list);
if (lock == null) {
return null;
}
try {
UnaryPrefix up = null;
IToken a = null;
if ((up = removeToken(list, UnaryPrefix.class)) != null && (a = parseAtom(list, ctx)) != null) {
// ok
} else {
// restore incomplete
if (up != null) {
list.add(0, up);
}
return null;
}
UnaryPrefixExpr e = new UnaryPrefixExpr();
e.addChild(up);
e.addChild(a);
return e;
} finally {
ctx.remove(lock);
}
}
use of org.eclipse.scout.rt.server.jdbc.parsers.sql.SqlParserToken.UnaryPrefix in project scout.rt by eclipse.
the class SqlFormatter method formatUnaryPrefixExpr.
private void formatUnaryPrefixExpr(UnaryPrefixExpr stm, FormatContext ctx) {
for (IToken t : stm.getChildren()) {
if (t instanceof UnaryPrefix) {
formatDefault(t, ctx);
ctx.print(" ");
} else if (t instanceof Atom) {
formatAtom((Atom) t, ctx);
} else {
formatDefault(t, ctx);
}
}
}
Aggregations