tree-gen
C++ code generator for tree structures
|
Convenience class for constructing a node. More...
Public Member Functions | |
NodeBuilder (const std::string &name, const std::string &doc="") | |
Construct a node with the given snake_case name and class documentation. More... | |
NodeBuilder * | derive_from (std::shared_ptr< Node > parent) |
Marks this node as deriving from the given node type. More... | |
NodeBuilder * | with_child (EdgeType type, const std::string &node_name, const std::string &name, const std::string &doc="") |
Adds a child node. More... | |
NodeBuilder * | with_prim (const std::string &prim, const std::string &name, const std::string &doc="", EdgeType type=Prim) |
Adds a child primitive. More... | |
NodeBuilder * | with_order (std::list< std::string > &&order) |
Sets the order in which the parameters must appear in the dumps and constructor. More... | |
NodeBuilder * | mark_error () |
Indicate that this node marks a recovered parse error. More... | |
Public Attributes | |
std::shared_ptr< Node > | node |
The node being constructed. More... | |
Convenience class for constructing a node.
Definition at line 796 of file tree-gen.hpp.
#include <tree-gen.hpp>
tree_gen::NodeBuilder::NodeBuilder | ( | const std::string & | name, |
const std::string & | doc = "" |
||
) |
Construct a node with the given snake_case name and class documentation.
Definition at line 60 of file tree-gen.cpp.
NodeBuilder * tree_gen::NodeBuilder::derive_from | ( | std::shared_ptr< Node > | parent | ) |
Marks this node as deriving from the given node type.
Definition at line 79 of file tree-gen.cpp.
NodeBuilder * tree_gen::NodeBuilder::with_child | ( | EdgeType | type, |
const std::string & | node_name, | ||
const std::string & | name, | ||
const std::string & | doc = "" |
||
) |
Adds a child node.
type
should be one of the edge types.
Definition at line 88 of file tree-gen.cpp.
NodeBuilder * tree_gen::NodeBuilder::with_prim | ( | const std::string & | prim, |
const std::string & | name, | ||
const std::string & | doc = "" , |
||
EdgeType | type = Prim |
||
) |
Adds a child primitive.
Definition at line 109 of file tree-gen.cpp.
NodeBuilder * tree_gen::NodeBuilder::with_order | ( | std::list< std::string > && | order | ) |
Sets the order in which the parameters must appear in the dumps and constructor.
Definition at line 146 of file tree-gen.cpp.
NodeBuilder * tree_gen::NodeBuilder::mark_error | ( | ) |
Indicate that this node marks a recovered parse error.
Definition at line 154 of file tree-gen.cpp.
std::shared_ptr<Node> tree_gen::NodeBuilder::node |
The node being constructed.
Definition at line 802 of file tree-gen.hpp.