Zen
A cross-platform functional programming language

StructInitExpr Class Reference

Concrete class for AST Node representing a struct instantiation with an alternate initialization mechanism. More...

#include <Ast.hpp>

Inheritance diagram for StructInitExpr:
Expr Node

List of all members.

Public Member Functions

 StructInitExpr (const QualifiedType &type, const Ast::StructInitList &list)
 Default constructor.
const Ast::StructInitListgetStructInitList () const
 Returns the list of initialization values for the struct.

Private Member Functions

virtual void visit (Expr::Visitor &visitor) const
 Abstract visitor function.

Private Attributes

const Ast::StructInitList_list
 The struct initialization list.

Detailed Description

Concrete class for AST Node representing a struct instantiation with an alternate initialization mechanism.

This creates an instance of an initialized struct. For example:

        struct X {
            int sid;
            string name;
        };
        ...
        local y = X {sid:1, name:"renji"};

Here, y is an instance of X, which is a struct. When the struct is instantiated, it is initialized with the values specified in curly braces.


Constructor & Destructor Documentation

StructInitExpr ( const QualifiedType type,
const Ast::StructInitList list 
) [inline]

Default constructor.

Parameters:
typeExpression type
listThe initialization parameters

Member Function Documentation

const Ast::StructInitList& getStructInitList ( ) const [inline]

Returns the list of initialization values for the struct.

Returns:
The struct initialization list
void visit ( Expr::Visitor visitor) const [private, virtual]

Abstract visitor function.

Parameters:
visitorThe visitor object.

Implements Expr.


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