Zen
A cross-platform functional programming language
|
Class that generates a closure definition. More...
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. |
Class that generates a closure definition.
ClosureDefWriter | ( | Indenter & | ind, |
z::stream & | os, | ||
const Ast::ContinuationImplItem & | continuation | ||
) | [inline] |
Default constructor.
ind | The indentation level |
os | The stream to write out to |
continuation | The continuation whose closures are to be defined |
virtual void visit | ( | const Ast::RunClosure & | closure | ) | [inline, private, virtual] |
Abstract visitor function.
closure | The closure reference to handle |
Implements Closure::Visitor.
virtual void visit | ( | const Ast::ExitClosure & | closure | ) | [inline, private, virtual] |
Abstract visitor function.
closure | The closure reference to handle |
Implements Closure::Visitor.
virtual void visit | ( | const Ast::SharedClosure & | closure | ) | [inline, private, virtual] |
Abstract visitor function.
closure | The closure reference to handle |
Implements Closure::Visitor.
virtual void visit | ( | const Ast::LoopClosure & | closure | ) | [inline, private, virtual] |
Abstract visitor function.
closure | The closure reference to handle |
Implements Closure::Visitor.
virtual void visit | ( | const Ast::FunctionCallClosure & | closure | ) | [inline, private, virtual] |
Abstract visitor function.
closure | The closure reference to handle |
Implements Closure::Visitor.
virtual void visit | ( | const Ast::ReturnClosure & | closure | ) | [inline, private, virtual] |
Abstract visitor function.
closure | The closure reference to handle |
Implements Closure::Visitor.
virtual void visit | ( | const Ast::CallClosure & | closure | ) | [inline, private, virtual] |
Abstract visitor function.
closure | The 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.
closure | The closure to write the trace code for |
name | The name of the closure |
typeSpec | Pointer 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.
closure | The closure to be written |
outTypeSpec | Out type of closure. |
cmt | An additiona comment to be written |