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

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


  (2) :
  ExplicitConstructorInvocation ::= Name '.' TypeArguments 'super' '(' ArgumentListopt ')' ';'
  ExplicitConstructorInvocation ::= Name '.' TypeArguments 'this' '(' ArgumentListopt ')' ';'
  */
  int startPosition = this.intStack[this.intPtr--];
  ExplicitConstructorCall ecc = new ExplicitConstructorCall(recFlag);
  int length;
  if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
    this.expressionPtr -= length;
    System.arraycopy(this.expressionStack, this.expressionPtr + 1, ecc.arguments = new Expression[length], 0, length);
  }
View Full Code Here


    if (!containsComment(cd.bodyStart, cd.bodyEnd)) {
      cd.bits |= ASTNode.UndocumentedEmptyBlock;
    }
  }

  ExplicitConstructorCall explicitConstructorCall = cd.constructorCall;
  if (explicitConstructorCall != null && explicitConstructorCall.sourceEnd == 0) {
    explicitConstructorCall.sourceEnd = cd.sourceEnd;
    explicitConstructorCall.sourceStart = cd.sourceStart;
  }
}
View Full Code Here

protected ASTNode wrapWithExplicitConstructorCallIfNeeded(ASTNode ast) {
  int selector;
  if (ast != null && topKnownElementKind(ASSIST_PARSER) == K_SELECTOR && ast instanceof Expression &&
      (((selector = topKnownElementInfo(ASSIST_PARSER)) == THIS_CONSTRUCTOR) ||
      (selector == SUPER_CONSTRUCTOR))) {
    ExplicitConstructorCall call = new ExplicitConstructorCall(
      (selector == THIS_CONSTRUCTOR) ?
        ExplicitConstructorCall.This :
        ExplicitConstructorCall.Super
    );
    call.arguments = new Expression[] {(Expression)ast};
View Full Code Here

  } else {
    super.consumeMethodInvocationName();
    return;
  }

  final ExplicitConstructorCall constructorCall = new SelectionOnExplicitConstructorCall(accessMode);
  constructorCall.sourceEnd = this.rParenPos;
  constructorCall.sourceStart = (int) (this.identifierPositionStack[this.identifierPtr] >>> 32);
  int length;
  if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
    this.expressionPtr -= length;
    System.arraycopy(this.expressionStack, this.expressionPtr + 1, constructorCall.arguments = new Expression[length], 0, length);
  }

  if (!this.diet){
    pushOnAstStack(constructorCall);
    this.restartRecovery  = true// force to restart in recovery mode
    this.lastIgnoredToken = -1;
  } else {
    pushOnExpressionStack(new Expression(){
      public TypeBinding resolveType(BlockScope scope) {
        constructorCall.resolve(scope);
        return null;
      }
      public StringBuffer printExpression(int indent, StringBuffer output) {
        return output;
      }
View Full Code Here

  } else {
    super.consumeMethodInvocationPrimary();
    return;
  }

  final ExplicitConstructorCall constructorCall = new SelectionOnExplicitConstructorCall(accessMode);
  constructorCall.sourceEnd = this.rParenPos;
  int length;
  if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
    this.expressionPtr -= length;
    System.arraycopy(this.expressionStack, this.expressionPtr + 1, constructorCall.arguments = new Expression[length], 0, length);
  }
  constructorCall.qualification = this.expressionStack[this.expressionPtr--];
  constructorCall.sourceStart = constructorCall.qualification.sourceStart;

  if (!this.diet){
    pushOnAstStack(constructorCall);
    this.restartRecovery  = true// force to restart in recovery mode
    this.lastIgnoredToken = -1;
  } else {
    pushOnExpressionStack(new Expression(){
      public TypeBinding resolveType(BlockScope scope) {
        constructorCall.resolve(scope);
        return null;
      }
      public StringBuffer printExpression(int indent, StringBuffer output) {
        return output;
      }
View Full Code Here

        currentMethod = ctor;
        currentMethodBody = (JMethodBody) ctor.getBody();
        currentMethodScope = x.scope;

        JMethodCall superOrThisCall = null;
        ExplicitConstructorCall ctorCall = x.constructorCall;
        if (ctorCall != null) {
          superOrThisCall = (JMethodCall) dispatch("processExpression",
              ctorCall);
        }

        /*
         * Determine if we have an explicit this call. The presence of an
         * explicit this call indicates we can skip certain initialization steps
         * (as the callee will perform those steps for us). These skippable
         * steps are 1) assigning synthetic args to fields and 2) running
         * initializers.
         */
        boolean hasExplicitThis = (ctorCall != null)
            && !ctorCall.isSuperAccess();

        JClassType enclosingType = (JClassType) ctor.getEnclosingType();

        // Call clinit; $clinit is always in position 0.
        JMethod clinitMethod = enclosingType.getMethods().get(0);
View Full Code Here

TOP

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

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.