tree-gen
C++ code generator for tree structures
|
C++ generation source file for tree-gen. More...
Go to the source code of this file.
Namespaces | |
tree_gen | |
Namespace for the tree-gen program. | |
tree_gen::cpp | |
Namespace for C++ code generation. | |
Functions | |
void | tree_gen::cpp::format_doc (std::ofstream &stream, const std::string &doc, const std::string &indent="", const std::string &annotation="") |
Formats a C++ docstring. More... | |
void | tree_gen::cpp::generate_enum (std::ofstream &header, Nodes &nodes) |
Generates the node type enumeration. More... | |
void | tree_gen::cpp::generate_typecast_function (std::ofstream &header, std::ofstream &source, const std::string &clsname, Node &into, bool allowed) |
Generates an as_<type> function. More... | |
void | tree_gen::cpp::generate_base_class (std::ofstream &header, std::ofstream &source, Nodes &nodes, bool with_serdes, const std::string &support_ns) |
Generates the base class for the nodes. More... | |
void | tree_gen::cpp::generate_deserialize_mux (std::ofstream &source, Node &node) |
Recursive function to print a muxing if statement for all node classes derived from the given node class. More... | |
void | tree_gen::cpp::generate_node_class (std::ofstream &header, std::ofstream &source, Specification &spec, Node &node) |
Generates the class for the given node. More... | |
void | tree_gen::cpp::generate_visitor_base_class (std::ofstream &header, std::ofstream &source, Nodes &nodes) |
Generate the visitor base class. More... | |
void | tree_gen::cpp::generate_visitor_class (std::ofstream &header, std::ofstream &source, Nodes &nodes) |
Generate the templated visitor class. More... | |
void | tree_gen::cpp::generate_recursive_visitor_class (std::ofstream &header, std::ofstream &source, Nodes &nodes) |
Generate the recursive visitor class. More... | |
void | tree_gen::cpp::generate_dumper_class (std::ofstream &header, std::ofstream &source, Nodes &nodes, std::string &source_location, std::string &support_ns) |
Generate the dumper class. More... | |
void | tree_gen::cpp::generate (const std::string &header_filename, const std::string &source_filename, Specification &specification) |
Generate the complete C++ code (source and header). More... | |
C++ generation source file for tree-gen.
Definition in file tree-gen-cpp.cpp.
#include <fstream>
#include <iostream>
#include <cctype>
#include <unordered_set>
#include "tree-gen-cpp.hpp"