@Override public boolean visitUnaryExpression(UnaryExpression node) { UnaryOperator op; parensOpen(node); try { op = node.astOperator(); if (op == null) throw new Exception(); } catch (Exception e) { formatter.buildInline(node); visit(node.astOperand()); formatter.closeInline(); parensClose(node); return true; } formatter.buildInline(node); formatter.property("operator", op.getSymbol()); formatter.property("postfix", op.isPostfix()); if (!op.isPostfix()) formatter.operator(op.getSymbol()); visit(node.astOperand()); if (op.isPostfix()) formatter.operator(op.getSymbol()); formatter.closeInline(); parensClose(node); return true; }
@Override public boolean visitUnaryExpression(UnaryExpression node) { UnaryOperator op; parensOpen(node); try { op = node.astOperator(); if (op == null) throw new Exception(); } catch (Exception e) { formatter.buildInline(node); visit(node.astOperand()); formatter.closeInline(); parensClose(node); return true; } formatter.buildInline(node); formatter.property("operator", op.getSymbol()); formatter.property("postfix", op.isPostfix()); if (!op.isPostfix()) formatter.operator(op.getSymbol()); visit(node.astOperand()); if (op.isPostfix()) formatter.operator(op.getSymbol()); formatter.closeInline(); parensClose(node); return true; }
@Override public boolean visitUnaryExpression(UnaryExpression node) { UnaryOperator op; parensOpen(node); try { op = node.astOperator(); if (op == null) throw new Exception(); } catch (Exception e) { formatter.buildInline(node); visit(node.astOperand()); formatter.closeInline(); parensClose(node); return true; } formatter.buildInline(node); formatter.property("operator", op.getSymbol()); formatter.property("postfix", op.isPostfix()); if (!op.isPostfix()) formatter.operator(op.getSymbol()); visit(node.astOperand()); if (op.isPostfix()) formatter.operator(op.getSymbol()); formatter.closeInline(); parensClose(node); return true; }
else otherIsPostfix = ((UnaryExpression)parent).astOperator().isPostfix(); } catch (Throwable ignore) {} try { if (self instanceof ConstructorInvocation) selfIsPostfix = true; else selfIsPostfix = ((UnaryExpression)self).astOperator().isPostfix(); } catch (Throwable ignore) {} return (!selfIsPostfix && otherIsPostfix);
else otherIsPostfix = ((UnaryExpression)parent).astOperator().isPostfix(); } catch (Throwable ignore) {} try { if (self instanceof ConstructorInvocation) selfIsPostfix = true; else selfIsPostfix = ((UnaryExpression)self).astOperator().isPostfix(); } catch (Throwable ignore) {} return (!selfIsPostfix && otherIsPostfix);
else otherIsPostfix = ((UnaryExpression)parent).astOperator().isPostfix(); } catch (Throwable ignore) {} try { if (self instanceof ConstructorInvocation) selfIsPostfix = true; else selfIsPostfix = ((UnaryExpression)self).astOperator().isPostfix(); } catch (Throwable ignore) {} return (!selfIsPostfix && otherIsPostfix);