protected int diffDoLoop(JCDoWhileLoop oldT, JCDoWhileLoop newT, int[] bounds) { int localPointer = bounds[0]; int[] bodyBounds = new int[] { localPointer, endPos(oldT.body) }; int oldIndent = newT.body.hasTag(Tag.BLOCK) ? -1 : printer.indent(); localPointer = diffTree(oldT.body, newT.body, bodyBounds, oldT.getKind()); if (!newT.body.hasTag(Tag.BLOCK)) printer.undent(oldIndent); int[] condBounds = getBounds(oldT.cond); if (oldT.body.getKind() != Kind.BLOCK && newT.body.getKind() == Kind.BLOCK) { moveBackToToken(tokenSequence, condBounds[0], JavaTokenId.WHILE); localPointer = tokenSequence.offset(); } else { copyTo(localPointer, condBounds[0]); localPointer = diffTree(oldT.cond, newT.cond, condBounds); } copyTo(localPointer, bounds[1]); return bounds[1]; }
@Override public void visitDoLoop(JCDoWhileLoop tree) { aPrint("do "); if (tree.body instanceof JCBlock) { println("{"); indent++; print(((JCBlock) tree.body).stats, ""); indent--; aPrint("}"); } else print(tree.body); print(" while "); if (tree.cond instanceof JCParens) { print(tree.cond); } else { print("("); print(tree.cond); print(")"); } println(";", tree); }
public void visitDoLoop(JCDoWhileLoop tree) { try { print("do "); printStat(tree.body); align(); print(" while "); if (PARENS.equals(treeTag(tree.cond))) { printExpr(tree.cond); } else { print("("); printExpr(tree.cond); print(")"); } print(";"); } catch (IOException e) { throw new UncheckedIOException(e); } }
public void visitDoLoop(JCDoWhileLoop tree) { try { print("do "); printStat(tree.body); align(); print(" while "); if (tree.cond.getTag() == JCTree.PARENS) { printExpr(tree.cond); } else { print("("); printExpr(tree.cond); print(")"); } print(";"); } catch (IOException e) { throw new UncheckedIOException(e); } }
public void visitDoLoop(JCDoWhileLoop tree) { try { print("do "); printStat(tree.body); align(); print(" while "); if (getTag(tree.cond) == PARENS) { printExpr(tree.cond); } else { print("("); printExpr(tree.cond); print(")"); } print(";"); } catch (IOException e) { throw new UncheckedIOException(e); } }
public void visitDoLoop(JCDoWhileLoop that) { try { print("JCDoWhileLoop:"); } catch (Exception e) { } super.visitDoLoop(that); }
@Override public Choice<State<JCDoWhileLoop>> visitDoWhileLoop(final DoWhileLoopTree node, State<?> state) { return chooseSubtrees( state, s -> unifyStatement(node.getStatement(), s), s -> unifyExpression(node.getCondition(), s), maker()::DoLoop); }
private boolean matchDoLoop(JCDoWhileLoop t1, JCDoWhileLoop t2) { return treesMatch(t1.cond, t2.cond) && treesMatch(t1.body, t2.body); }
@Override public void visitDoLoop(JCDoWhileLoop tree) { //skip body (to prevents same statements to be analyzed twice) scan(tree.getCondition()); }
@Override public void visitDoLoop(JCDoWhileLoop tree) { scan(tree.getCondition()); }
public JCDoWhileLoop DoLoop(JCStatement body, JCExpression cond) { return invoke(DoLoop, body, cond); }
public AJCDoWhileLoop(JCDoWhileLoop ltree) { super(ltree.body, ltree.cond); }
public AJCDoWhileLoop(JCDoWhileLoop ltree, String lcomment) { this(ltree); setComment(lcomment); }
@Override public JCDoWhileLoop inline(Inliner inliner) throws CouldNotResolveImportException { return inliner.maker().DoLoop(getStatement().inline(inliner), getCondition().inline(inliner)); }
@Override public void visitDoLoop(JCDoWhileLoop tree) { printNode(tree); child("body", tree.body); child("cond", tree.cond); indent--; }
@Override public void visitDoLoop(JCDoWhileLoop node) { DoWhile dw = new DoWhile(); JCExpression cond = node.getCondition(); setConversionPositionInfo(dw, "()", getPosition(cond)); set(node, dw.rawCondition(toTree(removeParens(cond))).rawStatement(toTree(node.getStatement()))); }
public void visitDoLoop(JCDoWhileLoop tree) { attribStat(tree.body, env.dup(tree)); attribExpr(tree.cond, env, syms.booleanType); result = null; }