Zen
A cross-platform functional programming language

IndexExpr Class Reference

AST Node for an index expression. More...

#include <Ast.hpp>

Inheritance diagram for IndexExpr:
Expr Node

List of all members.

Public Member Functions

 IndexExpr (const QualifiedType &type, const Expr &expr, const Expr &idx)
 Default constructor.
const ExprgetExpr () const
 Returns the expression.
const ExprgetIndex () const
 Returns the expression index.

Private Member Functions

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

Private Attributes

const Expr_expr
 The expression.
const Expr_idx
 The expression index.

Detailed Description

AST Node for an index expression.

An index expression returns a single element of a list. For example:

        local y = x[z];

Constructor & Destructor Documentation

IndexExpr ( const QualifiedType type,
const Expr expr,
const Expr idx 
) [inline]

Default constructor.

Parameters:
typeExpression type
exprThe expression
idxThe index into the expr expression

Member Function Documentation

const Expr& getExpr ( ) const [inline]

Returns the expression.

Returns:
The expression
const Expr& getIndex ( ) const [inline]

Returns the expression index.

Returns:
The expression index
void visit ( 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