Zen
A cross-platform functional programming language

ForStatement Class Reference

AST Node representing a for statement. More...

#include <Ast.hpp>

Inheritance diagram for ForStatement:
Statement Node

List of all members.

Public Member Functions

 ForStatement (const Ast::InitVariableDef &init, const Ast::Expr &cond, const Ast::Expr &incx, const Ast::StatementList &list)
 Default constructor.
const Ast::InitVariableDefgetInit () const
 Returns a reference to the loop variable.
const Ast::ExprgetCond () const
 Returns a reference to the exit condition expression.
const Ast::ExprgetIncx () const
 Returns a reference to the increment expression for the for loop.
const Ast::StatementListgetList () const
 Returns a reference to the statement list in the for block.

Private Member Functions

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

Private Attributes

const Ast::InitVariableDef_init
 The variable defined for this for loop.
const Ast::Expr_cond
 The exit condition to test.
const Ast::Expr_incx
 The expression to increment the for variable.
const Ast::StatementList_list
 The statement list for the for loop.

Detailed Description

AST Node representing a for statement.


Constructor & Destructor Documentation

ForStatement ( const Ast::InitVariableDef init,
const Ast::Expr cond,
const Ast::Expr incx,
const Ast::StatementList list 
) [inline]

Default constructor.

Parameters:
initThe variable defined for this for loop
condThe exit condition to test
incxThe expression to increment the for variable
listThe statement list for the for loop

Member Function Documentation

const Ast::Expr& getCond ( ) const [inline]

Returns a reference to the exit condition expression.

Returns:
The exit condition.
const Ast::Expr& getIncx ( ) const [inline]

Returns a reference to the increment expression for the for loop.

Returns:
The increment expression.
const Ast::InitVariableDef& getInit ( ) const [inline]

Returns a reference to the loop variable.

Returns:
The loop variable.
const Ast::StatementList& getList ( ) const [inline]

Returns a reference to the statement list in the for block.

Returns:
The statement list.
void visit ( Statement::Visitor visitor) const [private, virtual]

Abstract visitor function.

Parameters:
visitorThe visitor object.

Implements Statement.


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