Awali
Another Weighted Automata library
|
Abstract class that helps implement a visitor of json tree or subtree. More...
#include <visitor.hh>
Public Member Functions | |
virtual | ~visitor_t ()=default |
unsigned | depth () |
bool | is_stopped () |
json::path_t const & | path () |
virtual void | run (json_ast_t tree) |
virtual void | run (node_t const *node) |
void | step_stop () |
void | stop (visit_t b=visit_t::IGNORE_UNVISITED) |
visit_t | stop_status () |
Protected Member Functions | |
visitor_t () | |
virtual void | after_child (array_t const *, unsigned, node_t const *) |
virtual void | after_child (node_t const *, uint_or_string_t const &, node_t const *) |
Function called just after the specialized version with the same name. More... | |
virtual void | after_child (object_t const *, std::string const &, node_t const *) |
virtual void | before_child (array_t const *, unsigned, node_t const *) |
virtual void | before_child (node_t const *, uint_or_string_t const &, node_t const *) |
Function called just before the specialized version with the same name. More... | |
virtual void | before_child (object_t const *, std::string const &, node_t const *) |
Function called just before and just after visiting a child node. More... | |
virtual void | between_children (array_t const *) |
Function called between visiting two children, after the function with the same name and argument type node_t. More... | |
virtual void | between_children (node_t const *) |
Function called between visiting two children, before the function with the same name and specialized argument type. More... | |
virtual void | between_children (object_t const *) |
Function called between visiting two children, after the function with the same name and argument type node_t. More... | |
virtual void | enter (array_t const *) |
Function called when starting visiting an array_t, just after the kind-independent (node_t const*). More... | |
virtual void | enter (bool_t const *) |
Function called when starting visiting a bool_t, just after the kind-independent (node_t const*), and just before leaf(bool). More... | |
virtual void | enter (float_t const *) |
Function called when starting visiting a float_t, just after the kind-independent (node_t const*), and just before leaf(double). More... | |
virtual void | enter (int_t const *) |
Function called when starting visiting a bool_t, just after the kind-independent (node_t const*), and just before leaf(int). More... | |
virtual void | enter (node_t const *) |
Very first function called when visiting a node. More... | |
virtual void | enter (null_t const *) |
Function called when starting visiting a null_t, just after the kind-independent (node_t const*), and just before leaf(std::nullptr_t). More... | |
virtual void | enter (object_t const *) |
Function called when starting visiting an object_t, just after the kind-independent (node_t const*). More... | |
virtual void | enter (string_t const *) |
Function called when starting visiting a string_t, just after the kind-independent (node_t const*), and just before leaf(std::string const&). More... | |
virtual void | leaf (bool) |
Function called when visiting a bool_t, after (bool_t const*) but before leave(bool_t const*). More... | |
virtual void | leaf (double) |
Function called when visiting a float_t, after (float_t const*) but before leave(float_t const*). More... | |
virtual void | leaf (int) |
Function called when visiting a int_t, after (int_t const*) but before leave(int_t const*). More... | |
virtual void | leaf (std::nullptr_t) |
Function called when visiting a null_t, after (null_t const*) but before leave(null_t const*). More... | |
virtual void | leaf (std::string const &) |
Function called when visiting a string_t, after (string_t const*) but before leave(string_t const*). More... | |
virtual void | leave (array_t const *) |
virtual void | leave (bool_t const *) |
virtual void | leave (float_t const *) |
virtual void | leave (int_t const *) |
virtual void | leave (node_t const *) |
This function is called for every node type. More... | |
virtual void | leave (null_t const *) |
virtual void | leave (object_t const *) |
virtual void | leave (string_t const *) |
virtual void | visit (array_t const *node) |
virtual void | visit (bool_t const *node) |
virtual void | visit (float_t const *node) |
virtual void | visit (int_t const *node) |
virtual void | visit (node_t const *node) |
virtual void | visit (null_t const *node) |
virtual void | visit (object_t const *node) |
virtual void | visit (string_t const *node) |
Abstract class that helps implement a visitor of json tree or subtree.
Usually some of the following method are overriden:
The visit
functions may be overriden at your own risk.
The function visitor_t::stop() can be called from anywhere to stop the visit.
Here is a short description of the order in which functions are called:
leaf(explicit data type)
- leave (explicit node type)before_child on 1st child (general, then specialized)
..recursive calls afterChildren with 1st child between_children (general, then specialized) before_children with 2nd child (general, then specialized) .. treatment of other children is similar after_child on penultimate child (general, then specialized) between_children (general, then specialized) before_child with last child (general, then specialized) ..visit last child after_child with last child (general, then specialized)
|
protected |
|
virtualdefault |
|
protectedvirtual |
Reimplemented in awali::json::inline_sizer_t.
|
protectedvirtual |
Function called just after the specialized version with the same name.
Reimplemented in awali::json::smart_printer_t, and awali::json::heighter_t.
|
protectedvirtual |
Reimplemented in awali::json::inline_sizer_t.
|
protectedvirtual |
Reimplemented in awali::json::smart_printer_t.
|
protectedvirtual |
Function called just before the specialized version with the same name.
Reimplemented in awali::json::smart_printer_t.
|
protectedvirtual |
Function called just before and just after visiting a child node.
Reimplemented in awali::json::smart_printer_t.
|
protectedvirtual |
Function called between visiting two children, after the function with the same name and argument type node_t.
If node
has only one children, this function is not called.
Reimplemented in awali::json::smart_printer_t, and awali::json::inline_sizer_t.
|
protectedvirtual |
Function called between visiting two children, before the function with the same name and specialized argument type.
If node
has only one children, this will never be called.
|
protectedvirtual |
Function called between visiting two children, after the function with the same name and argument type node_t.
If node
has only one children, this function is not called.
Reimplemented in awali::json::smart_printer_t, and awali::json::inline_sizer_t.
unsigned awali::json::visitor_t::depth | ( | ) |
|
protectedvirtual |
Function called when starting visiting an array_t, just after the kind-independent (node_t const*).
Reimplemented in awali::json::smart_printer_t, and awali::json::inline_sizer_t.
|
protectedvirtual |
Function called when starting visiting a bool_t, just after the kind-independent (node_t const*), and just before leaf(bool).
|
protectedvirtual |
Function called when starting visiting a float_t, just after the kind-independent (node_t const*), and just before leaf(double).
|
protectedvirtual |
Function called when starting visiting a bool_t, just after the kind-independent (node_t const*), and just before leaf(int).
|
protectedvirtual |
Very first function called when visiting a node.
Called for every node kind.
Reimplemented in awali::json::heighter_t.
|
protectedvirtual |
Function called when starting visiting a null_t, just after the kind-independent (node_t const*), and just before leaf(std::nullptr_t).
|
protectedvirtual |
Function called when starting visiting an object_t, just after the kind-independent (node_t const*).
Reimplemented in awali::json::smart_printer_t, and awali::json::inline_sizer_t.
|
protectedvirtual |
Function called when starting visiting a string_t, just after the kind-independent (node_t const*), and just before leaf(std::string const&).
bool awali::json::visitor_t::is_stopped | ( | ) |
|
protectedvirtual |
Function called when visiting a bool_t, after (bool_t const*) but before leave(bool_t const*).
Reimplemented in awali::json::smart_printer_t.
|
protectedvirtual |
Function called when visiting a float_t, after (float_t const*) but before leave(float_t const*).
Reimplemented in awali::json::smart_printer_t.
|
protectedvirtual |
Function called when visiting a int_t, after (int_t const*) but before leave(int_t const*).
Reimplemented in awali::json::smart_printer_t.
|
protectedvirtual |
Function called when visiting a null_t, after (null_t const*) but before leave(null_t const*).
Reimplemented in awali::json::smart_printer_t.
|
protectedvirtual |
Function called when visiting a string_t, after (string_t const*) but before leave(string_t const*).
Reimplemented in awali::json::smart_printer_t.
|
protectedvirtual |
Reimplemented in awali::json::smart_printer_t.
|
protectedvirtual |
Reimplemented in awali::json::inline_sizer_t.
|
protectedvirtual |
Reimplemented in awali::json::inline_sizer_t.
|
protectedvirtual |
Reimplemented in awali::json::inline_sizer_t.
|
protectedvirtual |
This function is called for every node type.
Reimplemented in awali::json::smart_printer_t.
|
protectedvirtual |
Reimplemented in awali::json::inline_sizer_t.
|
protectedvirtual |
Reimplemented in awali::json::smart_printer_t.
|
protectedvirtual |
Reimplemented in awali::json::inline_sizer_t.
json::path_t const& awali::json::visitor_t::path | ( | ) |
|
virtual |
Reimplemented in awali::json::smart_printer_t.
|
virtual |
Reimplemented in awali::json::smart_printer_t.
void awali::json::visitor_t::step_stop | ( | ) |
void awali::json::visitor_t::stop | ( | visit_t | b = visit_t::IGNORE_UNVISITED | ) |
visit_t awali::json::visitor_t::stop_status | ( | ) |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |