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

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant


    }
  } else {
    boolean isStatic = this.codegenBinding.isStatic();
    this.receiver.generateCode(currentScope, codeStream, !isStatic);
    if (valueRequired) {
      Constant fieldConstant = this.codegenBinding.constant();
      if (fieldConstant == Constant.NotAConstant) {
        if (this.codegenBinding.declaringClass == null) { // array length
          codeStream.arraylength();
        } else {
          if (this.codegenBinding.canBeSeenBy(this.receiverType, this, currentScope)) {
View Full Code Here


    if (valueRequired) {
      if (lastFieldBinding.declaringClass == null) { // array length
        codeStream.arraylength();
        codeStream.generateImplicitConversion(this.implicitConversion);
      } else {
        Constant fieldConstant = lastFieldBinding.constant();
        if (fieldConstant != Constant.NotAConstant) {
          if (!lastFieldBinding.isStatic()){
            codeStream.invokeObjectGetClass();
            codeStream.pop();
          }
View Full Code Here

      break;
    case Binding.LOCAL : // reading the first local variable
      if (!needValue) break; // no value needed
      LocalVariableBinding localBinding = (LocalVariableBinding) this.codegenBinding;
      // regular local variable read
      Constant localConstant = localBinding.constant();
      if (localConstant != Constant.NotAConstant) {
        codeStream.generateConstant(localConstant, 0);
        // no implicit conversion
      } else {
        // outer local?
        if ((bits & DepthMASK) != 0) {
          // outer local can be reached either through a synthetic arg or a synthetic field
          VariableBinding[] path = currentScope.getEmulationPath(localBinding);
          codeStream.generateOuterAccess(path, this, localBinding, currentScope);
        } else {
          codeStream.load(localBinding);
        }
      }
  }

  // all intermediate field accesses are read accesses
  // only the last field binding is a write access
  if (this.otherCodegenBindings != null) {
    for (int i = 0; i < otherBindingsCount; i++) {
      FieldBinding nextField = this.otherCodegenBindings[i];
      TypeBinding nextGenericCast = this.otherGenericCasts == null ? null : this.otherGenericCasts[i];
      if (lastFieldBinding != null) {
        needValue = !nextField.isStatic();
        if (needValue) {
          if (lastFieldBinding.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) {
            Constant fieldConstant = lastFieldBinding.constant();
            if (fieldConstant != Constant.NotAConstant) {
              if (lastFieldBinding != this.codegenBinding && !lastFieldBinding.isStatic()) {
                codeStream.invokeObjectGetClass(); // perform null check
                codeStream.pop();
              }
View Full Code Here

      boolean valueRequired) {

    // a label valued to nil means: by default we fall through the case...
    // both nil means we leave the value on the stack

    Constant cst = this.optimizedBooleanConstant();
    generateCode(currentScope, codeStream, valueRequired && cst == Constant.NotAConstant);
    if ((cst != Constant.NotAConstant) && (cst.typeID() == TypeIds.T_boolean)) {
      int pc = codeStream.position;
      if (cst.booleanValue() == true) {
        // constant == true
        if (valueRequired) {
          if (falseLabel == null) {
            // implicit falling through the FALSE case
            if (trueLabel != null) {
View Full Code Here

  if (!CharOperation.equals(currentFieldInfo.getTypeName(), otherFieldInfo.getTypeName()))
    return true;
  if (currentFieldInfo.hasConstant() != otherFieldInfo.hasConstant())
    return true;
  if (currentFieldInfo.hasConstant()) {
    Constant currentConstant = currentFieldInfo.getConstant();
    Constant otherConstant = otherFieldInfo.getConstant();
    if (currentConstant.typeID() != otherConstant.typeID())
      return true;
    if (!currentConstant.getClass().equals(otherConstant.getClass()))
      return true;
    switch (currentConstant.typeID()) {
      case TypeIds.T_int :
        return currentConstant.intValue() != otherConstant.intValue();
      case TypeIds.T_byte :
        return currentConstant.byteValue() != otherConstant.byteValue();
      case TypeIds.T_short :
        return currentConstant.shortValue() != otherConstant.shortValue();
      case TypeIds.T_char :
        return currentConstant.charValue() != otherConstant.charValue();
      case TypeIds.T_long :
        return currentConstant.longValue() != otherConstant.longValue();
      case TypeIds.T_float :
        return currentConstant.floatValue() != otherConstant.floatValue();
      case TypeIds.T_double :
        return currentConstant.doubleValue() != otherConstant.doubleValue();
      case TypeIds.T_boolean :
        return currentConstant.booleanValue() != otherConstant.booleanValue();
      case TypeIds.T_JavaLangString :
        return !currentConstant.stringValue().equals(otherConstant.stringValue());
    }
  }
  return false;
}
View Full Code Here

    final int numberOfParens = (doubleLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
    if (numberOfParens > 0) {
      manageOpeningParenthesizedExpression(doubleLiteral, numberOfParens);
    }
    Constant constant = doubleLiteral.constant;
    if (constant != null && constant.doubleValue() < 0) {
      this.scribe.printNextToken(TerminalTokens.TokenNameMINUS);     
    }
    this.scribe.printNextToken(TerminalTokens.TokenNameDoubleLiteral);

    if (numberOfParens > 0) {
View Full Code Here

    final int numberOfParens = (floatLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
    if (numberOfParens > 0) {
      manageOpeningParenthesizedExpression(floatLiteral, numberOfParens);
    }
    Constant constant = floatLiteral.constant;
    if (constant != null && floatLiteral.constant.floatValue() < 0) {
      this.scribe.printNextToken(TerminalTokens.TokenNameMINUS);     
    }
    this.scribe.printNextToken(TerminalTokens.TokenNameFloatingPointLiteral);
View Full Code Here

    final int numberOfParens = (intLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
    if (numberOfParens > 0) {
      manageOpeningParenthesizedExpression(intLiteral, numberOfParens);
    }
    Constant constant = intLiteral.constant;
    if (constant != null && constant.intValue() < 0) {
      this.scribe.printNextToken(TerminalTokens.TokenNameMINUS);     
    }
    this.scribe.printNextToken(TerminalTokens.TokenNameIntegerLiteral);

    if (numberOfParens > 0) {
View Full Code Here

    final int numberOfParens = (longLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
    if (numberOfParens > 0) {
      manageOpeningParenthesizedExpression(longLiteral, numberOfParens);
    }
    Constant constant = longLiteral.constant;
    if (constant != null && constant.longValue() < 0) {
      this.scribe.printNextToken(TerminalTokens.TokenNameMINUS);     
    }
    this.scribe.printNextToken(TerminalTokens.TokenNameLongLiteral);

    if (numberOfParens > 0) {
View Full Code Here

    FlowContext flowContext,
    FlowInfo flowInfo) {
     
    preAssertInitStateIndex = currentScope.methodScope().recordInitializationStates(flowInfo);

    Constant cst = this.assertExpression.optimizedBooleanConstant();   
    boolean isOptimizedTrueAssertion = cst != Constant.NotAConstant && cst.booleanValue() == true;
    boolean isOptimizedFalseAssertion = cst != Constant.NotAConstant && cst.booleanValue() == false;

    FlowInfo assertRawInfo = assertExpression.
      analyseCode(currentScope, flowContext, flowInfo.copy());
    UnconditionalFlowInfo assertWhenTrueInfo = assertRawInfo.initsWhenTrue().
      unconditionalInits();
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant

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.