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

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression


  /* (non-Javadoc)
   * @see ITypeBinding#isCastCompatible(ITypeBinding)
   */
  public boolean isCastCompatible(ITypeBinding type) {
    try {
      Expression expression = new Expression() {
        public StringBuffer printExpression(int indent,StringBuffer output) {
          return null;
        }
      };
      Scope scope = this.resolver.scope();
      if (scope == null) return false;
      if (!(type instanceof TypeBinding)) return false;
      org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding expressionType = ((TypeBinding) type).binding;
      // simulate capture in case checked binding did not properly get extracted from a reference
      expressionType = expressionType.capture(scope, 0);
      return expression.checkCastTypesCompatibility(scope, this.binding, expressionType, null);
    } catch (AbortCompilation e) {
      // don't surface internal exception to clients
      // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=143013
      return false;
    }
View Full Code Here


    declarationFactory.setInitialization(itdDecl,null);
  }
  protected void consumeExitITDVariableWithInitializer() {
    this.expressionLengthPtr--;
    MethodDeclaration itdDecl = (MethodDeclaration) this.astStack[this.astPtr];
    Expression initialization = this.expressionStack[this.expressionPtr--];
    declarationFactory.setInitialization(itdDecl,initialization);
    // we need to update the declarationSourceEnd of the local variable declaration to the
    // source end position of the initialization expression
    itdDecl.declarationSourceEnd = initialization.sourceEnd;
  }
View Full Code Here

    pushOnAstStack(tok);
  }

  protected void consumePseudoTokenIf() {
    //this.display();
    Expression expr = (Expression) expressionStack[expressionPtr--];
    expressionLengthPtr--;
    println("expr: " + expr);

    int start = intStack[intPtr--];
    ASTNode tok = declarationFactory.createIfPseudoToken(this, expr);
View Full Code Here

  boolean inBlockThatCantRun = false;

  public boolean visit(MessageSend call, BlockScope scope) {
    ContextToken tok = CompilationAndWeavingContext.enteringPhase(
        CompilationAndWeavingContext.OPTIMIZING_THIS_JOIN_POINT_CALLS, call.selector);
    Expression receiver = call.receiver;
    if (isRef(receiver, thisJoinPointDec)) {
      if (canTreatAsStatic(new String(call.selector))) {
        if (replaceEffectivelyStaticRefs) {
          replaceEffectivelyStaticRef(call);
        } else {
View Full Code Here

//


  //  checkInvocationArguments(scope, this.receiver, this.actualReceiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this);
    for (int i=0, len=arguments.length; i < len; i++) {
      Expression arg = arguments[i];
      TypeBinding argType = arg.resolveType(scope);
      if (argType != null) {
        TypeBinding paramType = binding.parameters[i];
        if (!argType.isCompatibleWith(paramType)) {
          scope.problemReporter().typeMismatchError(argType, paramType, arg);
        }
View Full Code Here

      if (i >= (explicitConstructorCall.arguments == null ? 0 : explicitConstructorCall.arguments.length)) {
        init.expressions[index++] = new NullLiteral(0, 0);
        continue;
      }

      Expression arg = explicitConstructorCall.arguments[i];
      ResolvedMember conversionMethod = AjcMemberMaker.toObjectConversionMethod(world
          .fromBinding(explicitConstructorCall.binding.parameters[i]));
      if (conversionMethod != null) {
        arg = new KnownMessageSend(world.makeMethodBindingForCall(conversionMethod), new CastExpression(new NullLiteral(0,
            0), AstUtil.makeTypeReference(world.makeTypeBinding(AjcMemberMaker.CONVERSIONS_TYPE))),
            new Expression[] { arg });
      }
      init.expressions[index++] = arg;
    }

    for (int i = 0; i < nParams; i++) {
      LocalVariableBinding binding = pre.arguments[i].binding;
      Expression arg = AstUtil.makeResolvedLocalVariableReference(binding);
      ResolvedMember conversionMethod = AjcMemberMaker.toObjectConversionMethod(world.fromBinding(binding.type));
      if (conversionMethod != null) {
        arg = new KnownMessageSend(world.makeMethodBindingForCall(conversionMethod), new CastExpression(new NullLiteral(0,
            0), AstUtil.makeTypeReference(world.makeTypeBinding(AjcMemberMaker.CONVERSIONS_TYPE))),
            new Expression[] { arg });
View Full Code Here

  //        }

  boolean inBlockThatCantRun = false;

  public boolean visit(MessageSend call, BlockScope scope) {
    Expression receiver = call.receiver;
    if (isRef(receiver, thisJoinPointDec)) {
      if (canTreatAsStatic(new String(call.selector))) {
        if (replaceEffectivelyStaticRefs) {
          replaceEffectivelyStaticRef(call);
        } else {
View Full Code Here

    long[] positions = new long[] {pos,pos,pos,pos,pos};
    TypeReference orgAspectJLangAnnotationAspect = new QualifiedTypeReference(typeName,positions);
    NormalAnnotation atAspectAnnotation = new NormalAnnotation(orgAspectJLangAnnotationAspect,pos);
    if (!perclause.equals("")) {
      // we have to set the value
      Expression perclauseExpr = new StringLiteral(perclause.toCharArray(),pos,pos,1);
      MemberValuePair[] mvps = new MemberValuePair[1];
      mvps[0] = new MemberValuePair(value,pos,pos,perclauseExpr);
      atAspectAnnotation.memberValuePairs = mvps;
    }
    return atAspectAnnotation;
View Full Code Here

  public static Annotation createBeforeAnnotation(String pointcutExpression, String argNames, int pos) {
    char[][] typeName = new char[][] {org,aspectj,lang,annotation,before};
    long[] positions = new long[] {pos,pos,pos,pos,pos};
    TypeReference annType = new QualifiedTypeReference(typeName,positions);
    NormalAnnotation ann = new NormalAnnotation(annType,pos);
    Expression pcExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos,1);
    MemberValuePair[] mvps = new MemberValuePair[2];
    mvps[0] = new MemberValuePair("value".toCharArray(),pos,pos,pcExpr);
    Expression argNamesExpr = new StringLiteral(argNames.toCharArray(),pos,pos,1);
    mvps[1] = new MemberValuePair("argNames".toCharArray(),pos,pos,argNamesExpr);
    ann.memberValuePairs = mvps;
    return ann;
  }
View Full Code Here

  public static Annotation createAfterAnnotation(String pointcutExpression, String argNames, int pos) {
    char[][] typeName = new char[][] {org,aspectj,lang,annotation,after};
    long[] positions = new long[] {pos,pos,pos,pos,pos};
    TypeReference annType = new QualifiedTypeReference(typeName,positions);
    NormalAnnotation ann = new NormalAnnotation(annType,pos);
    Expression pcExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos,1);
    MemberValuePair[] mvps = new MemberValuePair[2];
    mvps[0] = new MemberValuePair("value".toCharArray(),pos,pos,pcExpr);
    Expression argNamesExpr = new StringLiteral(argNames.toCharArray(),pos,pos,1);
    mvps[1] = new MemberValuePair("argNames".toCharArray(),pos,pos,argNamesExpr);
    ann.memberValuePairs = mvps;
    return ann;
  }
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression

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.