Zen
A cross-platform functional programming language

FunctionDef Class Reference

Concrete class for all user defined functions, routines, grammars, etc. More...

#include <Ast.hpp>

Inheritance diagram for FunctionDef:
MethodTypeSpec UserDefinedTypeSpec ChildTypeSpec TypeSpec Node

List of all members.

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::TgetModifier () 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 ImplItemgetImpl () 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::stringgetGrammarName () 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.

Detailed Description

Concrete class for all user defined functions, routines, grammars, etc.


Constructor & Destructor Documentation

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.

Parameters:
accessTypeThe AccessType for this function.
outThe out-params of the function
nameName of the function
inThe scope holding the in-params for this function
ntypeThe NativeType of this function.
modifierThe Modifier for this function.

Member Function Documentation

const z::string& getGrammarName ( ) const [inline]

Returns the grammar name for the function.

Todo:
: HACK
Returns:
A reference to the grammar name for the function
const ImplItem& getImpl ( ) const [inline]

Returns the implementation AST for the function.

Returns:
A reference to the implementation for the function
const Modifier::T& getModifier ( ) const [inline]

Returns the modifier for the function.

Returns:
A reference to the modifier for the function
bool hasImpl ( ) const [inline]

Checks whether function has an implementation (if not it is a declaration, not a definition)

Returns:
True if it has an implementation, false otherwise.
void setGrammarName ( const z::string val) [inline]

Sets the grammar name of the function.

Parameters:
valThe grammar name for the function
void setImpl ( const ImplItem impl) [inline]

Sets the implementation for the function.

Parameters:
implA reference to the implementation AST node for the function
void visit ( TypeSpec::Visitor visitor) const [private, virtual]

Visitor pattern implementation.

Todo:
: HACK
Parameters:
visitorThe visitor object.

Implements TypeSpec.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines