Esempio n. 1
0
 public void visitUnary(JCUnary tree) {
   try {
     int ownprec = TreeInfo.opPrec(tree.getTag());
     String opname = operatorName(tree.getTag());
     open(prec, ownprec);
     if (tree.getTag() <= JCTree.PREDEC) {
       print(opname);
       printExpr(tree.arg, ownprec);
     } else {
       printExpr(tree.arg, ownprec);
       print(opname);
     }
     close(prec, ownprec);
   } catch (IOException e) {
     throw new UncheckedIOException(e);
   }
 }
Esempio n. 2
0
 public JCTree visitUnary(UnaryTree node, P p) {
   JCUnary t = (JCUnary) node;
   JCExpression arg = copy(t.arg, p);
   return M.at(t.pos).Unary(t.getTag(), arg);
 }