Class Assignment
- java.lang.Object
-
- it.unive.lisa.program.cfg.statement.Statement
-
- it.unive.lisa.program.cfg.statement.Expression
-
- it.unive.lisa.program.cfg.statement.NaryExpression
-
- it.unive.lisa.program.cfg.statement.BinaryExpression
-
- it.unive.lisa.program.cfg.statement.Assignment
-
- All Implemented Interfaces:
ProgramPoint
,CodeElement
,CodeNode<CFG,Statement,Edge>
,Node<CFG,Statement,Edge>
,java.lang.Comparable<Statement>
public class Assignment extends BinaryExpression
A statement assigning the result of an expression to an assignable expression.
-
-
Constructor Summary
Constructors Constructor Description Assignment(CFG cfg, CodeLocation location, EvaluationOrder order, Expression target, Expression expression)
Builds the assignment, assigningexpression
totarget
, happening at the given location in the program.Assignment(CFG cfg, CodeLocation location, EvaluationOrder order, Type staticType, Expression target, Expression expression)
Builds the assignment, assigningexpression
totarget
, happening at the given location in the program.Assignment(CFG cfg, CodeLocation location, Expression target, Expression expression)
Builds the assignment, assigningexpression
totarget
, happening at the given location in the program.Assignment(CFG cfg, CodeLocation location, Type staticType, Expression target, Expression expression)
Builds the assignment, assigningexpression
totarget
, happening at the given location in the program.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
compareSameClassAndParams(Statement o)
Auxiliary method forStatement.compareTo(Statement)
that can safely assume that the two expressions happen at the sameCodeLocation
, are instances of the same class, and have the same parameters according to their implementation ofStatement.compareTo(Statement)
.<A extends AbstractState<A>>
AnalysisState<A>fwdBinarySemantics(InterproceduralAnalysis<A> interprocedural, AnalysisState<A> state, SymbolicExpression left, SymbolicExpression right, StatementStore<A> expressions)
Computes the forward semantics of the expression, after the semantics of the sub-expressions have been computed.java.lang.String
toString()
-
Methods inherited from class it.unive.lisa.program.cfg.statement.BinaryExpression
backwardSemanticsAux, bwdBinarySemantics, forwardSemanticsAux, getLeft, getRight
-
Methods inherited from class it.unive.lisa.program.cfg.statement.NaryExpression
accept, backwardSemantics, compareSameClass, equals, forwardSemantics, getConstructName, getOrder, getStatementEvaluatedAfter, getStatementEvaluatedBefore, getSubExpressions, hashCode
-
Methods inherited from class it.unive.lisa.program.cfg.statement.Expression
getMetaVariables, getParentStatement, getRootStatement, getStaticType, setParentStatement
-
Methods inherited from class it.unive.lisa.program.cfg.statement.Statement
compareTo, getCFG, getEvaluationPredecessor, getEvaluationSuccessor, getLocation, stopsExecution, throwsError
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface it.unive.lisa.program.cfg.ProgramPoint
getProgram
-
-
-
-
Constructor Detail
-
Assignment
public Assignment(CFG cfg, CodeLocation location, Expression target, Expression expression)
Builds the assignment, assigningexpression
totarget
, happening at the given location in the program. The static type of this expression isUntyped
. TheEvaluationOrder
isRightToLeftEvaluation
.- Parameters:
cfg
- the cfg that this statement belongs tolocation
- the location where this statement is defined within the programtarget
- the target of the assignmentexpression
- the expression to assign totarget
-
Assignment
public Assignment(CFG cfg, CodeLocation location, EvaluationOrder order, Expression target, Expression expression)
Builds the assignment, assigningexpression
totarget
, happening at the given location in the program. The static type of this expression isUntyped
.- Parameters:
cfg
- the cfg that this statement belongs tolocation
- the location where this statement is defined within the programorder
- the evaluation order of the sub-expressionstarget
- the target of the assignmentexpression
- the expression to assign totarget
-
Assignment
public Assignment(CFG cfg, CodeLocation location, Type staticType, Expression target, Expression expression)
Builds the assignment, assigningexpression
totarget
, happening at the given location in the program. TheEvaluationOrder
isRightToLeftEvaluation
.- Parameters:
cfg
- the cfg that this statement belongs tolocation
- the location where this statement is defined within the programstaticType
- the static type of this expressiontarget
- the target of the assignmentexpression
- the expression to assign totarget
-
Assignment
public Assignment(CFG cfg, CodeLocation location, EvaluationOrder order, Type staticType, Expression target, Expression expression)
Builds the assignment, assigningexpression
totarget
, happening at the given location in the program.- Parameters:
cfg
- the cfg that this statement belongs tolocation
- the location where this statement is defined within the programorder
- the evaluation order of the sub-expressionsstaticType
- the static type of this expressiontarget
- the target of the assignmentexpression
- the expression to assign totarget
-
-
Method Detail
-
compareSameClassAndParams
protected int compareSameClassAndParams(Statement o)
Description copied from class:NaryExpression
Auxiliary method forStatement.compareTo(Statement)
that can safely assume that the two expressions happen at the sameCodeLocation
, are instances of the same class, and have the same parameters according to their implementation ofStatement.compareTo(Statement)
.- Specified by:
compareSameClassAndParams
in classNaryExpression
- Parameters:
o
- the other expression- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object
-
toString
public final java.lang.String toString()
- Overrides:
toString
in classNaryExpression
-
fwdBinarySemantics
public <A extends AbstractState<A>> AnalysisState<A> fwdBinarySemantics(InterproceduralAnalysis<A> interprocedural, AnalysisState<A> state, SymbolicExpression left, SymbolicExpression right, StatementStore<A> expressions) throws SemanticException
Description copied from class:BinaryExpression
Computes the forward semantics of the expression, after the semantics of the sub-expressions have been computed. Meta variables from the sub-expressions will be forgotten after this expression returns.- Specified by:
fwdBinarySemantics
in classBinaryExpression
- Type Parameters:
A
- the type ofAbstractState
- Parameters:
interprocedural
- the interprocedural analysis of the program to analyzestate
- the state where the expression is to be evaluatedleft
- the symbolic expression representing the computed value of the first sub-expression of this expressionright
- the symbolic expression representing the computed value of the second sub-expression of this expressionexpressions
- the cache where analysis states of intermediate expressions are stored and that can be accessed to query for post-states of parameters expressions- Returns:
- the
AnalysisState
representing the abstract result of the execution of this expression - Throws:
SemanticException
- if something goes wrong during the computation
-
-