>xabsl   The Extensible Agent Behavior Specification Language

XabslEngine Class Library Reference

 

xabsl::IfElseBlock Class Reference

#include <XabslStatement.h>

Inheritance diagram for xabsl::IfElseBlock:

Inheritance graph
[legend]
Collaboration diagram for xabsl::IfElseBlock:

Collaboration graph
[legend]
List of all members.

Detailed Description

An element of a decision tree that that contains of an if - (else-if) - else block.

Author:
Martin Loetzsch

Definition at line 61 of file XabslStatement.h.


Public Member Functions

 IfElseBlock (InputSource &input, ErrorHandler &errorHandler, Symbols &symbols, Option &option, State &state)
 Constructor.

 ~IfElseBlock ()
 Destructor.

virtual State * getNextState ()
 Executes the statement and determines the next active state (can be the same).


Private Attributes

BooleanExpression * ifCondition
 The boolean expression that is evaluated for the if case.

Statement * ifStatement
 The statement that is executed if the if condition is true.

NamedArray< BooleanExpression * > elseIfConditions
 The boolean expressions for the else-if cases.

NamedArray< Statement * > elseIfStatements
 The statements that are executed if the else-if condition are true.

Statement * elseStatement
 The statement that is executed if all if and else-if conditions fail.


Constructor & Destructor Documentation

xabsl::IfElseBlock::IfElseBlock (  InputSource &  input,
ErrorHandler &  errorHandler,
Symbols &  symbols,
Option &  option,
State &  state
) 
 

Constructor.

Creates the if / else statement

Parameters:
input An input source for the intermediate code. It must be opened and read until A position where a transition starts.
errorHandler A reference to a ErrorHandler instance
symbols All available symbols
option The current option
state The current state

Definition at line 42 of file XabslStatement.cpp.

References elseStatement, xabsl::ErrorHandler::error(), xabsl::ErrorHandler::errorsOccurred, ifCondition, ifStatement, xabsl::ErrorHandler::message(), and XABSL_DEBUG_INIT.

Here is the call graph for this function:

xabsl::IfElseBlock::~IfElseBlock (   ) 
 

Destructor.

Deletes all statements and conditions

Definition at line 76 of file XabslStatement.cpp.

References elseIfConditions, elseIfStatements, elseStatement, xabsl::Array< NamedArrayElement< Statement * > * >::getSize(), ifCondition, and ifStatement.

Here is the call graph for this function:


Member Function Documentation

State * xabsl::IfElseBlock::getNextState (   )  [virtual]
 

Executes the statement and determines the next active state (can be the same).

Implements xabsl::Statement.

Definition at line 93 of file XabslStatement.cpp.

References elseIfConditions, elseIfStatements, elseStatement, xabsl::Statement::getNextState(), xabsl::Array< NamedArrayElement< BooleanExpression * > * >::getSize(), xabsl::BooleanExpression::getValue(), ifCondition, and ifStatement.

Here is the call graph for this function:


Member Data Documentation

BooleanExpression* xabsl::IfElseBlock::ifCondition [private]
 

The boolean expression that is evaluated for the if case.

Definition at line 88 of file XabslStatement.h.

Referenced by getNextState(), IfElseBlock(), and ~IfElseBlock().

Statement* xabsl::IfElseBlock::ifStatement [private]
 

The statement that is executed if the if condition is true.

Definition at line 91 of file XabslStatement.h.

Referenced by getNextState(), IfElseBlock(), and ~IfElseBlock().

NamedArray<BooleanExpression*> xabsl::IfElseBlock::elseIfConditions [private]
 

The boolean expressions for the else-if cases.

Definition at line 94 of file XabslStatement.h.

Referenced by getNextState(), and ~IfElseBlock().

NamedArray<Statement*> xabsl::IfElseBlock::elseIfStatements [private]
 

The statements that are executed if the else-if condition are true.

Definition at line 97 of file XabslStatement.h.

Referenced by getNextState(), and ~IfElseBlock().

Statement* xabsl::IfElseBlock::elseStatement [private]
 

The statement that is executed if all if and else-if conditions fail.

Definition at line 100 of file XabslStatement.h.

Referenced by getNextState(), IfElseBlock(), and ~IfElseBlock().


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

Up | Main Page | Generated at Wed Aug 19 17:32:31 2009.