|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttip.analysis.QuestionAnswerAdapter<Node,java.lang.Boolean>
tip.util.ExpressionEqualitor.ExpressionEquality
static class ExpressionEqualitor.ExpressionEquality
ExpressionEquality
is an instance of the
QuestionAnswer
interface taking question of the type
Node
and returning answers of the type Boolean
. The class
determines equality of expressions to use for the
ExpressionEqualitor
.
AFunctionCallExp
nodes are regarded as equal on a node basis
since the result of the expression may vary if sideeffects occur.
AFunctionPtrCallExp
and ADerefExp
nodes are regarded as
equal on a node basis since the target value may change through (other)
pointer manipulating operations.
AMallocExp
and AInputExp
nodes as equal on a node basis
since the values of the expressions are (potentially) different for each
occurence.
Constructor Summary | |
---|---|
ExpressionEqualitor.ExpressionEquality()
|
Method Summary | |
---|---|
java.lang.Boolean |
caseABinopExp(ABinopExp a,
Node b)
Returns true if b is an ABinopExp which is
equal to a according to this equalitor. |
java.lang.Boolean |
caseAIntConstExp(AIntConstExp a,
Node b)
Returns true if b is an AIntConstExp which is
equal to a according to this equalitor. |
java.lang.Boolean |
caseANullExp(ANullExp a,
Node b)
Returns true if b is an ANullExp which is
equal to a according to this equalitor. |
java.lang.Boolean |
caseAPointerExp(APointerExp a,
Node b)
Returns true if b is an APointerExp which is
equal to a according to this equalitor. |
java.lang.Boolean |
caseAVarExp(AVarExp a,
Node b)
Returns true if b is an AVarExp which is
equal to a according to this equalitor. |
java.lang.Boolean |
defaultNode(Node a,
Node b)
Returns false as the default result of equality of the two
arbitrary nodes a and b . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
ExpressionEqualitor.ExpressionEquality()
Method Detail |
---|
public java.lang.Boolean defaultNode(Node a, Node b)
false
as the default result of equality of the two
arbitrary nodes a
and b
.
defaultNode
in class QuestionAnswerAdapter<Node,java.lang.Boolean>
a
- the first nodeb
- the second node
false
as the default resultpublic java.lang.Boolean caseABinopExp(ABinopExp a, Node b)
true
if b
is an ABinopExp
which is
equal to a
according to this equalitor. Two binary
expressions are equal if the arguments and operand are equal taking
the commutativity of the operand into account.
caseABinopExp
in interface QuestionAnswer<Node,java.lang.Boolean>
caseABinopExp
in class QuestionAnswerAdapter<Node,java.lang.Boolean>
a
- the binary expressionb
- the node tested for equality against a
true
if b
represents the same binary
expressionpublic java.lang.Boolean caseAPointerExp(APointerExp a, Node b)
true
if b
is an APointerExp
which is
equal to a
according to this equalitor. Two pointer
expressions are equal if the variables are the same. This is only
safe as long as the addresses of the variables are static, and is
thus not an appropriate equality for analyses computing flow through
pointer variables.
caseAPointerExp
in interface QuestionAnswer<Node,java.lang.Boolean>
caseAPointerExp
in class QuestionAnswerAdapter<Node,java.lang.Boolean>
a
- the pointer expressionb
- the node tested for equality against a
true
if b
represents the same pointer
expressionpublic java.lang.Boolean caseAIntConstExp(AIntConstExp a, Node b)
true
if b
is an AIntConstExp
which is
equal to a
according to this equalitor. Two constant
expressions are equal if the constant values are equal.
caseAIntConstExp
in interface QuestionAnswer<Node,java.lang.Boolean>
caseAIntConstExp
in class QuestionAnswerAdapter<Node,java.lang.Boolean>
a
- the constant expressionb
- the node tested for equality against a
true
if b
represents the same contanst
expressionpublic java.lang.Boolean caseAVarExp(AVarExp a, Node b)
true
if b
is an AVarExp
which is
equal to a
according to this equalitor. Two variable
expressions are equal if the variables are the same.
caseAVarExp
in interface QuestionAnswer<Node,java.lang.Boolean>
caseAVarExp
in class QuestionAnswerAdapter<Node,java.lang.Boolean>
a
- the variable expressionb
- the node tested for equality against a
true
if b
represents the same variable
expressionpublic java.lang.Boolean caseANullExp(ANullExp a, Node b)
true
if b
is an ANullExp
which is
equal to a
according to this equalitor. Two null expressions
are always equal.
caseANullExp
in interface QuestionAnswer<Node,java.lang.Boolean>
caseANullExp
in class QuestionAnswerAdapter<Node,java.lang.Boolean>
a
- the binary expressionb
- the node tested for equality against a
true
if b
represents the same binary
expression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |