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

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


    final int numberOfParens = (expression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
    if ((numberOfParens > 0 && this.preferences.insert_space_before_parenthesized_expression_in_throw)
        || numberOfParens == 0) {
      this.scribe.space();
    }
    expression.traverse(this, scope);
    /*
     * Print the semi-colon
     */
    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


            }
            break;
        }
      }
    }
    expression.traverse(this, scope);

    if (numberOfParens > 0) {
      manageClosingParenthesizedExpression(unaryExpression, numberOfParens);
    }
    return false;
View Full Code Here

      this.scribe.enterAlignment(assignmentAlignment);
      boolean ok = false;
      do {
        try {
          this.scribe.alignFragment(assignmentAlignment, 0);
          initialization.traverse(this, scope);
          ok = true;
        } catch(AlignmentException e){
          this.scribe.redoAlignment(e);
        }
      } while (!ok);
View Full Code Here

            }
            this.scribe.printNextToken(TerminalTokens.TokenNameEQUAL, this.preferences.insert_space_before_assignment_operator);
            if (this.preferences.insert_space_after_assignment_operator) {
              this.scribe.space();
            }
            initialization.traverse(this, scope);
          }

          if (i != length - 1) {
            this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_multiple_field_declarations);
            this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
View Full Code Here

    int size = builder.size();
    MessageSend[] fragments = builder.fragments();
    Expression fragment = fragments[0].receiver;
    int startingPositionInCascade = 1;
    if (!fragment.isImplicitThis()) {
      fragment.traverse(this, scope);
    } else {
      MessageSend currentMessageSend = fragments[1];
      final int numberOfParens = (currentMessageSend.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
      if (numberOfParens > 0) {
        manageOpeningParenthesizedExpression(currentMessageSend, numberOfParens);
View Full Code Here

      this.scribe.enterAlignment(assignmentAlignment);
      boolean ok = false;
      do {
        try {
          this.scribe.alignFragment(assignmentAlignment, 0);
          initialization.traverse(this, scope);
          ok = true;
        } catch(AlignmentException e){
          this.scribe.redoAlignment(e);
        }
      } while (!ok);
View Full Code Here

    Expression defaultValue = annotationTypeMemberDeclaration.defaultValue;
    if (defaultValue != null) {
      this.scribe.printNextToken(TerminalTokens.TokenNamedefault, true);
      this.scribe.space();
      defaultValue.traverse(this, (BlockScope) null);
    }
    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

    if (explicitConstructor.isImplicitSuper()) {
      return false;
    }
    final Expression qualification = explicitConstructor.qualification;
    if (qualification != null) {
      qualification.traverse(this, scope);
      this.scribe.printNextToken(TerminalTokens.TokenNameDOT);
    }

    TypeReference[] typeArguments = explicitConstructor.typeArguments;
    if (typeArguments != null) {
View Full Code Here

    final Expression condition = forStatement.condition;
    if (condition != null) {
      if (this.preferences.insert_space_after_semicolon_in_for) {
        this.scribe.space();
      }
      condition.traverse(this, scope);
    }
    this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon_in_for);
    final Statement[] increments = forStatement.increments;
    if (increments != null) {
      if (this.preferences.insert_space_after_semicolon_in_for) {
View Full Code Here

    if (numberOfParens > 0) {
      manageOpeningParenthesizedExpression(qualifiedAllocationExpression, numberOfParens);
    }
    final Expression enclosingInstance = qualifiedAllocationExpression.enclosingInstance;
    if (enclosingInstance != null) {
      enclosingInstance.traverse(this, scope);
      this.scribe.printNextToken(TerminalTokens.TokenNameDOT);
    }

    this.scribe.printNextToken(TerminalTokens.TokenNamenew);
    // used for the new line on wrap style of formatting
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.