Awali
Another Weighted Automata library
Public Member Functions | Protected Member Functions | Protected Attributes
awali::json::inline_sizer_t Class Reference

#include <smart_printer.hh>

Inheritance diagram for awali::json::inline_sizer_t:
awali::json::visitor_t

Public Member Functions

 inline_sizer_t ()
 
 inline_sizer_t (json_ast_t ast)
 
 inline_sizer_t (node_t const *node)
 
unsigned height_of (node_t const *node)
 
unsigned operator[] (node_t const *node)
 
- Public Member Functions inherited from awali::json::visitor_t
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

void after_child (array_t const *node, unsigned i, node_t const *child) override
 
void after_child (object_t const *node, std::string const &key, node_t const *child) override
 
void between_children (array_t const *node) override
 Function called between visiting two children, after the function with the same name and argument type node_t. More...
 
void between_children (object_t const *node) override
 Function called between visiting two children, after the function with the same name and argument type node_t. More...
 
void enter (array_t const *node) override
 Function called when starting visiting an array_t, just after the kind-independent (node_t const*). More...
 
void enter (object_t const *node) override
 Function called when starting visiting an object_t, just after the kind-independent (node_t const*). More...
 
void leave (bool_t const *node) override
 
void leave (float_t const *node) override
 
void leave (int_t const *node) override
 
void leave (null_t const *node) override
 
void leave (string_t const *node) override
 
- Protected Member Functions inherited from awali::json::visitor_t
 visitor_t ()
 
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 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 (node_t const *)
 Function called between visiting two children, before the function with the same name and specialized argument type. 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 (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 (node_t const *)
 This function is called for every node type. More...
 
virtual void leave (object_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)
 

Protected Attributes

heighter_t heighter
 
std::unordered_map< node_t const *, unsigned > left_weight
 
std::unordered_map< node_t const *, unsigned > map
 

Constructor & Destructor Documentation

◆ inline_sizer_t() [1/3]

awali::json::inline_sizer_t::inline_sizer_t ( json_ast_t  ast)

◆ inline_sizer_t() [2/3]

awali::json::inline_sizer_t::inline_sizer_t ( node_t const *  node)

◆ inline_sizer_t() [3/3]

awali::json::inline_sizer_t::inline_sizer_t ( )

Member Function Documentation

◆ after_child() [1/2]

void awali::json::inline_sizer_t::after_child ( array_t const *  node,
unsigned  i,
node_t const *  child 
)
overrideprotectedvirtual

Reimplemented from awali::json::visitor_t.

◆ after_child() [2/2]

void awali::json::inline_sizer_t::after_child ( object_t const *  node,
std::string const &  key,
node_t const *  child 
)
overrideprotectedvirtual

Reimplemented from awali::json::visitor_t.

◆ between_children() [1/2]

void awali::json::inline_sizer_t::between_children ( array_t const *  )
overrideprotectedvirtual

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 from awali::json::visitor_t.

◆ between_children() [2/2]

void awali::json::inline_sizer_t::between_children ( object_t const *  )
overrideprotectedvirtual

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 from awali::json::visitor_t.

◆ enter() [1/2]

void awali::json::inline_sizer_t::enter ( array_t const *  )
overrideprotectedvirtual

Function called when starting visiting an array_t, just after the kind-independent (node_t const*).

Reimplemented from awali::json::visitor_t.

◆ enter() [2/2]

void awali::json::inline_sizer_t::enter ( object_t const *  )
overrideprotectedvirtual

Function called when starting visiting an object_t, just after the kind-independent (node_t const*).

Reimplemented from awali::json::visitor_t.

◆ height_of()

unsigned awali::json::inline_sizer_t::height_of ( node_t const *  node)

◆ leave() [1/5]

void awali::json::inline_sizer_t::leave ( bool_t const *  node)
overrideprotectedvirtual

Reimplemented from awali::json::visitor_t.

◆ leave() [2/5]

void awali::json::inline_sizer_t::leave ( float_t const *  node)
overrideprotectedvirtual

Reimplemented from awali::json::visitor_t.

◆ leave() [3/5]

void awali::json::inline_sizer_t::leave ( int_t const *  node)
overrideprotectedvirtual

Reimplemented from awali::json::visitor_t.

◆ leave() [4/5]

void awali::json::inline_sizer_t::leave ( null_t const *  node)
overrideprotectedvirtual

Reimplemented from awali::json::visitor_t.

◆ leave() [5/5]

void awali::json::inline_sizer_t::leave ( string_t const *  node)
overrideprotectedvirtual

Reimplemented from awali::json::visitor_t.

◆ operator[]()

unsigned awali::json::inline_sizer_t::operator[] ( node_t const *  node)

Field Documentation

◆ heighter

heighter_t awali::json::inline_sizer_t::heighter
protected

◆ left_weight

std::unordered_map<node_t const*,unsigned> awali::json::inline_sizer_t::left_weight
protected

◆ map

std::unordered_map<node_t const*,unsigned> awali::json::inline_sizer_t::map
protected

The documentation for this class was generated from the following file: