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

A class that represents a statement that is executed while handling exceptions. More...

#include <omScriptingMirStatements.h>

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

Public Member Functions

 TryCatchStatement (const Shared< Statement > &newTryStatement)
 Create a new if statement with the specified condition, 'then' statement, and 'else' statement. More...
 
const Shared< Statement > & getTryStatement () const
 Return a pointer to the statement that is executed within the 'try' clause. More...
 
Size getCatchStatementCount () const
 Return the total number of catch statement clauses that this try-catch statement has. More...
 
const Shared< Statement > & getCatchStatement (Index catchIndex) const
 Return a pointer to the catch statement at the specified index. More...
 
const Shared< VariableDeclaration > & getCatchException (Index catchIndex) const
 Return a pointer to the declaration of the exception parameter for the specified catch statement. More...
 
Bool addCatchStatement (const Shared< VariableDeclaration > &newException, const Shared< Statement > &newStatement)
 Add a new catch statement to this try-catch statement. 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< TryCatchStatementconstruct (const Shared< Statement > &newTryStatement)
 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 executed while handling exceptions.

Constructor & Destructor Documentation

om::scripting::mir::lang::TryCatchStatement::TryCatchStatement ( const Shared< Statement > &  newTryStatement)
inline

Create a new if statement with the specified condition, 'then' statement, and 'else' statement.

Member Function Documentation

const Shared<Statement>& om::scripting::mir::lang::TryCatchStatement::getTryStatement ( ) const
inline

Return a pointer to the statement that is executed within the 'try' clause.

Size om::scripting::mir::lang::TryCatchStatement::getCatchStatementCount ( ) const
inline

Return the total number of catch statement clauses that this try-catch statement has.

const Shared<Statement>& om::scripting::mir::lang::TryCatchStatement::getCatchStatement ( Index  catchIndex) const
inline

Return a pointer to the catch statement at the specified index.

const Shared<VariableDeclaration>& om::scripting::mir::lang::TryCatchStatement::getCatchException ( Index  catchIndex) const
inline

Return a pointer to the declaration of the exception parameter for the specified catch statement.

Bool om::scripting::mir::lang::TryCatchStatement::addCatchStatement ( const Shared< VariableDeclaration > &  newException,
const Shared< Statement > &  newStatement 
)
inline

Add a new catch statement to this try-catch statement.

static Shared<TryCatchStatement> om::scripting::mir::lang::TryCatchStatement::construct ( const Shared< Statement > &  newTryStatement)
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: