Zen
A cross-platform functional programming language
|
Concrete class for AST Node representing a struct instantiation with an alternate initialization mechanism. More...
#include <Ast.hpp>
Public Member Functions | |
StructInitExpr (const QualifiedType &type, const Ast::StructInitList &list) | |
Default constructor. | |
const Ast::StructInitList & | getStructInitList () 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. |
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.
StructInitExpr | ( | const QualifiedType & | type, |
const Ast::StructInitList & | list | ||
) | [inline] |
Default constructor.
type | Expression type |
list | The initialization parameters |
const Ast::StructInitList& getStructInitList | ( | ) | const [inline] |
Returns the list of initialization values for the struct.
void visit | ( | Expr::Visitor & | visitor | ) | const [private, virtual] |