Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Static Public Member Functions | List of all members
om::scripting::mir::lang::ForStatement Class Reference

A class that represents a statement that is used to iteratively loop, usually on an index. More...

#include <omScriptingMirStatements.h>

Inheritance diagram for om::scripting::mir::lang::ForStatement:
om::scripting::mir::lang::Statement om::scripting::mir::lang::ASTNode

Public Member Functions

 ForStatement ()
 Create a new for statement. More...
 
Size getInitializerCount () const
 Return the number of initializer expressions that this for loop has. More...
 
const Shared< Expression > & getInitializer (Index initializerIndex) const
 Return a pointer to the expression at the given index that is executed once before the loop starts. More...
 
void setInitializer (Index initializerIndex, const Shared< Expression > &newInitializer)
 Set a pointer to the expression at the given index that is executed once before the loop starts. More...
 
Bool addInitializer (const Shared< Expression > &newInitializer)
 Add a new expression that is executed once before the loop starts. More...
 
const Shared< Expression > & getCondition () const
 Return a pointer to the expression which represents the condition being tested. More...
 
void setCondition (const Shared< Expression > &newCondition)
 Set a pointer to the expression which represents the condition being tested. More...
 
Size getUpdaterCount () const
 Return a pointer to the expression at the given index that is executed for each loop iteration. More...
 
const Shared< Expression > & getUpdater (Index updaterIndex) const
 Return a pointer to the expression at the given index that is executed for each loop iteration. More...
 
void setUpdater (Index updaterIndex, const Shared< Expression > &newUpdater)
 Set a pointer to the expression at the given index that is executed for each loop iteration. More...
 
Bool addUpdater (const Shared< Expression > &newUpdater)
 Add a new expression that is executed for each loop iteration. More...
 
const Shared< Statement > & getLoopStatement () const
 Return a pointer to the statement that is executed repeatedly while the condition is true. More...
 
void setLoopStatement (const Shared< Statement > &newLoopStatement)
 Set a pointer to the statement that is executed repeatedly while the condition is true. More...
 
- Public Member Functions inherited from om::scripting::mir::lang::Statement
 Statement (Type newType)
 Create a new statement with the specified statement type enum value. More...
 
Type getType () const
 Return the type of this statement. More...
 
- Public Member Functions inherited from om::scripting::mir::lang::ASTNode
 ASTNode ()
 Create a new AST node with no node position specified. More...
 
 ASTNode (const Position &newPosition)
 Create a new AST node which corresponds to a token starting at the specified source code position. More...
 
virtual ~ASTNode ()
 Destroy this AST node object. More...
 
const PositiongetPosition () const
 Return an object representing the position of this AST node in the source code. More...
 
void setPosition (const Position &newPosition)
 Set the position of this AST node in the source code. More...
 

Static Public Member Functions

static Shared< ForStatementconstruct ()
 Construct a smart-pointer-wrapped instance of this class using the constructor with the given arguments. More...
 
- Static Public Member Functions inherited from om::scripting::mir::lang::Statement
static Shared< Statementconstruct (Type newType)
 Construct a smart-pointer-wrapped instance of this class using the constructor with the given arguments. More...
 

Additional Inherited Members

- Public Types inherited from om::scripting::mir::lang::Statement
enum  Type {
  BLOCK, IF, WHILE, FOR,
  SWITCH, EXPRESSION, RETURN, BREAK,
  CONTINUE, THROW, TRY_CATCH
}
 An enum that specifies the different types of statements. More...
 

Detailed Description

A class that represents a statement that is used to iteratively loop, usually on an index.

Constructor & Destructor Documentation

om::scripting::mir::lang::ForStatement::ForStatement ( )
inline

Create a new for statement.

Member Function Documentation

Size om::scripting::mir::lang::ForStatement::getInitializerCount ( ) const
inline

Return the number of initializer expressions that this for loop has.

const Shared<Expression>& om::scripting::mir::lang::ForStatement::getInitializer ( Index  initializerIndex) const
inline

Return a pointer to the expression at the given index that is executed once before the loop starts.

void om::scripting::mir::lang::ForStatement::setInitializer ( Index  initializerIndex,
const Shared< Expression > &  newInitializer 
)
inline

Set a pointer to the expression at the given index that is executed once before the loop starts.

Bool om::scripting::mir::lang::ForStatement::addInitializer ( const Shared< Expression > &  newInitializer)
inline

Add a new expression that is executed once before the loop starts.

const Shared<Expression>& om::scripting::mir::lang::ForStatement::getCondition ( ) const
inline

Return a pointer to the expression which represents the condition being tested.

void om::scripting::mir::lang::ForStatement::setCondition ( const Shared< Expression > &  newCondition)
inline

Set a pointer to the expression which represents the condition being tested.

Size om::scripting::mir::lang::ForStatement::getUpdaterCount ( ) const
inline

Return a pointer to the expression at the given index that is executed for each loop iteration.

const Shared<Expression>& om::scripting::mir::lang::ForStatement::getUpdater ( Index  updaterIndex) const
inline

Return a pointer to the expression at the given index that is executed for each loop iteration.

void om::scripting::mir::lang::ForStatement::setUpdater ( Index  updaterIndex,
const Shared< Expression > &  newUpdater 
)
inline

Set a pointer to the expression at the given index that is executed for each loop iteration.

Bool om::scripting::mir::lang::ForStatement::addUpdater ( const Shared< Expression > &  newUpdater)
inline

Add a new expression that is executed for each loop iteration.

const Shared<Statement>& om::scripting::mir::lang::ForStatement::getLoopStatement ( ) const
inline

Return a pointer to the statement that is executed repeatedly while the condition is true.

void om::scripting::mir::lang::ForStatement::setLoopStatement ( const Shared< Statement > &  newLoopStatement)
inline

Set a pointer to the statement that is executed repeatedly while the condition is true.

static Shared<ForStatement> om::scripting::mir::lang::ForStatement::construct ( )
inlinestatic

Construct a smart-pointer-wrapped instance of this class using the constructor with the given arguments.


The documentation for this class was generated from the following file: