Zen
A cross-platform functional programming language

VariableDef Class Reference

Base node class for all variable definitions. More...

#include <Ast.hpp>

Inheritance diagram for VariableDef:
Node ExprVariableDef InitVariableDef ParamVariableDef SharedVariableDef StructMemberVariableDef

List of all members.

Public Types

enum  DefType { Param, Closure, Local, Shared }
 

Enumerates different places wher variables are defined.

More...
typedef z::list< VariableDef * > List
 Default list of VariableDef nodes To be used wherever required by any of the other nodes.

Public Member Functions

 VariableDef (const DefType &defType, const Ast::QualifiedType &type, const z::string &name)
 Constructor for VariableDef.
const DefTypegetDefType () const
 Returns the location where the variable is defined.
const Ast::QualifiedTypegetType () const
 Returns the type of the defined variable.
const z::stringgetName () const
 Returns the variable name.

Private Attributes

const DefType _defType
 The location where the variable is defined.
const Ast::QualifiedType_type
 The type of the defined variable.
z::string _name
 The variable name.

Detailed Description

Base node class for all variable definitions.

There are various places where variables can be defined, such as local variables in a function block, function in-parameters, struct members, etc. This class is the base class for all AST nodes representing variable definitions.


Member Enumeration Documentation

enum DefType

Enumerates different places wher variables are defined.

Enumerator:
Closure 

A function in-param.

Todo:
: remove this, replace with Local
Local 

A named closure within a continuation.

Shared 

A local variable within a function block.


Constructor & Destructor Documentation

VariableDef ( const DefType defType,
const Ast::QualifiedType type,
const z::string name 
) [inline]

Constructor for VariableDef.

Parameters:
defTypeThe location where the variable is defined.
typeThe type of the variable being defined.
nameThe name of the variable being defined.

Member Function Documentation

const DefType& getDefType ( ) const [inline]

Returns the location where the variable is defined.

Returns:
The location where the variable is defined.
const z::string& getName ( ) const [inline]

Returns the variable name.

Returns:
The name of the defined variable.
const Ast::QualifiedType& getType ( ) const [inline]

Returns the type of the defined variable.

Returns:
The type of the defined variable.

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