tree-gen
C++ code generator for tree structures
Functions
tree_gen::python Namespace Reference

Detailed Description

Namespace for Python code generation.

Functions

void format_doc (std::ofstream &stream, const std::string &doc, const std::string &indent="")
 Formats a Python docstring. More...
 
void generate_deserialize_mux (std::ofstream &output, Node &node)
 Recursive function to print a muxing if statement for all node classes derived from the given node class. More...
 
void generate_node_class (std::ofstream &output, Specification &spec, Node &node)
 Generates the class for the given node. More...
 
void generate (const std::string &python_filename, Specification &specification)
 Generates the complete Python code. More...
 

Function Documentation

◆ format_doc()

void tree_gen::python::format_doc ( std::ofstream &  stream,
const std::string &  doc,
const std::string &  indent = "" 
)

Formats a Python docstring.

Definition at line 16 of file tree-gen-python.cpp.

◆ generate_deserialize_mux()

void tree_gen::python::generate_deserialize_mux ( std::ofstream &  output,
Node node 
)

Recursive function to print a muxing if statement for all node classes derived from the given node class.

Definition at line 69 of file tree-gen-python.cpp.

◆ generate_node_class()

void tree_gen::python::generate_node_class ( std::ofstream &  output,
Specification spec,
Node node 
)

Generates the class for the given node.

Definition at line 86 of file tree-gen-python.cpp.

◆ generate()

void tree_gen::python::generate ( const std::string &  python_filename,
Specification specification 
)

Generates the complete Python code.

Definition at line 707 of file tree-gen-python.cpp.