com.pnfsoftware.jeb.core.units.code.IVisitResults<T> |
Known Indirect Subclasses |
Visit results interface for statement trees.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | FLAG_RECORD_PARENTS | Record the parents in a stack, made available when visiting a child. | |||||||||
int | FLAG_SKIP_ASSIGN_DST | Skip written (defined) elements. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract int | getResultCode() | ||||||||||
abstract void |
interrupt(boolean success, int code)
Notify the visitor that the visit of the tree should be stopped.
| ||||||||||
abstract void |
interrupt(boolean success)
Notify the visitor that the visit of the tree should be stopped.
| ||||||||||
abstract boolean | isInterruptedVisit() | ||||||||||
abstract boolean | isVisitedSuccessfully() | ||||||||||
abstract T |
parent(int index)
This convenience method returns the i'th ancestor (i=0 being the immediate parent) of the
element.
| ||||||||||
abstract Iterator<T> |
parentsIterator()
Optional iterator containing the parents; non-null only if
FLAG_RECORD_PARENTS was
used when creating the object. | ||||||||||
abstract void |
setReplacedNode(T newNode)
Notify the visitor that the current node was replaced by the
process method. | ||||||||||
abstract void |
setVisitResult(boolean success)
Saves the visit result (do not stop the visitor: use
interrupt(boolean) to stop the
process) | ||||||||||
abstract void |
skipChildren()
Used in DFS pre-order to notify the visitor that the children of the currently visited node
should be skipped; the visitor will then proceed with the next cousin.
|
Record the parents in a stack, made available when visiting a child. Parents recording is seldom used, and disabled by default.
Skip written (defined) elements. Note: the name of this flag is misleading, implementations may skip more than simply the destination of assignments.
Notify the visitor that the visit of the tree should be stopped.
success | visit result |
---|---|
code | optional code, can be retrieved via getResultCode()
|
Notify the visitor that the visit of the tree should be stopped.
success | the result of the visit |
---|
This convenience method returns the i'th ancestor (i=0 being the immediate parent) of the element. On error, the method returns null (it never throws).
index | parent index, negative indices are allowed (-1 means the highest ancestor) |
---|
Optional iterator containing the parents; non-null only if FLAG_RECORD_PARENTS
was
used when creating the object. The first element provided by the iterator is the parent of
the currently visited element; the last element is the deepest ancestor.
Notify the visitor that the current node was replaced by the
process
method.
Note: usage of this method is not mandatory in a DFS post-order traversal.
newNode | the non-null new node |
---|
Saves the visit result (do not stop the visitor: use interrupt(boolean)
to stop the
process)
Used in DFS pre-order to notify the visitor that the children of the currently visited node should be skipped; the visitor will then proceed with the next cousin.
Note: this method is useless in DFS post-order since children of a node are always processed before their parent.