Examples of traverse()


Examples of org.eclipse.dltk.ast.declarations.ModuleDeclaration.traverse()

    ModuleDeclaration moduleDeclaration = SourceParserUtil.getModuleDeclaration(sourceElement.getSourceModule());
    if (moduleDeclaration != null) {
      SourceTypeFinder sourceTypeFinder = new PDTModelUtils().new SourceTypeFinder(sourceElement.getSourceModule(), offset, length);

      try {
        moduleDeclaration.traverse(sourceTypeFinder);
      } catch (Exception e) {
        throw new CoreException(new Status(IStatus.ERROR, PEXCorePlugin.PLUGIN_ID, e.getMessage(), e));
      }

      return sourceTypeFinder.getSourceType();
View Full Code Here

Examples of org.eclipse.dltk.ast.expressions.Expression.traverse()

  public void traverse(ASTVisitor visitor) throws Exception {
    if (visitor.visit(this)) {
      for (Iterator<Expression> iterator = exprs.iterator(); iterator.hasNext();) {
        Expression expr = iterator.next();
        if (expr != null) {
          expr.traverse(visitor);
        }
      }
      visitor.endvisit(this);
    }
  }
View Full Code Here

Examples of org.eclipse.dltk.ast.statements.Statement.traverse()

    xmlWriter.endTag("TrueStatement"); //$NON-NLS-1$

    Statement falseStatement = s.getFalseStatement();
    if (falseStatement != null) {
      xmlWriter.startTag("FalseStatement", new HashMap<String, String>()); //$NON-NLS-1$
      falseStatement.traverse(this);
      xmlWriter.endTag("FalseStatement"); //$NON-NLS-1$
    }

    return false;
  }
View Full Code Here

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

        do {
          try {
            final int max = fragmentsSize - 1;
            for (int i = 0; i < max; i++) {
              ASTNode fragment = fragments[i];
              fragment.traverse(this, scope);
              this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
              if (this.scribe.lastNumberOfNewLines == 1) {
                // a new line has been inserted while printing the comment
                // hence we need to use the break indentation level before printing next token...
                this.scribe.indentationLevel = binaryExpressionAlignment.breakIndentationLevel;
View Full Code Here

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

        root.setEntity(new SourceCodeEntity(methodName, JavaEntityType.METHOD, new SourceRange(
                method.declarationSourceStart,
                method.declarationSourceEnd)));
        List<Comment> comments = CompilationUtils.extractComments(compilation);
        sMethodBodyConverter.initialize(root, method, comments, compilation.getScanner());
        method.traverse(sMethodBodyConverter, (ClassScope) null);
        return root;
    }

    public Node convertMethodDeclaration(String methodName, JavaCompilation compilation) {
        AbstractMethodDeclaration method = CompilationUtils.findMethod(compilation.getCompilationUnit(), methodName);
View Full Code Here

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

          this.scribe.printNextToken(TerminalTokens.TokenNameRBRACKET, this.preferences.insert_space_between_empty_brackets_in_array_allocation_expression);
        }
      }
      final ArrayInitializer initializer = arrayAllocationExpression.initializer;
      if (initializer != null) {
        initializer.traverse(this, scope);
      }

      if (numberOfParens > 0) {
        manageClosingParenthesizedExpression(arrayAllocationExpression, numberOfParens);
      }
View Full Code Here

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

      if (searchPosition < 0 || searchPosition > source.length) {
        // the position is out of range. There is no need to search for a node.
        return compilationUnitDeclaration;
      }

      compilationUnitDeclaration.traverse(nodeSearcher, compilationUnitDeclaration.scope);

      org.eclipse.jdt.internal.compiler.ast.ASTNode node = nodeSearcher.found;
      if (node == null) {
        return compilationUnitDeclaration;
      }
View Full Code Here

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

    this.lastLocalDeclarationSourceStart = -1;
    try {
      ExplicitConstructorCall explicitConstructorCall = constructorDeclaration.constructorCall;
      if (explicitConstructorCall != null && !explicitConstructorCall.isImplicitSuper()) {
        explicitConstructorCall.traverse(this, null);
      }
      Statement[] statements = constructorDeclaration.statements;
      if (statements != null) {
        formatStatements(null, statements, false);
      }
View Full Code Here

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

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

          do {
            try {
              for (int i = 0; i < enumConstantsLength; i++) {
                this.scribe.alignFragment(enumConstantsAlignment, i);
                FieldDeclaration fieldDeclaration = fieldDeclarations[i];
                fieldDeclaration.traverse(this, typeDeclaration.initializerScope);
                if (isNextToken(TerminalTokens.TokenNameCOMMA)) {
                  this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_enum_declarations);
                  if (this.preferences.insert_space_after_comma_in_enum_declarations) {
                    this.scribe.space();
                  }
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.