Examples of LocalDeclaration


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

  this.realBlockStack[this.realBlockPtr]++;

  // update source end to include the semi-colon
  int variableDeclaratorsCounter = this.astLengthStack[this.astLengthPtr];
  for (int i = variableDeclaratorsCounter - 1; i >= 0; i--) {
    LocalDeclaration localDeclaration = (LocalDeclaration) this.astStack[this.astPtr - i];
    localDeclaration.declarationSourceEnd = this.endStatementPosition;
    localDeclaration.declarationEnd = this.endStatementPosition;  // semi-colon included
  }

}
View Full Code Here

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

protected void consumeResourceSpecification() {
  // ResourceSpecification ::= '(' Resources ')'
}
protected void consumeResourceOptionalTrailingSemiColon(boolean punctuated) {
  // TrailingSemiColon ::= ';'
  LocalDeclaration localDeclaration = (LocalDeclaration) this.astStack[this.astPtr];
  if (punctuated) {
    localDeclaration.declarationSourceEnd = this.endStatementPosition;
  }
}
View Full Code Here

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

}
protected JavadocParser createJavadocParser() {
  return new JavadocParser(this);
}
protected LocalDeclaration createLocalDeclaration(char[] localDeclarationName, int sourceStart, int sourceEnd) {
  return new LocalDeclaration(localDeclarationName, sourceStart, sourceEnd);
}
View Full Code Here

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

    Statement updatedStatement = this.statements[i].updatedStatement(depth, knownTypes);
    if (updatedStatement != null){
      updatedStatements[updatedCount++] = updatedStatement;
     
      if (updatedStatement instanceof LocalDeclaration) {
        LocalDeclaration localDeclaration = (LocalDeclaration) updatedStatement;
        if(localDeclaration.declarationSourceEnd > lastEnd) {
          lastEnd = localDeclaration.declarationSourceEnd;
        }
      } else if (updatedStatement instanceof TypeDeclaration) {
        TypeDeclaration typeDeclaration = (TypeDeclaration) updatedStatement;
View Full Code Here

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

      return null;
    }
  }

  private JavaElement getJavaElement(LocalVariableBinding binding) {
    LocalDeclaration local = binding.declaration;

    JavaElement parent = null;
    ReferenceContext referenceContext = binding.declaringScope.referenceContext();
    if (referenceContext instanceof AbstractMethodDeclaration) {
      AbstractMethodDeclaration methodDeclaration = (AbstractMethodDeclaration) referenceContext;
      parent = this.getJavaElementOfCompilationUnit(methodDeclaration, methodDeclaration.binding);
    } else if (referenceContext instanceof TypeDeclaration){
      // Local variable is declared inside an initializer
      TypeDeclaration typeDeclaration = (TypeDeclaration) referenceContext;

      JavaElement type = this.getJavaElementOfCompilationUnit(typeDeclaration, typeDeclaration.binding);
      parent = Util.getUnresolvedJavaElement(local.sourceStart, local.sourceEnd, type);
    }
    if (parent == null) return null;

    return new LocalVariable(
        parent,
        new String(local.name),
        local.declarationSourceStart,
        local.declarationSourceEnd,
        local.sourceStart,
        local.sourceEnd,
        Util.typeSignature(local.type),
        binding.declaration.annotations,
        local.modifiers,
        local.getKind() == AbstractVariableDeclaration.PARAMETER);
  }
View Full Code Here

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

protected void consumeLocalVariableDeclarationStatement() {
  super.consumeLocalVariableDeclarationStatement();

  // force to restart in recovery mode if the declaration contains the selection
  if (!this.diet) {
    LocalDeclaration localDeclaration = (LocalDeclaration) this.astStack[this.astPtr];
    if ((this.selectionStart >= localDeclaration.sourceStart)
        &&  (this.selectionEnd <= localDeclaration.sourceEnd)) {
      this.restartRecovery  = true;
      this.lastIgnoredToken = -1;
    }
View Full Code Here

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

    Statement updatedStatement = this.statements[i].updatedStatement(depth, knownTypes);
    if (updatedStatement != null){
      updatedStatements[updatedCount++] = updatedStatement;

      if (updatedStatement instanceof LocalDeclaration) {
        LocalDeclaration localDeclaration = (LocalDeclaration) updatedStatement;
        if(localDeclaration.declarationSourceEnd > lastEnd) {
          lastEnd = localDeclaration.declarationSourceEnd;
        }
      } else if (updatedStatement instanceof TypeDeclaration) {
        TypeDeclaration typeDeclaration = (TypeDeclaration) updatedStatement;
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.