Java 类com.sun.tools.javac.tree.JCTree.JCDoWhileLoop 实例源码

项目:incubator-netbeans    文件:CasualDiff.java   
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];
}
项目:lombok-ianchiu    文件:PrettyPrinter.java   
@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);
}
项目:EasyMPermission    文件:PrettyCommentsPrinter.java   
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);
    }
}
项目:s4j    文件:Pretty.java   
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);
    }
}
项目:lombok    文件:PrettyCommentsPrinter.java   
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);
    }
}
项目:javaparser2jctree    文件:PrintAstVisitor.java   
public void visitDoLoop(JCDoWhileLoop that) {
    try {
        print("JCDoWhileLoop:");
    } catch (Exception e) {
    }
    super.visitDoLoop(that);
}
项目:error-prone    文件:PlaceholderUnificationVisitor.java   
@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);
}
项目:incubator-netbeans    文件:CasualDiff.java   
private boolean matchDoLoop(JCDoWhileLoop t1, JCDoWhileLoop t2) {
    return treesMatch(t1.cond, t2.cond) && treesMatch(t1.body, t2.body);
}
项目:openjdk-jdk10    文件:Analyzer.java   
@Override
public void visitDoLoop(JCDoWhileLoop tree) {
    //skip body (to prevents same statements to be analyzed twice)
    scan(tree.getCondition());
}
项目:openjdk9    文件:Analyzer.java   
@Override
public void visitDoLoop(JCDoWhileLoop tree) {
    scan(tree.getCondition());
}
项目:lombok-ianchiu    文件:JavacTreeMaker.java   
public JCDoWhileLoop DoLoop(JCStatement body, JCExpression cond) {
    return invoke(DoLoop, body, cond);
}
项目:javaparser2jctree    文件:AJCDoWhileLoop.java   
public AJCDoWhileLoop(JCDoWhileLoop ltree) {
    super(ltree.body, ltree.cond);
}
项目:javaparser2jctree    文件:AJCDoWhileLoop.java   
public AJCDoWhileLoop(JCDoWhileLoop ltree, String lcomment) {
    this(ltree);
    setComment(lcomment);
}
项目:EasyMPermission    文件:JavacTreeMaker.java   
public JCDoWhileLoop DoLoop(JCStatement body, JCExpression cond) {
    return invoke(DoLoop, body, cond);
}
项目:refactor-faster    文件:UDoWhileLoop.java   
@Override
public JCDoWhileLoop inline(Inliner inliner) throws CouldNotResolveImportException {
  return inliner.maker().DoLoop(getStatement().inline(inliner), getCondition().inline(inliner));
}
项目:android-retrolambda-lombok    文件:JcTreePrinter.java   
@Override public void visitDoLoop(JCDoWhileLoop tree) {
    printNode(tree);
    child("body", tree.body);
    child("cond", tree.cond);
    indent--;
}
项目:android-retrolambda-lombok    文件:JcTreeConverter.java   
@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())));
}
项目:error-prone    文件:UDoWhileLoop.java   
@Override
public JCDoWhileLoop inline(Inliner inliner) throws CouldNotResolveImportException {
  return inliner.maker().DoLoop(getStatement().inline(inliner), getCondition().inline(inliner));
}
项目:s4j    文件:Attr.java   
public void visitDoLoop(JCDoWhileLoop tree) {
    attribStat(tree.body, env.dup(tree));
    attribExpr(tree.cond, env, syms.booleanType);
    result = null;
}
项目:Refaster    文件:UDoWhileLoop.java   
@Override
public JCDoWhileLoop inline(Inliner inliner) throws CouldNotResolveImportException {
  return inliner.maker().DoLoop(getStatement().inline(inliner), getCondition().inline(inliner));
}