CBMC
|
#include <expr_iterator.h>
Public Member Functions | |
depth_iteratort ()=default | |
Create an end iterator. More... | |
depth_iteratort (exprt &expr) | |
Create iterator starting at the supplied node (root) All mutations of the child nodes will be reflected on this node. More... | |
depth_iteratort (const exprt &expr, std::function< exprt &()> mutate_root) | |
Create iterator starting at the supplied node (root) If mutations of the child nodes are required then the passed mutate_root function will be called to get a non-const copy of the same root on which the mutations will be done. More... | |
exprt & | mutate () |
Obtain non-const reference to the exprt instance currently pointed to by the iterator. More... | |
Public Member Functions inherited from depth_iterator_baset< depth_iteratort > | |
bool | operator== (const depth_iterator_baset< other_depth_iterator_t > &other) const |
bool | operator!= (const depth_iterator_baset< other_depth_iterator_t > &other) const |
depth_iteratort & | operator++ () |
Preincrement operator Do not call on the end() iterator. More... | |
depth_iteratort | operator++ (int) |
Post-increment operator Expensive copy. More... | |
depth_iteratort & | next_sibling_or_parent () |
const exprt & | operator* () const |
Dereference operator Dereferencing end() iterator is undefined behaviour. More... | |
const exprt * | operator-> () const |
Dereference operator (member access) Dereferencing end() iterator is undefined behaviour. More... | |
Private Attributes | |
std::function< exprt &()> | mutate_root |
If this is non-empty then the root is currently const and this function must be called before any mutations occur. More... | |
Additional Inherited Members | |
Public Types inherited from depth_iterator_baset< depth_iteratort > | |
typedef void | difference_type |
typedef exprt | value_type |
typedef const exprt * | pointer |
typedef const exprt & | reference |
typedef std::forward_iterator_tag | iterator_category |
Protected Member Functions inherited from depth_iterator_baset< depth_iteratort > | |
depth_iterator_baset ()=default | |
Create end iterator. More... | |
depth_iterator_baset (const exprt &root) | |
Create begin iterator, starting at the supplied node. More... | |
depth_iterator_baset (const depth_iterator_baset &)=default | |
depth_iterator_baset (depth_iterator_baset &&other) | |
~depth_iterator_baset ()=default | |
Destructor Protected to discourage upcasting. More... | |
depth_iterator_baset & | operator= (const depth_iterator_baset &)=default |
depth_iterator_baset & | operator= (depth_iterator_baset &&other) |
const exprt & | get_root () |
exprt & | mutate () |
Obtain non-const exprt reference. More... | |
bool | push_expr (const exprt &expr) |
Pushes expression onto the stack If overridden, this function should be called from the inheriting class by the override function. More... | |
Definition at line 228 of file expr_iterator.h.
|
default |
Create an end iterator.
|
inlineexplicit |
Create iterator starting at the supplied node (root) All mutations of the child nodes will be reflected on this node.
expr | The root node to begin iteration at |
Definition at line 243 of file expr_iterator.h.
|
inlineexplicit |
Create iterator starting at the supplied node (root) If mutations of the child nodes are required then the passed mutate_root function will be called to get a non-const copy of the same root on which the mutations will be done.
expr | The root node to begin iteration at |
mutate_root | The function to call to get a non-const copy of the same root expression passed in the expr parameter |
Definition at line 254 of file expr_iterator.h.
|
inline |
Obtain non-const reference to the exprt instance currently pointed to by the iterator.
If the iterator is currently using a const root exprt then calls mutate_root to get a non-const root and copies it if it is shared
Definition at line 270 of file expr_iterator.h.
|
private |
If this is non-empty then the root is currently const and this function must be called before any mutations occur.
Definition at line 234 of file expr_iterator.h.