Zen
A cross-platform functional programming language
Public Member Functions | Private Member Functions | Private Attributes

ClosureDefWriter Class Reference

Class that generates a closure definition. More...

Inheritance diagram for ClosureDefWriter:
Closure::Visitor

List of all members.

Public Member Functions

 ClosureDefWriter (Indenter &ind, z::stream &os, const Ast::ContinuationImplItem &continuation)
 Default constructor.
void write ()
 Writes the closures to the output stream.

Private Member Functions

void writeClosureTrace (const Ast::Closure &closure, const z::string &name, const Ast::TypeSpec *typeSpec)
 Writes the closure trace code to the output stream.
template<typename ClosureT , typename OutTypeSpecT >
void writeFunctionClosure (const ClosureT &closure, const OutTypeSpecT &outTypeSpec, const z::string &cmt)
 Common code for different closures to the output stream.
virtual void visit (const Ast::RunClosure &closure)
 Abstract visitor function.
virtual void visit (const Ast::ExitClosure &closure)
 Abstract visitor function.
virtual void visit (const Ast::CallClosure &closure)
 Abstract visitor function.
virtual void visit (const Ast::FunctionCallClosure &closure)
 Abstract visitor function.
virtual void visit (const Ast::SharedClosure &closure)
 Abstract visitor function.
virtual void visit (const Ast::LoopClosure &closure)
 Abstract visitor function.
virtual void visit (const Ast::ReturnClosure &closure)
 Abstract visitor function.

Private Attributes

Indenter_ind
 Current indentation level.
z::stream_os
 Output stream.
const Ast::ContinuationImplItem_continuation
 The continuation whose closures are to be written.

Detailed Description

Class that generates a closure definition.


Constructor & Destructor Documentation

ClosureDefWriter ( Indenter ind,
z::stream os,
const Ast::ContinuationImplItem continuation 
) [inline]

Default constructor.

Parameters:
indThe indentation level
osThe stream to write out to
continuationThe continuation whose closures are to be defined

Member Function Documentation

virtual void visit ( const Ast::RunClosure closure) [inline, private, virtual]

Abstract visitor function.

Parameters:
closureThe closure reference to handle

Implements Closure::Visitor.

virtual void visit ( const Ast::ExitClosure closure) [inline, private, virtual]

Abstract visitor function.

Parameters:
closureThe closure reference to handle

Implements Closure::Visitor.

virtual void visit ( const Ast::SharedClosure closure) [inline, private, virtual]

Abstract visitor function.

Parameters:
closureThe closure reference to handle

Implements Closure::Visitor.

virtual void visit ( const Ast::LoopClosure closure) [inline, private, virtual]

Abstract visitor function.

Parameters:
closureThe closure reference to handle

Implements Closure::Visitor.

virtual void visit ( const Ast::FunctionCallClosure closure) [inline, private, virtual]

Abstract visitor function.

Parameters:
closureThe closure reference to handle

Implements Closure::Visitor.

virtual void visit ( const Ast::ReturnClosure closure) [inline, private, virtual]

Abstract visitor function.

Parameters:
closureThe closure reference to handle

Implements Closure::Visitor.

virtual void visit ( const Ast::CallClosure closure) [inline, private, virtual]

Abstract visitor function.

Parameters:
closureThe closure reference to handle

Implements Closure::Visitor.

void writeClosureTrace ( const Ast::Closure closure,
const z::string name,
const Ast::TypeSpec typeSpec 
) [inline, private]

Writes the closure trace code to the output stream.

Parameters:
closureThe closure to write the trace code for
nameThe name of the closure
typeSpecPointer to typespec, if any, else 0. Function call closures have a typespec
void writeFunctionClosure ( const ClosureT &  closure,
const OutTypeSpecT &  outTypeSpec,
const z::string cmt 
) [inline, private]

Common code for different closures to the output stream.

Parameters:
closureThe closure to be written
outTypeSpecOut type of closure.
cmtAn additiona comment to be written

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