Class BinaryExpression

java.lang.Object
com.strobel.expressions.Expression
com.strobel.expressions.BinaryExpression
Direct Known Subclasses:
AssignBinaryExpression, CoalesceConversionBinaryExpression, CompareMethodBasedLogicalBinaryExpression, EqualsMethodBasedLogicalBinaryExpression, LogicalBinaryExpression, SimpleBinaryExpression

public class BinaryExpression extends Expression
  • Field Details

  • Constructor Details

  • Method Details

    • getRight

      public final Expression getRight()
    • getLeft

      public final Expression getLeft()
    • getMethod

      public MethodInfo getMethod()
    • getConversion

      public LambdaExpression<?> getConversion()
    • canReduce

      public boolean canReduce()
      Description copied from class: Expression
      Indicates that the node can be reduced to a simpler node. If this returns true, reduce() can be called to produce the reduced form.
      Overrides:
      canReduce in class Expression
      Returns:
      true if the node can be reduced; otherwise, false.
    • accept

      protected Expression accept(ExpressionVisitor visitor)
      Description copied from class: Expression
      Dispatches to the specific visit method for this node type. For example, BinaryExpression will call into ExpressionVisitor.visitBinary().
      Overrides:
      accept in class Expression
      Parameters:
      visitor - the visitor to visit this node.
      Returns:
      the result of visiting this node.
    • reduce

      public Expression reduce()
      Description copied from class: Expression
      Reduces this node to a simpler expression. If canReduce() returns true, this should return a valid expression. This method is allowed to return another node which itself must be reduced.
      Overrides:
      reduce in class Expression
      Returns:
      the reduced expression.
    • create

      static Expression create(ExpressionType nodeType, Expression left, Expression right, Type type, MethodInfo method, LambdaExpression<?> conversion)
    • update

      public BinaryExpression update(Expression left, LambdaExpression<?> conversion, Expression right)
    • isReferenceComparison

      boolean isReferenceComparison()
    • reduceVariable

      private Expression reduceVariable()
    • reduceMember

      private Expression reduceMember()
    • isOpAssignment

      private static boolean isOpAssignment(ExpressionType operation)
    • getBinaryOpFromAssignmentOp

      private static ExpressionType getBinaryOpFromAssignmentOp(ExpressionType operator)