Package ru.ispras.fortress.expression
Interface ExprTreeVisitor
-
- All Superinterfaces:
TreeVisitor
- All Known Implementing Classes:
ExprTreeVisitorDefault
,JavaExprPrinter.Visitor
,MapBasedPrinter.ExprTreeVisitor
,NodeTransformer
,SmtExprPrinter.Visitor
,SmtTextBuilder
,TextExprPrinter.Visitor
public interface ExprTreeVisitor extends TreeVisitor
Interface to be implemented by all visitor objects applied to an expression tree to collect information or to build another representation of the expression.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ru.ispras.fortress.util.TreeVisitor
TreeVisitor.Status
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int[]
getOperandOrder()
Returns an array of operand indexes that specify in which order the operands of the currently visited operator should be visited.void
onBindingBegin(NodeBinding node)
Starts visiting a binding node.void
onBindingEnd(NodeBinding node)
Finishes visiting a binding node.void
onBindingListEnd(NodeBinding node)
Notifies that visiting a bound variables list finished.void
onBoundVariableBegin(NodeBinding node, NodeVariable variable, Node value)
Notifies that visiting a bound variable has started.void
onBoundVariableEnd(NodeBinding node, NodeVariable variable, Node value)
Notifies that visiting a bound variable has finished.void
onOperandBegin(NodeOperation operation, Node operand, int index)
Notifies that visiting an expression operand has started.void
onOperandEnd(NodeOperation operation, Node operand, int index)
Notifies that visiting an expression operand has finished.void
onOperationBegin(NodeOperation node)
Starts visiting an operation node.void
onOperationEnd(NodeOperation node)
Finishes visiting an operation node.void
onValue(NodeValue value)
Notifies that a value node has been visited.void
onVariable(NodeVariable variable)
Notifies that a variable node has been visited.-
Methods inherited from interface ru.ispras.fortress.util.TreeVisitor
getStatus, onBegin, onEnd
-
-
-
-
Method Detail
-
onOperationBegin
void onOperationBegin(NodeOperation node)
Starts visiting an operation node.- Parameters:
node
- Operation node.
-
onOperationEnd
void onOperationEnd(NodeOperation node)
Finishes visiting an operation node.- Parameters:
node
- Operation node.
-
getOperandOrder
int[] getOperandOrder()
Returns an array of operand indexes that specify in which order the operands of the currently visited operator should be visited. If the order is standard (i.e. [0..N-1]),null
is returned.- Returns:
- Array of operand indexes or
null
for the standard order.
-
onOperandBegin
void onOperandBegin(NodeOperation operation, Node operand, int index)
Notifies that visiting an expression operand has started.- Parameters:
operation
- Operation node.operand
- Operand node.index
- Operand index.
-
onOperandEnd
void onOperandEnd(NodeOperation operation, Node operand, int index)
Notifies that visiting an expression operand has finished.- Parameters:
operation
- Operation node.operand
- Operand node.index
- Operand index.
-
onValue
void onValue(NodeValue value)
Notifies that a value node has been visited.- Parameters:
value
- Value node.
-
onVariable
void onVariable(NodeVariable variable)
Notifies that a variable node has been visited.- Parameters:
variable
- Variable node.
-
onBindingBegin
void onBindingBegin(NodeBinding node)
Starts visiting a binding node.- Parameters:
node
- Binding node.
-
onBindingListEnd
void onBindingListEnd(NodeBinding node)
Notifies that visiting a bound variables list finished.- Parameters:
node
- Bounding node.
-
onBindingEnd
void onBindingEnd(NodeBinding node)
Finishes visiting a binding node.- Parameters:
node
- Binding node.
-
onBoundVariableBegin
void onBoundVariableBegin(NodeBinding node, NodeVariable variable, Node value)
Notifies that visiting a bound variable has started. Bound value expression will be visited next as general expression.Bound variables are not visited at all.
- Parameters:
node
- Binding node.variable
- Bound variable reference.value
- Bound value expression.
-
onBoundVariableEnd
void onBoundVariableEnd(NodeBinding node, NodeVariable variable, Node value)
Notifies that visiting a bound variable has finished.- Parameters:
node
- Binding node.variable
- Bound variable reference.value
- Bound value expression.
-
-