Zen
A cross-platform functional programming language

ImplItem Class Reference

Base class for Implementation item nodes. More...

#include <Ast.hpp>

Inheritance diagram for ImplItem:
Node ContinuationImplItem FunctionImplItem GrammarImplItem RoutineImplItem WindowImplItem

List of all members.

Classes

class  Visitor
 ImplItem Visitor interface class. More...

Public Member Functions

const int & getIndex () const
 Returns the unique index for this item.
const Ast::FunctionDefgetFunctionDef () const
 Returns the FunctionDef of the function this item is implementing.
virtual void visit (Visitor &visitor) const =0
 Visitor pattern implementation.
virtual const
Ast::FunctionImplItem
getFunctionImplItem () const =0
 Returns a reference to this if this is a FunctionImplItem, else throws exception.

Protected Member Functions

 ImplItem (const int &idx, const Ast::FunctionDef &fdef)
 Default constructor.

Private Attributes

const int _idx
 Unique index for this item.
const Ast::FunctionDef_fdef
 Definition of function beging implemented.

Detailed Description

Base class for Implementation item nodes.

Every ImplItem has a numeric index that identifies it uniquely and is used to ensure that there is no naming conflicts.


Constructor & Destructor Documentation

ImplItem ( const int &  idx,
const Ast::FunctionDef fdef 
) [inline, protected]

Default constructor.

Parameters:
idxThe index of this item in the list of impl items.
fdefThe function definition implemented in this item.

Member Function Documentation

const Ast::FunctionDef& getFunctionDef ( ) const [inline]

Returns the FunctionDef of the function this item is implementing.

Returns:
Definition of function beging implemented
virtual const Ast::FunctionImplItem& getFunctionImplItem ( ) const [pure virtual]

Returns a reference to this if this is a FunctionImplItem, else throws exception.

Returns:
A reference to this.
Todo:
This is a dirty hack to convert self to derived class. Find a clean design solution

Implemented in ContinuationImplItem, RoutineImplItem, FunctionImplItem, GrammarImplItem, and WindowImplItem.

const int& getIndex ( ) const [inline]

Returns the unique index for this item.

Returns:
Unique index for this item
virtual void visit ( Visitor visitor) const [pure virtual]

Visitor pattern implementation.

Parameters:
visitorThe visitor object.

Implemented in ContinuationImplItem, RoutineImplItem, FunctionImplItem, GrammarImplItem, and WindowImplItem.


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