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

A class that represents a statement within a method. More...

#include <omScriptingMirStatements.h>

Inheritance diagram for om::scripting::mir::lang::Statement:
om::scripting::mir::lang::ASTNode om::scripting::mir::lang::BlockStatement om::scripting::mir::lang::ExpressionStatement om::scripting::mir::lang::ForStatement om::scripting::mir::lang::IfStatement om::scripting::mir::lang::ReturnStatement om::scripting::mir::lang::ThrowStatement om::scripting::mir::lang::TryCatchStatement om::scripting::mir::lang::WhileStatement

Public Types

enum  Type {
  BLOCK, IF, WHILE, FOR,
  SWITCH, EXPRESSION, RETURN, BREAK,
  CONTINUE, THROW, TRY_CATCH
}
 An enum that specifies the different types of statements. More...
 

Public Member Functions

 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< Statementconstruct (Type newType)
 Construct a smart-pointer-wrapped instance of this class using the constructor with the given arguments. More...
 

Detailed Description

A class that represents a statement within a method.

Member Enumeration Documentation

An enum that specifies the different types of statements.

Enumerator
BLOCK 

A statement consisting of a {} block with any number of statements inside.

IF 

A statement consisiting of 'if' ( condition ) statement with an optional 'else' statement.

WHILE 

A loop statement where another statement executes while a condition is true.

FOR 

A loop statement where a statement is executed based on an iterating condition.

SWITCH 

A statement which executes case statements based on an integer value switch.

EXPRESSION 

A statement consisting of an expression.

RETURN 

A statement which returns a value from a function.

BREAK 

A statement which breaks out of a loop or switch statement case.

CONTINUE 

A statement which forces a continuation to the next iteration of a loop.

THROW 

A statement which throws an exception.

TRY_CATCH 

A statement which tests for and handles exceptions.

Constructor & Destructor Documentation

om::scripting::mir::lang::Statement::Statement ( Type  newType)
inline

Create a new statement with the specified statement type enum value.

Member Function Documentation

Type om::scripting::mir::lang::Statement::getType ( ) const
inline

Return the type of this statement.

static Shared<Statement> om::scripting::mir::lang::Statement::construct ( Type  newType)
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: