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 Modifier and Type Class Description private static classComparisonOperation.BooleanComparisonType
-
Field Summary
Fields Modifier and Type Field Description private booleancanNegateprivate Expressionlhsprivate CompOpopprivate Expressionrhs
-
Constructor Summary
Constructors Constructor Description ComparisonOperation(BytecodeLoc loc, Expression lhs, Expression rhs, CompOp op)ComparisonOperation(BytecodeLoc loc, Expression lhs, Expression rhs, CompOp op, boolean canNegate)
-
Method Summary
-
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 Detail
-
lhs
private Expression lhs
-
rhs
private Expression rhs
-
op
private final CompOp op
-
canNegate
private final boolean canNegate
-
-
Constructor Detail
-
ComparisonOperation
public ComparisonOperation(BytecodeLoc loc, Expression lhs, Expression rhs, CompOp op)
-
ComparisonOperation
public ComparisonOperation(BytecodeLoc loc, Expression lhs, Expression rhs, CompOp op, boolean canNegate)
-
-
Method Detail
-
deepClone
public Expression deepClone(CloneHelper cloneHelper)
- Specified by:
deepClonein interfaceDeepCloneable<Expression>
-
getCombinedLoc
public BytecodeLoc getCombinedLoc()
- Specified by:
getCombinedLocin interfaceHasByteCodeLoc
-
collectTypeUsages
public void collectTypeUsages(TypeUsageCollector collector)
- Specified by:
collectTypeUsagesin interfaceTypeUsageCollectable- Overrides:
collectTypeUsagesin classAbstractExpression
-
getSize
public int getSize(Precedence outerPrecedence)
- Specified by:
getSizein interfaceConditionalExpression
-
getPrecedence
public Precedence getPrecedence()
- Specified by:
getPrecedencein interfaceDumpableWithPrecedence- Specified by:
getPrecedencein classAbstractExpression
-
dumpInner
public Dumper dumpInner(Dumper d)
- Specified by:
dumpInnerin classAbstractExpression
-
replaceSingleUsageLValues
public Expression replaceSingleUsageLValues(LValueRewriter lValueRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer)
- Specified by:
replaceSingleUsageLValuesin interfaceExpression
-
applyExpressionRewriter
public Expression applyExpressionRewriter(ExpressionRewriter expressionRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags)
- Specified by:
applyExpressionRewriterin interfaceExpression
-
applyReverseExpressionRewriter
public Expression applyReverseExpressionRewriter(ExpressionRewriter expressionRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags)
- Specified by:
applyReverseExpressionRewriterin interfaceExpression
-
getNegated
public ConditionalExpression getNegated()
- Specified by:
getNegatedin interfaceConditionalExpression
-
getOp
public CompOp getOp()
-
getDemorganApplied
public ConditionalExpression getDemorganApplied(boolean amNegating)
- Specified by:
getDemorganAppliedin interfaceConditionalExpression
-
getRightDeep
public ConditionalExpression getRightDeep()
- Specified by:
getRightDeepin interfaceConditionalExpression
-
addIfLValue
private void addIfLValue(Expression expression, java.util.Set<LValue> res)
-
getLoopLValues
public java.util.Set<LValue> getLoopLValues()
- Specified by:
getLoopLValuesin interfaceConditionalExpression
-
collectUsedLValues
public void collectUsedLValues(LValueUsageCollector lValueUsageCollector)
- Specified by:
collectUsedLValuesin interfaceExpression
-
isBooleanComparison
private static ComparisonOperation.BooleanComparisonType isBooleanComparison(Expression a, Expression b, CompOp op)
-
getConditionalExpression
private ConditionalExpression getConditionalExpression(Expression booleanExpression, ComparisonOperation.BooleanComparisonType booleanComparisonType)
-
optimiseForType
public ConditionalExpression optimiseForType()
- Specified by:
optimiseForTypein interfaceConditionalExpression
-
getLhs
public Expression getLhs()
-
getRhs
public Expression getRhs()
-
simplify
public ConditionalExpression simplify()
- Specified by:
simplifyin interfaceConditionalExpression
-
rewriteBoxing
public boolean rewriteBoxing(PrimitiveBoxingRewriter boxingRewriter)
- Specified by:
rewriteBoxingin interfaceBoxingProcessor
-
applyNonArgExpressionRewriter
public void applyNonArgExpressionRewriter(ExpressionRewriter expressionRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags)
- Specified by:
applyNonArgExpressionRewriterin interfaceBoxingProcessor
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equalsin classAbstractExpression
-
canThrow
public boolean canThrow(ExceptionCheck caught)
- Specified by:
canThrowin interfaceExpression- Overrides:
canThrowin classAbstractExpression
-
equivalentUnder
public final boolean equivalentUnder(java.lang.Object o, EquivalenceConstraint constraint)- Specified by:
equivalentUnderin interfaceComparableUnderEC- Specified by:
equivalentUnderin interfaceExpression
-
getComputedLiteral
public Literal getComputedLiteral(java.util.Map<LValue,Literal> display)
- Specified by:
getComputedLiteralin interfaceExpression- Overrides:
getComputedLiteralin classAbstractExpression
-
-