@Override public boolean visit(EnhancedForStatement node) { if (this.options.keep_simple_for_body_on_same_line) handleSimpleLoop(node.getBody(), this.options.alignment_for_compact_loop); return true; }
@Override public boolean visit(EnhancedForStatement node) { handleLoopBody(node.getBody()); int lParen = this.tm.firstIndexIn(node, TokenNameLPAREN); int rParen = this.tm.firstIndexBefore(node.getBody(), TokenNameRPAREN); handleParenthesesPositions(lParen, rParen, this.options.parenthesis_positions_in_for_statement); return true; }
@Override public boolean visit(EnhancedForStatement node) { if (!this.options.keep_simple_for_body_on_same_line) handleLoopBody(node.getBody()); int lParen = this.tm.firstIndexIn(node, TokenNameLPAREN); int rParen = this.tm.firstIndexBefore(node.getBody(), TokenNameRPAREN); handleParenthesesPositions(lParen, rParen, this.options.parenthesis_positions_in_for_statement); return true; }
@Override public boolean visit(EnhancedForStatement node) { handleLoopBody(node.getBody()); int lParen = this.tm.firstIndexIn(node, TokenNameLPAREN); int rParen = this.tm.firstIndexBefore(node.getBody(), TokenNameRPAREN); handleParenthesesPositions(lParen, rParen, this.options.parenthesis_positions_in_for_statement); return true; }
@Override public boolean visit(EnhancedForStatement node) { printIndent(); this.buffer.append("for (");//$NON-NLS-1$ node.getParameter().accept(this); this.buffer.append(" : ");//$NON-NLS-1$ node.getExpression().accept(this); this.buffer.append(") ");//$NON-NLS-1$ node.getBody().accept(this); return false; }
public boolean visit(EnhancedForStatement node) { printIndent(); this.buffer.append("for (");//$NON-NLS-1$ node.getParameter().accept(this); this.buffer.append(" : ");//$NON-NLS-1$ node.getExpression().accept(this); this.buffer.append(") ");//$NON-NLS-1$ node.getBody().accept(this); return false; }
@Override public boolean visit(EnhancedForStatement node) { handleToken(node, TokenNameLPAREN, this.options.insert_space_before_opening_paren_in_for, this.options.insert_space_after_opening_paren_in_for); handleTokenBefore(node.getBody(), TokenNameRPAREN, this.options.insert_space_before_closing_paren_in_for, false); handleTokenAfter(node.getParameter(), TokenNameCOLON, this.options.insert_space_before_colon_in_for, this.options.insert_space_after_colon_in_for); return true; }
int treeSize() { return memSize() + (this.parameter == null ? 0 : getParameter().treeSize()) + (this.expression == null ? 0 : getExpression().treeSize()) + (this.body == null ? 0 : getBody().treeSize()); } }
int treeSize() { return memSize() + (this.parameter == null ? 0 : getParameter().treeSize()) + (this.expression == null ? 0 : getExpression().treeSize()) + (this.body == null ? 0 : getBody().treeSize()); } }
@Override public boolean visit(final EnhancedForStatement node) { if (isPassive(node.getExpression()) && node.getExpression().resolveTypeBinding().isArray()) { return maybeRemoveStmtWithEmptyBody(node, node.getBody()); } return VISIT_SUBTREE; }
@Override int treeSize() { return memSize() + (this.parameter == null ? 0 : getParameter().treeSize()) + (this.expression == null ? 0 : getExpression().treeSize()) + (this.body == null ? 0 : getBody().treeSize()); } }
void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { // visit children in normal left to right reading order acceptChild(visitor, getParameter()); acceptChild(visitor, getExpression()); acceptChild(visitor, getBody()); } visitor.endVisit(this); }
void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { // visit children in normal left to right reading order acceptChild(visitor, getParameter()); acceptChild(visitor, getExpression()); acceptChild(visitor, getBody()); } visitor.endVisit(this); }
@Override public boolean visit(EnhancedForStatement node) { CSForEachStatement stmt = new CSForEachStatement(node.getStartPosition(), mapExpression(node.getExpression())); stmt.variable(createParameter(node.getParameter())); visitBlock(stmt.body(), node.getBody()); addStatement(stmt); return false; }
@Override public void endVisit(EnhancedForStatement node) { if (skipNode(node)) { return; } EnhancedForFlowInfo forInfo = createEnhancedFor(); setFlowInfo(node, forInfo); forInfo.mergeParameter(getFlowInfo(node.getParameter()), fFlowContext); forInfo.mergeExpression(getFlowInfo(node.getExpression()), fFlowContext); forInfo.mergeAction(getFlowInfo(node.getBody()), fFlowContext); forInfo.removeLabel(null); }
@Override public void endVisit(EnhancedForStatement node) { if (skipNode(node)) return; EnhancedForFlowInfo forInfo= createEnhancedFor(); setFlowInfo(node, forInfo); forInfo.mergeParameter(getFlowInfo(node.getParameter()), fFlowContext); forInfo.mergeExpression(getFlowInfo(node.getExpression()), fFlowContext); forInfo.mergeAction(getFlowInfo(node.getBody()), fFlowContext); forInfo.removeLabel(null); }
ASTNode clone0(AST target) { EnhancedForStatement result = new EnhancedForStatement(target); result.setSourceRange(getStartPosition(), getLength()); result.copyLeadingComment(this); result.setParameter((SingleVariableDeclaration) getParameter().clone(target)); result.setExpression((Expression) getExpression().clone(target)); result.setBody( (Statement) ASTNode.copySubtree(target, getBody())); return result; }
@Override ASTNode clone0(AST target) { EnhancedForStatement result = new EnhancedForStatement(target); result.setSourceRange(getStartPosition(), getLength()); result.copyLeadingComment(this); result.setParameter((SingleVariableDeclaration) getParameter().clone(target)); result.setExpression((Expression) getExpression().clone(target)); result.setBody( (Statement) ASTNode.copySubtree(target, getBody())); return result; }