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

Examples of org.eclipse.jdt.internal.compiler.ast.ASTNode


    arguments,
    location.sourceStart,
    location.sourceEnd);
}
public void annotationCannotOverrideMethod(MethodBinding overrideMethod, MethodBinding inheritedMethod) {
  ASTNode location = overrideMethod.sourceMethod();
  this.handle(
    IProblem.AnnotationCannotOverrideMethod,
    new String[] {
        new String(overrideMethod.declaringClass.readableName()),
        new String(inheritedMethod.declaringClass.readableName()),
View Full Code Here


    new String[] {new String(type.shortReadableName())},
    location.sourceStart,
    location.sourceEnd);
}
public void genericTypeCannotExtendThrowable(TypeDeclaration typeDecl) {
  ASTNode location = typeDecl.binding.isAnonymousType() ? typeDecl.allocation.type : typeDecl.superclass;
  this.handle(
    IProblem.GenericTypeCannotExtendThrowable,
    new String[]{ new String(typeDecl.binding.readableName()) },
    new String[]{ new String(typeDecl.binding.shortReadableName()) },
    location.sourceStart,
View Full Code Here

    if (location instanceof InvocationSite) {
      InvocationSite site = (InvocationSite) location;
      start = site.sourceStart();
      end = site.sourceEnd();
    } else if (location instanceof ASTNode) {
      ASTNode node = (ASTNode) location;
      start = node.sourceStart();
      end = node.sourceEnd();
    }
  }
  this.handle(
    IProblem.IsClassPathCorrect,
    arguments,
View Full Code Here

  int severity = computeSeverity(IProblem.UnsafeReturnTypeOverride);
  if (severity == ProblemSeverities.Ignore) return;
  int start = type.sourceStart();
  int end = type.sourceEnd();
  if (currentMethod.declaringClass == type) {
    ASTNode location = ((MethodDeclaration) currentMethod.sourceMethod()).returnType;
    start = location.sourceStart();
    end = location.sourceEnd();
  }
  this.handle(
      IProblem.UnsafeReturnTypeOverride,
      new String[] {
        new String(currentMethod.returnType.readableName()),
View Full Code Here

    this.lookupEnvironment.unitBeingCompleted = this.compilationUnitDeclaration;
    try {
      this.hasComputedVisibleElementBindings = true;
 
      Scope scope = this.assistScope;
      ASTNode astNode = this.assistNode;
      boolean notInJavadoc = this.completionContext.javadoc == 0;
 
      this.visibleLocalVariables = new ObjectVector();
      this.visibleFields = new ObjectVector();
      this.visibleMethods = new ObjectVector();
View Full Code Here

  }

  private ASTNode[] computeMergedMemberDeclarations(ASTNode[] nodes){
    ArrayList mergedNodes = new ArrayList();
    for (int i = 0, max = nodes.length; i < max; i++) {
      ASTNode currentNode = nodes[i];
      if (currentNode instanceof FieldDeclaration) {
        FieldDeclaration currentField = (FieldDeclaration) currentNode;
        if (mergedNodes.size() == 0) {
          // first node
          mergedNodes.add(currentNode);
        } else {
          // we need to check if the previous merged node is a field declaration
          ASTNode previousMergedNode = (ASTNode) mergedNodes.get(mergedNodes.size() - 1);
          if (previousMergedNode instanceof MultiFieldDeclaration) {
            // we merge the current node
            MultiFieldDeclaration multiFieldDeclaration = (MultiFieldDeclaration) previousMergedNode;
            int length = multiFieldDeclaration.declarations.length;
            System.arraycopy(multiFieldDeclaration.declarations, 0, multiFieldDeclaration.declarations= new FieldDeclaration[length+1], 0, length);
View Full Code Here

            }
            continue;
          }
          // next member is a field
          if (fieldStart == previousFieldStart){
            ASTNode previousMember = members[index - 1];
            if (previousMember instanceof MultiFieldDeclaration) {
              MultiFieldDeclaration multiField = (MultiFieldDeclaration) previousMember;
              int length = multiField.declarations.length;
              System.arraycopy(multiField.declarations, 0, multiField.declarations=new FieldDeclaration[length+1], 0, length);
              multiField.declarations[length] = field;
View Full Code Here

        int[] operators = builder.operators();
        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

    boolean ok = false;
    int startIndex = 0;
    do {
      try {
        for (int i = startIndex, max = mergedNodes.length; i < max; i++) {
          ASTNode member = mergedNodes[i];
          if (member instanceof FieldDeclaration) {
            isChunkStart = memberAlignment.checkChunkStart(FIELD, i, this.scribe.scanner.currentPosition);
            if (member instanceof MultiFieldDeclaration){
              MultiFieldDeclaration multiField = (MultiFieldDeclaration) member;
              format(multiField, this, null, isChunkStart, i == 0);
View Full Code Here

            while (isNextToken(TerminalTokens.TokenNameSEMICOLON)) {
              this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
              this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
            }
            this.scribe.printNewLine();
            ASTNode member = members[i];
            if (member instanceof FieldDeclaration) {
              isChunkStart = memberAlignment.checkChunkStart(Alignment.CHUNK_FIELD, i, this.scribe.scanner.currentPosition);
              if (member instanceof MultiFieldDeclaration) {
                MultiFieldDeclaration multiField = (MultiFieldDeclaration) member;
 
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.ast.ASTNode

Copyright © 2018 www.massapicom. 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.