/** * 'continue' [label] */ @Override public boolean visit(final ContinueStatement node) { // loop node parent final ASTNode loopNode = ASTTools.enclosingLoopScope(node); if (loopNode != null) { // line of the loop final int lineNo = lineStart(loopNode); // last line of the loop scope final int lineEnd = lineEnd(loopNode); // new loop dependence appendLoopDependence(lineNo, lineEnd, createDependence(LK_CONTINUE, lineStart(node), mdg.parent())); // do not visit children return false; } return true; }
@Override public boolean visit(ContinueStatement node) { SimpleName label= node.getLabel(); if (fDefiningLabel != null && isSameLabel(label) && ASTNodes.isParent(label, fDefiningLabel)) { fResult.add(label); } return false; }
@Override public void endVisit(ContinueStatement node) { if (skipNode(node)) { return; } setFlowInfo(node, createBranch(node.getLabel())); }
@Override public boolean visit(ContinueStatement node) { SimpleName label = node.getLabel(); if (fDefiningLabel != null && isSameLabel(label) && ASTNodes.isParent(label, fDefiningLabel)) { fResult.add(label); } return false; }
private ASTNode getBreakOrContinueNode(ASTNode selectedNode) { if (selectedNode instanceof BreakStatement) return selectedNode; if (selectedNode instanceof ContinueStatement) return selectedNode; if (selectedNode instanceof SimpleName && selectedNode.getParent() instanceof BreakStatement) return selectedNode.getParent(); if (selectedNode instanceof SimpleName && selectedNode.getParent() instanceof ContinueStatement) return selectedNode.getParent(); return null; }
private SimpleName getLabel() { if (fIsBreak){ BreakStatement bs= (BreakStatement) fSelected; return bs.getLabel(); } else { ContinueStatement cs= (ContinueStatement) fSelected; return cs.getLabel(); } }
/** * Finds the target for break or continue node. * * @param input the editor input * @param region the region * @return the break or continue target location or <code>null</code> if none * @since 3.7 */ public static OccurrenceLocation findBreakOrContinueTarget(ITypeRoot input, IRegion region) { CompilationUnit astRoot= SharedASTProvider.getAST(input, SharedASTProvider.WAIT_NO, null); if (astRoot == null) return null; ASTNode node= NodeFinder.perform(astRoot, region.getOffset(), region.getLength()); ASTNode breakOrContinueNode= null; boolean labelSelected= false; if (node instanceof SimpleName) { SimpleName simpleName= (SimpleName) node; StructuralPropertyDescriptor location= simpleName.getLocationInParent(); if (location == ContinueStatement.LABEL_PROPERTY || location == BreakStatement.LABEL_PROPERTY) { breakOrContinueNode= simpleName.getParent(); labelSelected= true; } } else if (node instanceof ContinueStatement || node instanceof BreakStatement) breakOrContinueNode= node; if (breakOrContinueNode == null) return null; BreakContinueTargetFinder finder= new BreakContinueTargetFinder(); if (finder.initialize(astRoot, breakOrContinueNode) == null) { OccurrenceLocation[] locations= finder.getOccurrences(); if (locations != null) { if (breakOrContinueNode instanceof BreakStatement && !labelSelected) return locations[locations.length - 1]; // points to the end of target statement return locations[0]; // points to the beginning of target statement } } return null; }
@Override public boolean visit(ContinueStatement node) { this.fBuffer.append("continue");//$NON-NLS-1$ if (node.getLabel() != null) { this.fBuffer.append(" ");//$NON-NLS-1$ node.getLabel().accept(this); } this.fBuffer.append(";");//$NON-NLS-1$ return false; }
public boolean visit(ContinueStatement node) { printIndent(); this.buffer.append("continue");//$NON-NLS-1$ if (node.getLabel() != null) { this.buffer.append(" ");//$NON-NLS-1$ node.getLabel().accept(this); } this.buffer.append(";\n");//$NON-NLS-1$ return false; }
@SuppressWarnings("unchecked") @Override public boolean visit(QContinue statement) { Block block = blocks.peek(); ContinueStatement continueSt = ast.newContinueStatement(); block.statements().add(continueSt); return false; }
@Override public boolean visit(ContinueStatement node) { return false; }
/** {@inheritDoc} */ @Override public void endVisit(ContinueStatement node) { logger.warn("Method endVisitContinueStatement for " + node + " for " + node + " not implemented!"); super.endVisit(node); }
/** {@inheritDoc} */ @Override public boolean visit(ContinueStatement node) { logger.warn("Method visitContinueStatement for " + node + " for " + node + " not implemented!"); return super.visit(node); }
@Override public boolean visit(ContinueStatement node) { this.encounteredContinueStatement = true; return super.visit(node); }
@Override public boolean visit(final ContinueStatement node) { return this.found(); }
@Override public boolean visit(final ContinueStatement node) { return false; }
@Override public boolean visit(final ContinueStatement node) { return this.visitInstrumentable(node); }
@Override public void endVisit(ContinueStatement node) { if (skipNode(node)) return; setFlowInfo(node, createBranch(node.getLabel())); }
@Override public boolean visit(ContinueStatement node) { if (node.subtreeMatch(fMatcher, fNodeToMatch)) return matches(node); return super.visit(node); }
@Override public boolean visit(ContinueStatement node) { add(fCreator.create(node)); return true; }
@Override public void endVisit(ContinueStatement node) { endVisitNode(node); }
@Override public boolean visit(ContinueStatement node) { return visitNode(node); }
@Override public boolean visit(ContinueStatement node) { return visit((Statement)node); }
@Override public void endVisit(ContinueStatement node) { endVisit((Statement)node); }
@Override public boolean visit(final ContinueStatement node) { return this.internalVisit(node); }
@Override public boolean visit(ContinueStatement node) { statements.add(new AbstractStatement(NodeType.CONTINUE, null)); return true; }
@Override public boolean visit(ContinueStatement node) { //System.out.println("Found: " + node.getClass()); println("continue;"); return false; }
/** * @param node the AST node * @return array of type constraints, may be empty * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ContinueStatement) */ public ITypeConstraint[] create(ContinueStatement node) { return EMPTY_ARRAY; }
public boolean visit(ContinueStatement node){return this.visitStatement(node);}