protected void consumeStatementBreak() { // BreakStatement ::= 'break' ';' // break pushes a position on this.intStack in case there is no label pushOnAstStack(new BreakStatement(null, this.intStack[this.intPtr--], this.endStatementPosition)); if (this.pendingRecoveredType != null) { // Used only in statements recovery. // This is not a real break statement but a placeholder for an existing local type. // The break statement must be replace by the local type. if (this.pendingRecoveredType.allocation == null && this.endPosition <= this.pendingRecoveredType.declarationSourceEnd) { this.astStack[this.astPtr] = this.pendingRecoveredType; this.pendingRecoveredType = null; return; } this.pendingRecoveredType = null; } }
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.BreakStatement, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ public boolean visit(BreakStatement breakStatement, BlockScope scope) { this.scribe.printNextToken(TerminalTokens.TokenNamebreak); if (breakStatement.label != null) { this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, true); } this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon); this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT); return false; }
protected void consumeStatementBreakWithLabel() { // BreakStatement ::= 'break' Identifier ';' // break pushs a position on this.intStack in case there is no label pushOnAstStack( new BreakStatement( this.identifierStack[this.identifierPtr--], this.intStack[this.intPtr--], this.endStatementPosition)); this.identifierLengthPtr--; }
@Override public void endVisit(BreakStatement x, BlockScope scope) { try { SourceInfo info = makeSourceInfo(x); push(new JBreakStatement(info, getOrCreateLabel(info, x.label))); } catch (Throwable e) { throw translateException(x, e); } }
@Override public boolean visit(BreakStatement node, BlockScope scope) { fixPositions(setGeneratedBy(node, source)); return super.visit(node, scope); }
@Override public boolean visit(BreakStatement node, BlockScope scope) { setGeneratedBy(node, source); applyOffsetASTNode(node); return super.visit(node, scope); }