Zen
A cross-platform functional programming language
|
AST node base class representing a single EBNF grammar statement. More...
#include <Ast.hpp>
Classes | |
class | Visitor |
GrammarStatement Visitor interface class. More... | |
Public Member Functions | |
const z::string & | getName () const |
Returns the name of this statement. | |
const FunctionDef & | getFunctionDef () const |
Returns the function definition of this statement. | |
const FunctionBlock & | getBlock () const |
Returns the function block of this statement. | |
virtual void | visit (GrammarStatement::Visitor &visitor) const =0 |
Visitor pattern implementation. | |
Protected Member Functions | |
GrammarStatement (const z::string &name, const Ast::FunctionDef &fdef, const Ast::FunctionBlock &fblock) | |
Default constructor. | |
Private Attributes | |
const z::string | _name |
Name of this statement. | |
const Ast::FunctionDef & | _fdef |
Function definition of this statement. | |
const Ast::FunctionBlock & | _fblock |
Function block of this statement. |
AST node base class representing a single EBNF grammar statement.
GrammarStatement | ( | const z::string & | name, |
const Ast::FunctionDef & | fdef, | ||
const Ast::FunctionBlock & | fblock | ||
) | [inline, protected] |
Default constructor.
name | Name of the variable on the LHS of the grammar statement |
fdef | Definition of the function that represents this statement |
fblock | Function block of the action function for this statement |
const FunctionBlock& getBlock | ( | ) | const [inline] |
Returns the function block of this statement.
const FunctionDef& getFunctionDef | ( | ) | const [inline] |
Returns the function definition of this statement.
const z::string& getName | ( | ) | const [inline] |
Returns the name of this statement.
virtual void visit | ( | GrammarStatement::Visitor & | visitor | ) | const [pure virtual] |
Visitor pattern implementation.
visitor | The visitor object. |
Implemented in GrammarRuleStatement, and LexerStatement.