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

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


          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

          this.scribe.setIndentation(switchIndentationLevel, breakIndentation);
          if (wasACase) {
            this.scribe.printNewLine();
          }
          this.scribe.printComment();
          statement.traverse(this, scope);
          wasACase = false;
          wasABreak = true;
        } else if (statement instanceof Block) {
          this.scribe.setIndentation(switchIndentationLevel, wasACase ? caseIndentation : statementIndentation);
          this.scribe.printComment();
View Full Code Here

          wasABreak = false;
        } else {
          this.scribe.setIndentation(switchIndentationLevel, statementIndentation);
          this.scribe.printNewLine();
          this.scribe.printComment();
          statement.traverse(this, scope);
          wasACase = false;
          wasABreak = false;
        }
        if (statement instanceof Expression) {
          /*
 
View Full Code Here

    final Statement action = whileStatement.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.printNewLine();
        this.scribe.indent();
        action.traverse(this, scope);
        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);
        }
        this.scribe.unIndent();
View Full Code Here

    for (int i = 0; i < statementsLength; i++) {
      final Statement statement = statements[i];
      if (i > 0 && (statements[i - 1] instanceof EmptyStatement) && !(statement instanceof EmptyStatement)) {
        this.scribe.printNewLine();
      }
      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);
        if (i != statementsLength - 1) {
          if (!(statement instanceof EmptyStatement) && !(statements[i + 1] instanceof EmptyStatement)) {
View Full Code Here

    final Statement action = doStatement.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.printNewLine();
        this.scribe.indent();
        action.traverse(this, scope);
        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);
        }
        this.scribe.printNewLine();
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.