Class UnaryStatement
- java.lang.Object
-
- it.unive.lisa.program.cfg.statement.Statement
-
- it.unive.lisa.program.cfg.statement.UnaryStatement
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
UnaryStatement(CFG cfg, CodeLocation location, Expression expression)
Builds the unary statement, happening at the given location in the program.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> boolean
accept(GraphVisitor<CFG,Statement,Edge,V> visitor, V tool)
Accepts the givenGraphVisitor
.boolean
equals(java.lang.Object obj)
Expression
getExpression()
Yields the expression that is the argument of this unary statement.Statement
getStatementEvaluatedBefore(Statement other)
Yields theStatement
that precedes the given one, assuming thatother
is contained into this expression.int
hashCode()
int
setOffset(int offset)
Sets the offset of this node to the given value, and then proceeds by setting the one of its nested nodes (if any) to subsequent values.-
Methods inherited from class it.unive.lisa.program.cfg.statement.Statement
compareTo, getCFG, getEvaluationPredecessor, getLocation, getOffset, semantics, stopsExecution, throwsError, toString
-
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
-
UnaryStatement
protected UnaryStatement(CFG cfg, CodeLocation location, Expression expression)
Builds the unary statement, 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 programexpression
- the argument of this statement
-
-
Method Detail
-
getExpression
public final Expression getExpression()
Yields the expression that is the argument of this unary statement.- Returns:
- the argument
-
setOffset
public final int setOffset(int offset)
Description copied from interface:CodeNode
Sets the offset of this node to the given value, and then proceeds by setting the one of its nested nodes (if any) to subsequent values. The last offset used is returned.- Parameters:
offset
- the offset to set- Returns:
- the last offset used while setting the offsets of nested nodes
-
accept
public final <V> boolean accept(GraphVisitor<CFG,Statement,Edge,V> visitor, V tool)
Description copied from interface:Node
Accepts the givenGraphVisitor
. Implementors of this method are responsible for invokingGraphVisitor.visit(Object, Graph, Node)
on this node afterNode.accept(GraphVisitor, Object)
has been invoked on all nested nodes, if any. The visiting should stop at the first of such calls that returnfalse
.- Type Parameters:
V
- the type of auxiliary tool thatvisitor
can use- Parameters:
visitor
- the visitor that is visiting theGraph
containing this nodetool
- the auxiliary tool thatvisitor
can use- Returns:
- whether or not the visiting should stop when this call returns, as decided by the visitor itself
-
getStatementEvaluatedBefore
public Statement getStatementEvaluatedBefore(Statement other)
Description copied from class:Statement
Yields theStatement
that precedes the given one, assuming thatother
is contained into this expression. If this method returnsnull
, thenother
is the first expression evaluated when this statement is evaluated.- Overrides:
getStatementEvaluatedBefore
in classStatement
- Parameters:
other
- the other statement- Returns:
- the previous statement, or
null
-
-