本文整理汇总了Java中com.sun.source.tree.ContinueTree类的典型用法代码示例。如果您正苦于以下问题:Java ContinueTree类的具体用法?Java ContinueTree怎么用?Java ContinueTree使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ContinueTree类属于com.sun.source.tree包,在下文中一共展示了ContinueTree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitContinue
import com.sun.source.tree.ContinueTree; //导入依赖的package包/类
@Override
public Node visitContinue(ContinueTree tree, Void p) {
Name label = tree.getLabel();
if (label == null) {
assert continueTargetL != null : "no target for continue statement";
extendWithExtendedNode(new UnconditionalJump(continueTargetL));
} else {
assert continueLabels.containsKey(label);
extendWithExtendedNode(new UnconditionalJump(
continueLabels.get(label)));
}
return null;
}
示例2: visitContinue
import com.sun.source.tree.ContinueTree; //导入依赖的package包/类
@Override
public Tree visitContinue(ContinueTree tree, Void p) {
ContinueTree n = make.Continue(tree.getLabel());
// model.setType(n, model.getType(tree));
comments.copyComments(tree, n);
model.setPos(n, model.getPos(tree));
return n;
}
示例3: visitContinue
import com.sun.source.tree.ContinueTree; //导入依赖的package包/类
public Boolean visitContinue(ContinueTree node, TreePath p) {
if (p == null) {
super.visitContinue(node, p);
return false;
}
//XXX: check labels
return true;
}
示例4: visitContinue
import com.sun.source.tree.ContinueTree; //导入依赖的package包/类
public Void visitContinue(ContinueTree node, Object p) {
System.err.println("visitContinue: " + node.getLabel());
super.visitContinue(node, p);
ContinueTree copy = make.setLabel(node, node.getLabel() + "0");
this.copy.rewrite(node, copy);
return null;
}
示例5: testContinue158130
import com.sun.source.tree.ContinueTree; //导入依赖的package包/类
public void testContinue158130() throws Exception {
String test = "public class Test { void m(int p) { loop: while (true) { if (p == 0) { con|tinue loop; } } } }";
String golden = "public class Test { void m(int p) { loop: while (true) { if (p == 0) { continue; } } } }";
testHelper(test, golden, Kind.CONTINUE, new Delegate() {
public void run(WorkingCopy copy, Tree tree) {
ContinueTree original = (ContinueTree) tree;
TreeMaker make = copy.getTreeMaker();
ContinueTree modified = make.Continue(null);
copy.rewrite(original, modified);
}
});
}
示例6: visitContinue
import com.sun.source.tree.ContinueTree; //导入依赖的package包/类
@Override
public Void visitContinue(ContinueTree tree, List<Node> d) {
List<Node> below = new ArrayList<Node>();
addCorrespondingType(below);
addCorrespondingComments(below);
super.visitContinue(tree, below);
d.add(new TreeNode(info, getCurrentPath(), below));
return null;
}
示例7: visitContinue
import com.sun.source.tree.ContinueTree; //导入依赖的package包/类
@Override
public Tree visitContinue(ContinueTree that, Trees trees) {
if (that.getLabel() != null || !isIfWithContinueOnly(that)) {
this.hasContinue = true;
}
return super.visitContinue(that, trees);
}
示例8: isIfWithContinueOnly
import com.sun.source.tree.ContinueTree; //导入依赖的package包/类
private boolean isIfWithContinueOnly(ContinueTree that) {
TreePath currentTreePath = this.getCurrentPath();
TreePath parentPath = currentTreePath.getParentPath();
Tree parentTree = parentPath.getLeaf();
if (parentTree.getKind() == Tree.Kind.IF) {
return true;
} else if (parentTree.getKind() == Tree.Kind.BLOCK) {
BlockTree parentBlock = (BlockTree) parentTree;
if (parentBlock.getStatements().size() == 1) {
return true;
}
}
return false;
}
示例9: visitContinue
import com.sun.source.tree.ContinueTree; //导入依赖的package包/类
@Override
public Void visitContinue(ContinueTree node, Collection<TreePath> trees) {
if (!analyzeThrows && !seenTrees.contains(info.getTreeUtilities().getBreakContinueTarget(getCurrentPath()))) {
trees.add(getCurrentPath());
}
return null;
}
示例10: visitContinue
import com.sun.source.tree.ContinueTree; //导入依赖的package包/类
@Override
public Void visitContinue(ContinueTree node, Void p) {
if (isMethodCode() && phase == PHASE_INSIDE_SELECTION && !treesSeensInSelection.contains(info.getTreeUtilities().getBreakContinueTarget(getCurrentPath()))) {
selectionExits.add(getCurrentPath());
hasContinues = true;
}
return super.visitContinue(node, p);
}
示例11: visitContinue
import com.sun.source.tree.ContinueTree; //导入依赖的package包/类
@Override
public Mirror visitContinue(ContinueTree arg0, EvaluationContext evaluationContext) {
Name label = arg0.getLabel();
if (label != null) {
Assert.error(arg0, "unsupported");
return null;
}
return new Continue();
}
示例12: visitContinue
import com.sun.source.tree.ContinueTree; //导入依赖的package包/类
@Override
public Void visitContinue(ContinueTree node, Void unused) {
sync(node);
builder.open(plusFour);
token("continue");
if (node.getLabel() != null) {
builder.breakOp(" ");
visit(node.getLabel());
}
token(";");
builder.close();
return null;
}
示例13: continueStatement
import com.sun.source.tree.ContinueTree; //导入依赖的package包/类
/** Matches a {@code continue} statement. */
public static Matcher<StatementTree> continueStatement() {
return new Matcher<StatementTree>() {
@Override
public boolean matches(StatementTree statementTree, VisitorState state) {
return statementTree instanceof ContinueTree;
}
};
}
示例14: visitContinue
import com.sun.source.tree.ContinueTree; //导入依赖的package包/类
@Override
public Void visitContinue(ContinueTree tree, VisitorState visitorState) {
VisitorState state = visitorState.withPath(getCurrentPath());
for (ContinueTreeMatcher matcher : continueMatchers) {
if (!isSuppressed(matcher, state)) {
try {
reportMatch(matcher.matchContinue(tree, state), tree, state);
} catch (Throwable t) {
handleError(matcher, t);
}
}
}
return super.visitContinue(tree, state);
}
示例15: visitContinue
import com.sun.source.tree.ContinueTree; //导入依赖的package包/类
@Override
public Choice<Unifier> visitContinue(ContinueTree node, Unifier unifier) {
if (getLabel() == null) {
return Choice.condition(node.getLabel() == null, unifier);
} else {
CharSequence boundName = unifier.getBinding(key());
return Choice.condition(
boundName != null && node.getLabel().contentEquals(boundName), unifier);
}
}