Zen
A cross-platform functional programming language
|
Concrete class for all user defined functions, routines, grammars, etc. More...
#include <Ast.hpp>
Classes | |
struct | Modifier |
Outer struct for Modifier enumeration. More... | |
Public Member Functions | |
FunctionDef (const AccessType::T &accessType, const QualifiedType &out, const z::string &name, Scope &in, const NativeType &ntype, const Ast::FunctionDef::Modifier::T &modifier) | |
Default constructor. | |
const Modifier::T & | getModifier () const |
Returns the modifier for the function. | |
bool | hasImpl () const |
Checks whether function has an implementation (if not it is a declaration, not a definition) | |
const ImplItem & | getImpl () const |
Returns the implementation AST for the function. | |
void | setImpl (const ImplItem &impl) |
Sets the implementation for the function. | |
void | setGrammarName (const z::string &val) |
Sets the grammar name of the function. | |
const z::string & | getGrammarName () const |
Returns the grammar name for the function. | |
Private Member Functions | |
virtual void | visit (TypeSpec::Visitor &visitor) const |
Visitor pattern implementation. | |
Private Attributes | |
const Ast::FunctionDef::Modifier::T | _modifier |
The modifier for the function. | |
const ImplItem * | _impl |
A pointer to the implementation for the function, if any. | |
z::string | _gname |
The grammar name for the function. |
Concrete class for all user defined functions, routines, grammars, etc.
FunctionDef | ( | const AccessType::T & | accessType, |
const QualifiedType & | out, | ||
const z::string & | name, | ||
Scope & | in, | ||
const NativeType & | ntype, | ||
const Ast::FunctionDef::Modifier::T & | modifier | ||
) | [inline] |
Default constructor.
accessType | The AccessType for this function. |
out | The out-params of the function |
name | Name of the function |
in | The scope holding the in-params for this function |
ntype | The NativeType of this function. |
modifier | The Modifier for this function. |
const z::string& getGrammarName | ( | ) | const [inline] |
Returns the grammar name for the function.
const ImplItem& getImpl | ( | ) | const [inline] |
Returns the implementation AST for the function.
const Modifier::T& getModifier | ( | ) | const [inline] |
Returns the modifier for the function.
bool hasImpl | ( | ) | const [inline] |
Checks whether function has an implementation (if not it is a declaration, not a definition)
void setGrammarName | ( | const z::string & | val | ) | [inline] |
Sets the grammar name of the function.
val | The grammar name for the function |
void setImpl | ( | const ImplItem & | impl | ) | [inline] |
Sets the implementation for the function.
impl | A reference to the implementation AST node for the function |
void visit | ( | TypeSpec::Visitor & | visitor | ) | const [private, virtual] |