Class ArithmeticOperation
- java.lang.Object
-
- org.benf.cfr.reader.bytecode.analysis.parse.expression.AbstractExpression
-
- org.benf.cfr.reader.bytecode.analysis.parse.expression.ArithmeticOperation
-
- All Implemented Interfaces:
HasByteCodeLoc
,Expression
,BoxingProcessor
,DeepCloneable<Expression>
,ComparableUnderEC
,Dumpable
,DumpableWithPrecedence
,TypeUsageCollectable
public class ArithmeticOperation extends AbstractExpression implements BoxingProcessor
-
-
Field Summary
Fields Modifier and Type Field Description private Expression
lhs
private ArithOp
op
private Expression
rhs
-
Constructor Summary
Constructors Constructor Description ArithmeticOperation(BytecodeLoc loc, Expression lhs, Expression rhs, ArithOp op)
ArithmeticOperation(BytecodeLoc loc, InferredJavaType knownType, Expression lhs, Expression rhs, ArithOp op)
-
Method Summary
-
Methods inherited from class org.benf.cfr.reader.bytecode.analysis.parse.expression.AbstractExpression
addLoc, dump, dumpWithOuterPrecedence, getInferredJavaType, getLoc, isSimple, isValidStatement, outerDeepClone, toString
-
-
-
-
Field Detail
-
lhs
private Expression lhs
-
rhs
private Expression rhs
-
op
private final ArithOp op
-
-
Constructor Detail
-
ArithmeticOperation
public ArithmeticOperation(BytecodeLoc loc, Expression lhs, Expression rhs, ArithOp op)
-
ArithmeticOperation
public ArithmeticOperation(BytecodeLoc loc, InferredJavaType knownType, Expression lhs, Expression rhs, ArithOp op)
-
-
Method Detail
-
getCombinedLoc
public BytecodeLoc getCombinedLoc()
- Specified by:
getCombinedLoc
in interfaceHasByteCodeLoc
-
collectTypeUsages
public void collectTypeUsages(TypeUsageCollector collector)
- Specified by:
collectTypeUsages
in interfaceTypeUsageCollectable
- Overrides:
collectTypeUsages
in classAbstractExpression
-
deepClone
public Expression deepClone(CloneHelper cloneHelper)
- Specified by:
deepClone
in interfaceDeepCloneable<Expression>
-
inferredType
private static InferredJavaType inferredType(InferredJavaType a, InferredJavaType b, ArithOp op)
-
getPrecedence
public Precedence getPrecedence()
- Specified by:
getPrecedence
in interfaceDumpableWithPrecedence
- Specified by:
getPrecedence
in classAbstractExpression
-
dumpInner
public Dumper dumpInner(Dumper d)
- Specified by:
dumpInner
in classAbstractExpression
-
getComputedLiteral
public Literal getComputedLiteral(java.util.Map<LValue,Literal> display)
- Specified by:
getComputedLiteral
in interfaceExpression
- Overrides:
getComputedLiteral
in classAbstractExpression
-
isLValueExprFor
private boolean isLValueExprFor(LValueExpression expression, LValue lValue)
-
isLiteralFunctionOf
public boolean isLiteralFunctionOf(LValue lValue)
-
isXorM1
public boolean isXorM1()
-
getReplacementXorM1
public Expression getReplacementXorM1()
-
isMutationOf
public boolean isMutationOf(LValue lValue)
-
getMutationOf
public AbstractMutatingAssignmentExpression getMutationOf(LValue lValue)
-
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
-
collectUsedLValues
public void collectUsedLValues(LValueUsageCollector lValueUsageCollector)
- Specified by:
collectUsedLValues
in interfaceExpression
-
canPushDownInto
public boolean canPushDownInto()
- Specified by:
canPushDownInto
in interfaceExpression
- Overrides:
canPushDownInto
in classAbstractExpression
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equals
in classAbstractExpression
-
equivalentUnder
public final boolean equivalentUnder(java.lang.Object o, EquivalenceConstraint constraint)
- Specified by:
equivalentUnder
in interfaceComparableUnderEC
- Specified by:
equivalentUnder
in interfaceExpression
-
returnsTrueForNaN
private static boolean returnsTrueForNaN(CompOp from, int on, boolean nanG)
-
canNegateAroundNaN
private static boolean canNegateAroundNaN(CompOp from, int on)
-
canThrow
public boolean canThrow(ExceptionCheck caught)
- Specified by:
canThrow
in interfaceExpression
- Overrides:
canThrow
in classAbstractExpression
-
rewriteBoxing
public boolean rewriteBoxing(PrimitiveBoxingRewriter boxingRewriter)
- Specified by:
rewriteBoxing
in interfaceBoxingProcessor
-
applyNonArgExpressionRewriter
public void applyNonArgExpressionRewriter(ExpressionRewriter expressionRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags)
- Specified by:
applyNonArgExpressionRewriter
in interfaceBoxingProcessor
-
getLhs
public Expression getLhs()
-
getRhs
public Expression getRhs()
-
getOp
public ArithOp getOp()
-
visit
public <T> T visit(ExpressionVisitor<T> visitor)
- Specified by:
visit
in interfaceExpression
- Overrides:
visit
in classAbstractExpression
-
pushDown
public Expression pushDown(Expression toPush, Expression parent)
- Specified by:
pushDown
in interfaceExpression
- Overrides:
pushDown
in classAbstractExpression
-
-