VICI  0.11.815
Visual Chart Interpreter
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | Public Attributes | List of all members
VICI::EbnfNode Class Reference

A node of the EBNF parse tree. More...

#include <vici/parseTree.h>

Public Types

enum  NodeType {
  Undefined, Grammar, Production, Terminal,
  Quotation, Name, Repetition, Option,
  Sequence, Choice
}
 the type of node, which corresponds to the non-terminals of the EBNF for EBNF. More...
 

Public Member Functions

 EbnfNode ()
 Constructor.
 
 ~EbnfNode ()
 Destructor.
 
std::string typeOfNode () const
 get the type of the node More...
 
void typeOfNode (const std::string &t)
 set the type of the node More...
 

Public Attributes

EbnfNodeparent
 pointer to parent node
 
EbnfNodeprev
 pointer to previous sibling node
 
EbnfNodenext
 pointer to next sibling node
 
EbnfNodefirstChild
 pointer to first child node
 
EbnfNodelastChild
 pointer to last child node
 
NodeType nodeType
 defines what EBNF non-terminal the node represents
 
std::string text
 the terminal leaves of the EBNF
 

Detailed Description

A node of the EBNF parse tree.

A node of the EbnfTree used to pass the parsed form of an EBNF definition between modules.

Member Enumeration Documentation

the type of node, which corresponds to the non-terminals of the EBNF for EBNF.

Enumerator
Undefined 

just until we load something sensible.

Grammar 

the root of the tree - only one of these.

Production 

one for each production. Can have any number of child nodes. firstChild is the Name of the Production.

Terminal 

one or two children of type Quotation. firstChild == lastChild if only one child.

Quotation 

has no children

Name 

has no children

Repetition 

can have any number of children

Option 

can have any number of children

Sequence 

can have any number of children

Choice 

has two children

Member Function Documentation

string EbnfNode::typeOfNode ( ) const

get the type of the node

Returns
the type of the node as a string
void EbnfNode::typeOfNode ( const std::string &  t)

set the type of the node

Parameters
tthe type of the node as a string

The documentation for this class was generated from the following files: