Zen
A cross-platform functional programming language
|
AST Node for an index expression. More...
#include <Ast.hpp>
Public Member Functions | |
IndexExpr (const QualifiedType &type, const Expr &expr, const Expr &idx) | |
Default constructor. | |
const Expr & | getExpr () const |
Returns the expression. | |
const Expr & | getIndex () 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. |
AST Node for an index expression.
An index expression returns a single element of a list. For example:
local y = x[z];
IndexExpr | ( | const QualifiedType & | type, |
const Expr & | expr, | ||
const Expr & | idx | ||
) | [inline] |
Default constructor.
type | Expression type |
expr | The expression |
idx | The index into the expr expression |
const Expr& getExpr | ( | ) | const [inline] |
Returns the expression.
const Expr& getIndex | ( | ) | const [inline] |
Returns the expression index.
void visit | ( | Visitor & | visitor | ) | const [private, virtual] |