dparsergen.core.dynamictree

This module implements a tree creator, where all tokens, nonterminals and arrays are represented using the same base class. The list of childs is just an array of this class. Create an instance of DynamicParseTreeCreator for the used grammar and pass it to the parser.

Members

Classes

DynamicParseTree
class DynamicParseTree(Location, alias LocationRangeImpl = LocationRangeStartLength)

Base class for all tree nodes.

DynamicParseTreeArray
class DynamicParseTreeArray(Location, alias LocationRangeImpl = LocationRangeStartLength)

Tree node class for array.

DynamicParseTreeCreator
class DynamicParseTreeCreator(alias GrammarModule, Location_, alias LocationRangeImpl = LocationRangeStartLength)

Class for creating trees during parsing.

DynamicParseTreeMerged
class DynamicParseTreeMerged(Location, alias LocationRangeImpl = LocationRangeStartLength)

Tree node class for merged nodes.

DynamicParseTreeNonterminal
class DynamicParseTreeNonterminal(Location, alias LocationRangeImpl = LocationRangeStartLength)

Tree node class for nonterminal.

DynamicParseTreeToken
class DynamicParseTreeToken(Location, alias LocationRangeImpl = LocationRangeStartLength)

Tree node class for token.

Functions

printTree
void printTree(imported!"std.stdio".File file, DynamicParseTree!(Location, LocationRangeImpl) tree, bool verbose)

Print the tree to a file.

treeToString
void treeToString(DynamicParseTree!(Location, LocationRangeImpl) tree, Appender!string app)
string treeToString(DynamicParseTree!(Location, LocationRangeImpl) tree)

Convert tree to string.

Structs

DynamicParseTreeTmpArray
struct DynamicParseTreeTmpArray(Location, alias LocationRangeImpl = LocationRangeStartLength)

Type for temporarily storing array of parse trees during parsing. The array will later be stored as DynamicParseTreeArray.

Meta