Class BinaryExpression
- java.lang.Object
-
- it.unive.lisa.program.cfg.statement.Statement
-
- it.unive.lisa.program.cfg.statement.Expression
-
- it.unive.lisa.program.cfg.statement.BinaryExpression
-
- All Implemented Interfaces:
ProgramPoint,CodeElement,Node<Statement,Edge,CFG>,java.lang.Comparable<Statement>
- Direct Known Subclasses:
Assignment
public abstract class BinaryExpression extends Expression
A binary expression.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBinaryExpression(CFG cfg, CodeLocation location, Expression left, Expression right)Builds the binary expression, happening at the given location in the program.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> booleanaccept(GraphVisitor<CFG,Statement,Edge,V> visitor, V tool)Accepts the givenGraphVisitor.booleanequals(java.lang.Object obj)ExpressiongetLeft()Yields the left hand-side of the expression.ExpressiongetRight()Yields the right hand-side of the expression.inthashCode()intsetOffset(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.Expression
getDynamicType, getMetaVariables, getParentStatement, getRootStatement, getRuntimeTypes, getStaticType, setParentStatement, setRuntimeTypes
-
Methods inherited from class it.unive.lisa.program.cfg.statement.Statement
compareTo, getCFG, getLocation, getOffset, semantics, stopsExecution, throwsError, toString
-
-
-
-
Constructor Detail
-
BinaryExpression
protected BinaryExpression(CFG cfg, CodeLocation location, Expression left, Expression right)
Builds the binary expression, happening at the given location in the program.- Parameters:
cfg- the cfg that this statement belongs tolocation- the location where the expression is defined within the source file. If unknown, usenullleft- the left hand-side of the expressionright- the right hand-side of the expression
-
-
Method Detail
-
getLeft
public final Expression getLeft()
Yields the left hand-side of the expression.- Returns:
- the left hand-side of the expression
-
getRight
public final Expression getRight()
Yields the right hand-side of the expression.- Returns:
- the right hand-side of the expression
-
setOffset
public final int setOffset(int offset)
Description copied from interface:NodeSets 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
-
hashCode
public int hashCode()
- Overrides:
hashCodein classExpression
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classExpression
-
accept
public final <V> boolean accept(GraphVisitor<CFG,Statement,Edge,V> visitor, V tool)
Description copied from interface:NodeAccepts 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 thatvisitorcan use- Parameters:
visitor- the visitor that is visiting theGraphcontaining this nodetool- the auxiliary tool thatvisitorcan use- Returns:
- whether or not the visiting should stop when this call returns, as decided by the visitor itself
-
-