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

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


      }
    }
  }

  //watch for } that could be given as a unicode ! ( u007D is '}' )
  MethodDeclaration md = (MethodDeclaration) this.astStack[this.astPtr];
  md.statements = statements;
  md.explicitDeclarations = explicitDeclarations;
  md.bodyEnd = this.endPosition;
  md.declarationSourceEnd = flushCommentsDefinedPriorTo(this.endStatementPosition);
 
View Full Code Here


      }
    }
  }

  // now we know that we have a method declaration at the top of the ast stack
  MethodDeclaration md = (MethodDeclaration) this.astStack[this.astPtr];
  md.statements = statements;
  md.explicitDeclarations = explicitDeclarations;

  // cannot be done in consumeMethodHeader because we have no idea whether or not there
  // is a body when we reduce the method header
View Full Code Here

    this.restartRecovery = true; // used to avoid branching back into the regular automaton
  }
}
protected void consumeMethodHeaderDefaultValue() {
  // MethodHeaderDefaultValue ::= DefaultValue
  MethodDeclaration md = (MethodDeclaration) this.astStack[this.astPtr];


  int length = this.expressionLengthStack[this.expressionLengthPtr--];
  if (length == 1) {
    this.intPtr--; // we get rid of the position of the default keyword
    this.intPtr--; // we get rid of the position of the default keyword
    if(md.isAnnotationMethod()) {
      ((AnnotationMethodDeclaration)md).defaultValue = this.expressionStack[this.expressionPtr];
      md.modifiers |=  ClassFileConstants.AccAnnotationDefault;
    }
    this.expressionPtr--;
    this.recordStringLiterals = true;
  }

  if(this.currentElement != null) {
    if(md.isAnnotationMethod()) {
      this.currentElement.updateSourceEndIfNecessary(((AnnotationMethodDeclaration)md).defaultValue.sourceEnd);
    }
  }
}
View Full Code Here

  }
}
protected void consumeMethodHeaderExtendedDims() {
  // MethodHeaderExtendedDims ::= Dimsopt
  // now we update the returnType of the method
  MethodDeclaration md = (MethodDeclaration) this.astStack[this.astPtr];
  int extendedDimensions = this.intStack[this.intPtr--];
  if(md.isAnnotationMethod()) {
    ((AnnotationMethodDeclaration)md).extendedDimensions = extendedDimensions;
  }
  if (extendedDimensions != 0) {
    md.sourceEnd = this.endPosition;
    md.returnType = augmentTypeWithAdditionalDimensions(md.returnType, extendedDimensions, getAnnotationsOnDimensions(extendedDimensions), false);
View Full Code Here

}
protected void consumeMethodHeaderName(boolean isAnnotationMethod) {
  // MethodHeaderName ::= Modifiersopt Type 'Identifier' '('
  // AnnotationMethodHeaderName ::= Modifiersopt Type 'Identifier' '('
  // RecoveryMethodHeaderName ::= Modifiersopt Type 'Identifier' '('
  MethodDeclaration md = null;
  if(isAnnotationMethod) {
    md = new AnnotationMethodDeclaration(this.compilationUnit.compilationResult);
    this.recordStringLiterals = false;
  } else {
    md = new MethodDeclaration(this.compilationUnit.compilationResult);
  }

  //name
  md.selector = this.identifierStack[this.identifierPtr];
  long selectorSource = this.identifierPositionStack[this.identifierPtr--];
View Full Code Here

}
protected void consumeMethodHeaderNameWithTypeParameters(boolean isAnnotationMethod) {
  // MethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
  // AnnotationMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
  // RecoveryMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
  MethodDeclaration md = null;
  if(isAnnotationMethod) {
    md = new AnnotationMethodDeclaration(this.compilationUnit.compilationResult);
    this.recordStringLiterals = false;
  } else {
    md = new MethodDeclaration(this.compilationUnit.compilationResult);
  }

  //name
  md.selector = this.identifierStack[this.identifierPtr];
  long selectorSource = this.identifierPositionStack[this.identifierPtr--];
View Full Code Here

  }
  return false;
}

public MethodDeclaration convertToMethodDeclaration(ConstructorDeclaration c, CompilationResult compilationResult) {
  MethodDeclaration m = new MethodDeclaration(compilationResult);
  m.typeParameters = c.typeParameters;
  m.sourceStart = c.sourceStart;
  m.sourceEnd = c.sourceEnd;
  m.bodyStart = c.bodyStart;
  m.bodyEnd = c.bodyEnd;
View Full Code Here

  this.ignoreNextOpeningBrace = false;
}
// A P I
protected void reportSyntaxErrors(boolean isDietParse, int oldFirstToken) {
  if(this.referenceContext instanceof MethodDeclaration) {
    MethodDeclaration methodDeclaration = (MethodDeclaration) this.referenceContext;
    if((methodDeclaration.bits & ASTNode.ErrorInSignature) != 0){
      return;
    }
  }
  this.compilationUnit.compilationResult.lineSeparatorPositions = this.scanner.getLineEnds();
View Full Code Here

TOP

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

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.