Package org.eclipse.jdt.internal.compiler.ast

Examples of org.eclipse.jdt.internal.compiler.ast.Statement.traverse()


    final Statement action = forStatement.action;
    if (action != null) {
      if (action instanceof Block) {
        formatLeftCurlyBrace(line, this.preferences.brace_position_for_block);
        action.traverse(this, scope);
      } else if (action instanceof EmptyStatement) {
        /*
         * This is an empty statement
         */
        formatNecessaryEmptyStatement();
 
View Full Code Here


         */
        formatNecessaryEmptyStatement();
      } else {
        this.scribe.indent();
        this.scribe.printNewLine();
        action.traverse(this, scope);
        this.scribe.unIndent();
      }
      if (action instanceof Expression) {
        this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
        this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
View Full Code Here

    final Statement action = forStatement.action;
    if (action != null) {
      if (action instanceof Block) {
        formatLeftCurlyBrace(line, this.preferences.brace_position_for_block);
        action.traverse(this, scope);
      } else if (action instanceof EmptyStatement) {
        /*
         * This is an empty statement
         */
        formatNecessaryEmptyStatement();
 
View Full Code Here

         */
        formatNecessaryEmptyStatement();
      } else {
        this.scribe.indent();
        this.scribe.printNewLine();
        action.traverse(this, scope);
        this.scribe.unIndent();
      }
      if (action instanceof Expression) {
        this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
        this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
View Full Code Here

        this.scribe.printNextToken(TerminalTokens.TokenNameelse, this.preferences.insert_space_after_closing_brace_in_block, Scribe.PRESERVE_EMPTY_LINES_BEFORE_ELSE);
      } else {
        this.scribe.printNextToken(TerminalTokens.TokenNameelse, true, Scribe.PRESERVE_EMPTY_LINES_BEFORE_ELSE);
      }
      if (elseStatement instanceof Block) {
        elseStatement.traverse(this, scope);
      } else if (elseStatement instanceof IfStatement) {
        if (!this.preferences.compact_else_if) {
          this.scribe.printNewLine();
          this.scribe.indent();
        }
View Full Code Here

        if (!this.preferences.compact_else_if) {
          this.scribe.printNewLine();
          this.scribe.indent();
        }
        this.scribe.space();
        elseStatement.traverse(this, scope);
        if (!this.preferences.compact_else_if) {
          this.scribe.unIndent();
        }
      } else if (this.preferences.keep_else_statement_on_same_line) {
        this.scribe.space();
View Full Code Here

        if (!this.preferences.compact_else_if) {
          this.scribe.unIndent();
        }
      } else if (this.preferences.keep_else_statement_on_same_line) {
        this.scribe.space();
        elseStatement.traverse(this, scope);
        if (elseStatement instanceof Expression) {
          this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
          this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
        }
      } else {
View Full Code Here

          this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
        }
      } else {
        this.scribe.printNewLine();
        this.scribe.indent();
        elseStatement.traverse(this, scope);
        if (elseStatement instanceof Expression) {
          this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
          this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
        }
        this.scribe.unIndent();
View Full Code Here

    }
    if (this.preferences.insert_new_line_after_label) {
      this.scribe.printNewLine();
    }
    final Statement statement = labeledStatement.statement;
    statement.traverse(this, scope);
    if (statement instanceof Expression) {
      this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
      this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
    }
    return false;
View Full Code Here

            this.scribe.setIndentation(switchIndentationLevel, caseIndentation);
          }
          if (wasACase) {
            this.scribe.printNewLine();
          }
          statement.traverse(this, scope);
          // Print following trailing (if any) comment at statement indentation
          this.scribe.setIndentation(switchIndentationLevel, statementIndentation);
          this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.COMPLEX_TRAILING_COMMENT);
          wasACase = true;
          wasABreak = false;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.