Class UnaryExpression

All Implemented Interfaces:
OperatorIds, TypeConstants, TypeIds

public class UnaryExpression extends OperatorExpression
  • Field Details

    • expression

      public Expression expression
    • optimizedBooleanConstant

      public Constant optimizedBooleanConstant
  • Constructor Details

    • UnaryExpression

      public UnaryExpression(Expression expression, int operator)
  • Method Details

    • analyseCode

      public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo)
      Overrides:
      analyseCode in class Expression
    • updateFlowOnBooleanResult

      protected void updateFlowOnBooleanResult(FlowInfo flowInfo, boolean result)
      Description copied from class: Expression
      Back-propagation of flow info: before analysing a branch where a given condition is known to hold true/false respectively, ask the condition to contribute its information to the given flowInfo.
      Overrides:
      updateFlowOnBooleanResult in class Expression
      Parameters:
      flowInfo - the info to be used for analysing the branch
      result - condition result that would cause entering the branch
    • optimizedBooleanConstant

      public Constant optimizedBooleanConstant()
      Description copied from class: Expression
      Constant usable for bytecode pattern optimizations, but cannot be inlined since it is not strictly equivalent to the definition of constant expressions. In particular, some side-effects may be required to occur (only the end value is known).
      Overrides:
      optimizedBooleanConstant in class Expression
      Returns:
      Constant known to be of boolean type
    • generateCode

      public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired)
      Code generation for an unary operation
      Overrides:
      generateCode in class Expression
      Parameters:
      currentScope - org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope
      codeStream - org.aspectj.org.eclipse.jdt.internal.compiler.codegen.CodeStream
      valueRequired - boolean
    • generateOptimizedBoolean

      public void generateOptimizedBoolean(BlockScope currentScope, CodeStream codeStream, BranchLabel trueLabel, BranchLabel falseLabel, boolean valueRequired)
      Boolean operator code generation Optimized operations are: &&, ||, <, <=, >, >=, &, |, ^
      Overrides:
      generateOptimizedBoolean in class Expression
    • printExpressionNoParenthesis

      public StringBuffer printExpressionNoParenthesis(int indent, StringBuffer output)
      Specified by:
      printExpressionNoParenthesis in class OperatorExpression
    • collectPatternVariablesToScope

      public void collectPatternVariablesToScope(LocalVariableBinding[] variables, BlockScope scope)
      Overrides:
      collectPatternVariablesToScope in class Expression
    • resolveType

      public TypeBinding resolveType(BlockScope scope)
      Description copied from class: Expression
      Resolve the type of this expression in the context of a blockScope
      Overrides:
      resolveType in class Expression
      Returns:
      Return the actual type of this expression after resolution
    • containsPatternVariable

      public boolean containsPatternVariable()
      Overrides:
      containsPatternVariable in class Statement
    • getPatternVariableIntroduced

      public LocalDeclaration getPatternVariableIntroduced()
      Overrides:
      getPatternVariableIntroduced in class Expression
    • traverse

      public void traverse(ASTVisitor visitor, BlockScope blockScope)
      Description copied from class: Expression
      Traverse an expression in the context of a blockScope
      Overrides:
      traverse in class Expression