tree-gen
C++ code generator for tree structures
Namespaces | Classes | Typedefs | Enumerations | Functions
tree_gen Namespace Reference

Detailed Description

Namespace for the tree-gen program.

Namespaces

 cpp
 Namespace for C++ code generation.
 
 python
 Namespace for Python code generation.
 

Classes

struct  Field
 Represents a field. More...
 
struct  Node
 Represents a type of AST node. More...
 
class  NodeBuilder
 Convenience class for constructing a node. More...
 
class  Specification
 Struct containing everything needed for a complete specification. More...
 

Typedefs

using Nodes = std::vector< std::shared_ptr< Node > >
 List of nodes. More...
 

Enumerations

enum  EdgeType {
  Maybe, One, Any, Many,
  OptLink, Link, Prim
}
 Types of edges between nodes and primitives. More...
 

Functions

std::string replace_all (std::string str, const std::string &from, const std::string &to)
 Convenience method for replacing all occurrences of a substring in a string with another string. More...
 

Typedef Documentation

◆ Nodes

using tree_gen::Nodes = typedef std::vector<std::shared_ptr<Node> >

List of nodes.

Definition at line 785 of file tree-gen.hpp.

Enumeration Type Documentation

◆ EdgeType

Types of edges between nodes and primitives.

Enumerator
Maybe 

Zero or one nodes.

One 

Exactly one node.

Any 

Zero or more nodes.

Many 

One or more nodes.

OptLink 

Link to zero or one nodes elsewhere in the tree.

Link 

Link to exactly one node elsewhere in the tree.

Prim 

Primitive type.

Definition at line 635 of file tree-gen.hpp.

Function Documentation

◆ replace_all()

std::string tree_gen::replace_all ( std::string  str,
const std::string &  from,
const std::string &  to 
)

Convenience method for replacing all occurrences of a substring in a string with another string.

Definition at line 48 of file tree-gen.cpp.