Zen
A cross-platform functional programming language

Closure Class Reference

Base class for AST Nodes representing closures. More...

#include <Ast.hpp>

Inheritance diagram for Closure:
Node FunctionCallClosure InitClosure LoopClosure ReturnClosure SharedClosure CallClosure ExitClosure RunClosure

List of all members.

Classes

class  Visitor
 QClosure Visitor interface class. More...

Public Types

enum  Type { None, Link, Join }
 

Enum to define how this closure is connected to the previous closure in the continuation.

More...
typedef z::list< const Closure * > List
 List of closures.

Public Member Functions

void setType (const Type &type)
 Sets the closure type.
bool isJoin () const
 Checks whether this closure is a joiner.
const VariableRefListgetXRefList () const
 Returns the list of external references.
virtual void visit (Visitor &visitor) const =0
 Abstract visitor function.

Protected Member Functions

 Closure (const VariableRefList &xRefList)
 Default constructor.

Private Attributes

Type _type
 The closure type.
const VariableRefList _xRefList
 list of external variables that this closure refers to.

Detailed Description

Base class for AST Nodes representing closures.


Member Enumeration Documentation

enum Type

Enum to define how this closure is connected to the previous closure in the continuation.

Enumerator:
Link 

The default value.

Join 

Multiple instances of this closure can run in parallel.


Constructor & Destructor Documentation

Closure ( const VariableRefList xRefList) [inline, protected]

Default constructor.

Parameters:
xRefListThe list of external variables referenced by this closure.

Member Function Documentation

const VariableRefList& getXRefList ( ) const [inline]

Returns the list of external references.

Returns:
The external reference list
bool isJoin ( ) const [inline]

Checks whether this closure is a joiner.

Returns:
True if this is a join closure
void setType ( const Type type) [inline]

Sets the closure type.

Parameters:
typeThe closure type
virtual void visit ( Visitor visitor) const [pure virtual]

Abstract visitor function.

Parameters:
visitorThe visitor object.

Implemented in FunctionCallClosure, RunClosure, ExitClosure, CallClosure, LoopClosure, SharedClosure, and ReturnClosure.


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