Class ComparisonOperation
java.lang.Object
org.benf.cfr.reader.bytecode.analysis.parse.expression.AbstractExpression
org.benf.cfr.reader.bytecode.analysis.parse.expression.ComparisonOperation
- All Implemented Interfaces:
HasByteCodeLoc
,Expression
,ConditionalExpression
,BoxingProcessor
,DeepCloneable<Expression>
,ComparableUnderEC
,Dumpable
,DumpableWithPrecedence
,TypeUsageCollectable
public class ComparisonOperation
extends AbstractExpression
implements ConditionalExpression, BoxingProcessor
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private Expression
private final CompOp
private Expression
-
Constructor Summary
ConstructorsConstructorDescriptionComparisonOperation
(BytecodeLoc loc, Expression lhs, Expression rhs, CompOp op) ComparisonOperation
(BytecodeLoc loc, Expression lhs, Expression rhs, CompOp op, boolean canNegate) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addIfLValue
(Expression expression, Set<LValue> res) applyExpressionRewriter
(ExpressionRewriter expressionRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) void
applyNonArgExpressionRewriter
(ExpressionRewriter expressionRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) applyReverseExpressionRewriter
(ExpressionRewriter expressionRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) boolean
canThrow
(ExceptionCheck caught) void
collectTypeUsages
(TypeUsageCollector collector) void
collectUsedLValues
(LValueUsageCollector lValueUsageCollector) deepClone
(CloneHelper cloneHelper) boolean
final boolean
equivalentUnder
(Object o, EquivalenceConstraint constraint) getComputedLiteral
(Map<LValue, Literal> display) private ConditionalExpression
getConditionalExpression
(Expression booleanExpression, ComparisonOperation.BooleanComparisonType booleanComparisonType) getDemorganApplied
(boolean amNegating) getLhs()
getOp()
getRhs()
int
getSize
(Precedence outerPrecedence) private static ComparisonOperation.BooleanComparisonType
isBooleanComparison
(Expression a, Expression b, CompOp op) replaceSingleUsageLValues
(LValueRewriter lValueRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer) boolean
rewriteBoxing
(PrimitiveBoxingRewriter boxingRewriter) simplify()
Methods inherited from class org.benf.cfr.reader.bytecode.analysis.parse.expression.AbstractExpression
addLoc, canPushDownInto, dump, dumpWithOuterPrecedence, getInferredJavaType, getLoc, isSimple, isValidStatement, outerDeepClone, pushDown, toString, visit
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.benf.cfr.reader.bytecode.analysis.parse.rewriters.DeepCloneable
outerDeepClone
Methods inherited from interface org.benf.cfr.reader.util.output.DumpableWithPrecedence
dumpWithOuterPrecedence
Methods inherited from interface org.benf.cfr.reader.bytecode.analysis.parse.Expression
canPushDownInto, dump, getInferredJavaType, isSimple, isValidStatement, pushDown, visit
Methods inherited from interface org.benf.cfr.reader.bytecode.analysis.loc.HasByteCodeLoc
addLoc, getLoc
-
Field Details
-
lhs
-
rhs
-
op
-
canNegate
private final boolean canNegate
-
-
Constructor Details
-
ComparisonOperation
-
ComparisonOperation
public ComparisonOperation(BytecodeLoc loc, Expression lhs, Expression rhs, CompOp op, boolean canNegate)
-
-
Method Details
-
deepClone
- Specified by:
deepClone
in interfaceDeepCloneable<Expression>
-
getCombinedLoc
- Specified by:
getCombinedLoc
in interfaceHasByteCodeLoc
-
collectTypeUsages
- Specified by:
collectTypeUsages
in interfaceTypeUsageCollectable
- Overrides:
collectTypeUsages
in classAbstractExpression
-
getSize
- Specified by:
getSize
in interfaceConditionalExpression
-
getPrecedence
- Specified by:
getPrecedence
in interfaceDumpableWithPrecedence
- Specified by:
getPrecedence
in classAbstractExpression
-
dumpInner
- Specified by:
dumpInner
in classAbstractExpression
-
replaceSingleUsageLValues
public Expression replaceSingleUsageLValues(LValueRewriter lValueRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer) - Specified by:
replaceSingleUsageLValues
in interfaceExpression
-
applyExpressionRewriter
public Expression applyExpressionRewriter(ExpressionRewriter expressionRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) - Specified by:
applyExpressionRewriter
in interfaceExpression
-
applyReverseExpressionRewriter
public Expression applyReverseExpressionRewriter(ExpressionRewriter expressionRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) - Specified by:
applyReverseExpressionRewriter
in interfaceExpression
-
getNegated
- Specified by:
getNegated
in interfaceConditionalExpression
-
getOp
-
getDemorganApplied
- Specified by:
getDemorganApplied
in interfaceConditionalExpression
-
getRightDeep
- Specified by:
getRightDeep
in interfaceConditionalExpression
-
addIfLValue
-
getLoopLValues
- Specified by:
getLoopLValues
in interfaceConditionalExpression
-
collectUsedLValues
- Specified by:
collectUsedLValues
in interfaceExpression
-
isBooleanComparison
private static ComparisonOperation.BooleanComparisonType isBooleanComparison(Expression a, Expression b, CompOp op) -
getConditionalExpression
private ConditionalExpression getConditionalExpression(Expression booleanExpression, ComparisonOperation.BooleanComparisonType booleanComparisonType) -
optimiseForType
- Specified by:
optimiseForType
in interfaceConditionalExpression
-
getLhs
-
getRhs
-
simplify
- Specified by:
simplify
in interfaceConditionalExpression
-
rewriteBoxing
- Specified by:
rewriteBoxing
in interfaceBoxingProcessor
-
applyNonArgExpressionRewriter
public void applyNonArgExpressionRewriter(ExpressionRewriter expressionRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) - Specified by:
applyNonArgExpressionRewriter
in interfaceBoxingProcessor
-
equals
- Specified by:
equals
in classAbstractExpression
-
canThrow
- Specified by:
canThrow
in interfaceExpression
- Overrides:
canThrow
in classAbstractExpression
-
equivalentUnder
- Specified by:
equivalentUnder
in interfaceComparableUnderEC
- Specified by:
equivalentUnder
in interfaceExpression
-
getComputedLiteral
- Specified by:
getComputedLiteral
in interfaceExpression
- Overrides:
getComputedLiteral
in classAbstractExpression
-