private void manageClosingParenthesizedExpression(Expression expression, int numberOfParens) { for (int i = 0; i < numberOfParens; i++) { this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_parenthesized_expression); } }
private void manageClosingParenthesizedExpression(Expression expression, int numberOfParens) { for (int i = 0; i < numberOfParens; i++) { this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_parenthesized_expression); } }
private void manageClosingParenthesizedExpression(Expression expression, int numberOfParens) { for (int i = 0; i < numberOfParens; i++) { this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_parenthesized_expression); } }
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.ContinueStatement, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ public boolean visit(ContinueStatement continueStatement, BlockScope scope) { this.scribe.printNextToken(TerminalTokens.TokenNamecontinue); if (continueStatement.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; }
/** * @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; }
private void formatQualifiedTypeReference(QualifiedTypeReference qualifiedTypeReference) { for (int i = 0, length = qualifiedTypeReference.tokens.length; i < length; ++i) { if (i != 0) this.scribe.printNextToken(TerminalTokens.TokenNameDOT, false); if (qualifiedTypeReference.annotations != null) { formatInlineAnnotations(qualifiedTypeReference.annotations[i], false); this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, false); } else { this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, false); } } }
private void formatQualifiedTypeReference(QualifiedTypeReference qualifiedTypeReference) { for (int i = 0, length = qualifiedTypeReference.tokens.length; i < length; ++i) { if (i != 0) this.scribe.printNextToken(TerminalTokens.TokenNameDOT, false); if (qualifiedTypeReference.annotations != null) { formatInlineAnnotations(qualifiedTypeReference.annotations[i], false); this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, false); } else { this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, false); } } }
private void manageOpeningParenthesizedExpression(Expression expression, int numberOfParens) { for (int i = 0; i < numberOfParens; i++) { this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_parenthesized_expression); if (this.preferences.insert_space_after_opening_paren_in_parenthesized_expression) { this.scribe.space(); } } }
public boolean visit(MemberValuePair pair, BlockScope scope) { this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier); this.scribe.printNextToken(TerminalTokens.TokenNameEQUAL, this.preferences.insert_space_before_assignment_operator); if (this.preferences.insert_space_after_assignment_operator) { this.scribe.space(); } pair.value.traverse(this, scope); return false; }
public boolean visit(MemberValuePair pair, BlockScope scope) { this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier); this.scribe.printNextToken(TerminalTokens.TokenNameEQUAL, this.preferences.insert_space_before_assignment_operator); if (this.preferences.insert_space_after_assignment_operator) { this.scribe.space(); } pair.value.traverse(this, scope); return false; }
private void manageOpeningParenthesizedExpression(Expression expression, int numberOfParens) { for (int i = 0; i < numberOfParens; i++) { this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_parenthesized_expression); if (this.preferences.insert_space_after_opening_paren_in_parenthesized_expression) { this.scribe.space(); } } }
private void formatGuardClauseBlock(Block block, BlockScope scope) { this.scribe.printNextToken(TerminalTokens.TokenNameLBRACE, this.preferences.insert_space_before_opening_brace_in_block); this.scribe.space(); final Statement[] statements = block.statements; statements[0].traverse(this, scope); this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE, true); this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT); }
private void formatGuardClauseBlock(Block block, BlockScope scope) { this.scribe.printNextToken(TerminalTokens.TokenNameLBRACE, this.preferences.insert_space_before_opening_brace_in_block); this.scribe.space(); final Statement[] statements = block.statements; statements[0].traverse(this, scope); this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE, true); this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT); }
private void formatGuardClauseBlock(Block block, BlockScope scope) { this.scribe.printNextToken(TerminalTokens.TokenNameLBRACE, this.preferences.insert_space_before_opening_brace_in_block); this.scribe.space(); final Statement[] statements = block.statements; statements[0].traverse(this, scope); this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE, true); this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT); }
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.EmptyStatement, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ public boolean visit(EmptyStatement statement, BlockScope scope) { if (this.preferences.put_empty_statement_on_new_line) { this.scribe.printNewLine(); } this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon); this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT); return false; } // field is an enum constant
/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.Initializer, org.eclipse.jdt.internal.compiler.lookup.MethodScope) */ public boolean visit(Initializer initializer, MethodScope scope) { if (initializer.isStatic()) { this.scribe.printNextToken(TerminalTokens.TokenNamestatic); } initializer.block.traverse(this, scope); return false; }
public boolean visit(MarkerAnnotation annotation, ClassScope scope) { this.scribe.printNextToken(TerminalTokens.TokenNameAT); if (this.preferences.insert_space_after_at_in_annotation) { this.scribe.space(); } this.scribe.printQualifiedReference(annotation.sourceEnd, false/*do not expect parenthesis*/); return false; } public boolean visit(MemberValuePair pair, BlockScope scope) {
public boolean visit(MarkerAnnotation annotation, ClassScope scope) { this.scribe.printNextToken(TerminalTokens.TokenNameAT); if (this.preferences.insert_space_after_at_in_annotation) { this.scribe.space(); } this.scribe.printQualifiedReference(annotation.sourceEnd, false/*do not expect parenthesis*/); return false; } public boolean visit(MemberValuePair pair, BlockScope scope) {
private void formatNecessaryEmptyStatement() { if (this.preferences.put_empty_statement_on_new_line) { this.scribe.printNewLine(); this.scribe.indent(); this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon); this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT); this.scribe.unIndent(); } else { this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon); this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT); } }
public static class MultiFieldDeclaration extends FieldDeclaration { FieldDeclaration[] declarations; MultiFieldDeclaration(FieldDeclaration[] declarations){ this.declarations = declarations; this.modifiers = declarations[0].modifiers; } }