28 #ifndef VICI_PARSETREE_H
29 #define VICI_PARSETREE_H
65 static std::map< NodeType, std::string > nodeNames;
136 void exportNode(
EbnfNode *, xmlNodePtr );
137 void importNode(
EbnfNode *, xmlNodePtr );
A node of the EBNF parse tree.
Definition: parseTree.h:47
has no children
Definition: parseTree.h:57
NodeType nodeType
defines what EBNF non-terminal the node represents
Definition: parseTree.h:76
void importXml(const Path &p)
Load the tree from an XML file.
Definition: parseTree.cpp:123
EbnfNode * lastChild
pointer to last child node
Definition: parseTree.h:73
A specialization of the Xml class for the parse tree.
Definition: parseTree.h:133
EbnfNode * firstChild
pointer to first child node
Definition: parseTree.h:73
has no children
Definition: parseTree.h:56
can have any number of children
Definition: parseTree.h:58
void importTree(EbnfTree *tree, const Path &path)
import a tree from parse-tree.xml
Definition: parseTree.cpp:144
EbnfNode()
Constructor.
Definition: parseTree.cpp:38
EbnfNode * next
pointer to next sibling node
Definition: parseTree.h:71
has two children
Definition: parseTree.h:61
one for each production. Can have any number of child nodes. firstChild is the Name of the Production...
Definition: parseTree.h:54
A type for the parsed form of EBNF.
Definition: vici.h:226
just until we load something sensible.
Definition: parseTree.h:52
std::string typeOfNode() const
get the type of the node
Definition: parseTree.cpp:76
EbnfNode * parent
pointer to parent node
Definition: parseTree.h:70
virtual ~EbnfTree()
destructor
Definition: parseTree.cpp:105
Manipulate path strings.
Definition: stringy.h:74
NodeType
the type of node, which corresponds to the non-terminals of the EBNF for EBNF.
Definition: parseTree.h:51
void exportTree(EbnfTree *tree, const Path &path)
export the tree to parse-tree.xml
Definition: parseTree.cpp:136
EbnfNode * prev
pointer to previous sibling node
Definition: parseTree.h:71
Project wide declarations and definitions.
one or two children of type Quotation. firstChild == lastChild if only one child. ...
Definition: parseTree.h:55
An implementation of the ParseTree type.
Definition: parseTree.h:102
can have any number of children
Definition: parseTree.h:60
~EbnfNode()
Destructor.
Definition: parseTree.cpp:61
EbnfXml()
constructor
Definition: parseTree.cpp:131
void exportXml(const Path &p)
Save the tree as an XML file.
Definition: parseTree.cpp:114
EbnfNode * root
root node of the tree - type is Grammar
Definition: parseTree.h:108
A C++ wrapper for libxml2.
Definition: xml.h:73
std::string text
the terminal leaves of the EBNF
Definition: parseTree.h:77
can have any number of children
Definition: parseTree.h:59
EbnfTree()
constructor
Definition: parseTree.cpp:97
the root of the tree - only one of these.
Definition: parseTree.h:53