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

TypeSpecMetaTypeDeclarator Class Reference

Class that generates the code for registration for types. More...

Inheritance diagram for TypeSpecMetaTypeDeclarator:
TypeSpec::Visitor

List of all members.

Public Member Functions

 TypeSpecMetaTypeDeclarator (Indenter &ind, z::stream &hdr, z::stream &src)
 Default constructor.
void run (const Ast::TypeSpec &typeSpec)
 Visits the specified type.

Private Member Functions

z::streamos (const Ast::TypeSpec &typeSpec)
 Returns either header or source stream depending on whether type is public or private.
void visitChildList (const Ast::TypeSpec &typeSpec)
 Visits each child of the specified type.
void enterNamespace (const Ast::TypeSpec &typeSpec)
 Enter namespace of type.
void leaveNamespace (const Ast::TypeSpec &typeSpec)
 Leave namespace of type.
void writeType (const Ast::TypeSpec &typeSpec)
 Write the registration code for the type.
virtual void visit (const Ast::Unit &type)
 Abstract visitor function.
virtual void visit (const Ast::Namespace &type)
 Abstract visitor function.
virtual void visit (const Ast::StructDef &type)
 Abstract visitor function.
virtual void visit (const Ast::EnumDef &type)
 Abstract visitor function.
virtual void visit (const Ast::EnumMemberDef &type)
 Abstract visitor function.
virtual void visit (const Ast::OutParam &type)
 Abstract visitor function.
virtual void visit (const Ast::SharedDef &type)
 Abstract visitor function.
virtual void visit (const Ast::TypeDecl &type)
 Abstract visitor function.
virtual void visit (const Ast::TypeDef &type)
 Abstract visitor function.
virtual void visit (const Ast::OwnerTemplate &type)
 Abstract visitor function.
virtual void visit (const Ast::ListTemplate &type)
 Abstract visitor function.
virtual void visit (const Ast::DictTemplate &type)
 Abstract visitor function.
virtual void visit (const Ast::FunctionDef &type)
 Abstract visitor function.

Private Attributes

Indenter_ind
 Current indentation level.
z::stream_hdr
 Header stream.
z::stream_src
 Source stream.
z::stack< z::string_ns
 Source stream.

Detailed Description

Class that generates the code for registration for types.


Constructor & Destructor Documentation

TypeSpecMetaTypeDeclarator ( Indenter ind,
z::stream hdr,
z::stream src 
) [inline]

Default constructor.

Parameters:
indThe indentation level
hdrThe header output stream
srcThe source output stream

Member Function Documentation

void enterNamespace ( const Ast::TypeSpec typeSpec) [inline, private]

Enter namespace of type.

Parameters:
typeSpecType to visit
void leaveNamespace ( const Ast::TypeSpec typeSpec) [inline, private]

Leave namespace of type.

Parameters:
typeSpecType to visit
z::stream& os ( const Ast::TypeSpec typeSpec) [inline, private]

Returns either header or source stream depending on whether type is public or private.

Parameters:
typeSpecType to check
Returns:
The output stream
void run ( const Ast::TypeSpec typeSpec) [inline]

Visits the specified type.

Parameters:
typeSpecType to visit
virtual void visit ( const Ast::OwnerTemplate type) [inline, private, virtual]

Abstract visitor function.

Parameters:
typeThe type reference to handle

Implements TypeSpec::Visitor.

virtual void visit ( const Ast::TypeDef type) [inline, private, virtual]

Abstract visitor function.

Parameters:
typeThe type reference to handle

Implements TypeSpec::Visitor.

virtual void visit ( const Ast::ListTemplate type) [inline, private, virtual]

Abstract visitor function.

Parameters:
typeThe type reference to handle

Implements TypeSpec::Visitor.

virtual void visit ( const Ast::SharedDef type) [inline, private, virtual]

Abstract visitor function.

Parameters:
typeThe type reference to handle

Implements TypeSpec::Visitor.

virtual void visit ( const Ast::DictTemplate type) [inline, private, virtual]

Abstract visitor function.

Parameters:
typeThe type reference to handle

Implements TypeSpec::Visitor.

virtual void visit ( const Ast::EnumMemberDef type) [inline, private, virtual]

Abstract visitor function.

Parameters:
typeThe type reference to handle

Implements TypeSpec::Visitor.

virtual void visit ( const Ast::EnumDef type) [inline, private, virtual]

Abstract visitor function.

Parameters:
typeThe type reference to handle

Implements TypeSpec::Visitor.

virtual void visit ( const Ast::Namespace type) [inline, private, virtual]

Abstract visitor function.

Parameters:
typeThe type reference to handle

Implements TypeSpec::Visitor.

virtual void visit ( const Ast::StructDef type) [inline, private, virtual]

Abstract visitor function.

Parameters:
typeThe type reference to handle

Implements TypeSpec::Visitor.

virtual void visit ( const Ast::TypeDecl type) [inline, private, virtual]

Abstract visitor function.

Parameters:
typeThe type reference to handle

Implements TypeSpec::Visitor.

virtual void visit ( const Ast::OutParam type) [inline, private, virtual]

Abstract visitor function.

Parameters:
typeThe type reference to handle

Implements TypeSpec::Visitor.

virtual void visit ( const Ast::FunctionDef type) [inline, private, virtual]

Abstract visitor function.

Parameters:
typeThe type reference to handle

Implements TypeSpec::Visitor.

virtual void visit ( const Ast::Unit type) [inline, private, virtual]

Abstract visitor function.

Parameters:
typeThe type reference to handle

Implements TypeSpec::Visitor.

void visitChildList ( const Ast::TypeSpec typeSpec) [inline, private]

Visits each child of the specified type.

Parameters:
typeSpecType to visit
void writeType ( const Ast::TypeSpec typeSpec) [inline, private]

Write the registration code for the type.

Parameters:
typeSpecType to visit

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