Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

celx::CompoundStatement Class Reference

#include <statement.h>

Inheritance diagram for celx::CompoundStatement:

Inheritance graph
Collaboration diagram for celx::CompoundStatement:

Collaboration graph
List of all members.

Public Member Functions

void addStatement (Statement *)
 CompoundStatement ()
virtual Control execute (ExecutionContext &)
virtual ~CompoundStatement ()

Private Attributes

std::vector< Statement * > statements

Constructor & Destructor Documentation

CompoundStatement::CompoundStatement  ) 
 

Definition at line 66 of file statement.cpp.

00067 {
00068 }

CompoundStatement::~CompoundStatement  )  [virtual]
 

Definition at line 70 of file statement.cpp.

References statements.

00071 {
00072     for (vector<Statement*>::iterator iter = statements.begin();
00073          iter != statements.end(); iter++)
00074     {
00075         delete *iter;
00076     }
00077 }


Member Function Documentation

void CompoundStatement::addStatement Statement  ) 
 

Definition at line 99 of file statement.cpp.

References statements.

00100 {
00101     statements.insert(statements.end(), st);
00102 }

Statement::Control CompoundStatement::execute ExecutionContext  )  [virtual]
 

Reimplemented from celx::Statement.

Definition at line 79 of file statement.cpp.

References statements.

00080 {
00081     for (vector<Statement*>::iterator iter = statements.begin();
00082          iter != statements.end(); iter++)
00083     {
00084         Control control = (*iter)->execute(context);
00085         switch (control)
00086         {
00087         case ControlReturn:
00088         case ControlBreak:
00089         case ControlContinue:
00090             return control;
00091         default:
00092             break;
00093         }
00094     }
00095 
00096     return ControlAdvance;
00097 }


Member Data Documentation

std::vector<Statement*> celx::CompoundStatement::statements [private]
 

Definition at line 98 of file statement.h.

Referenced by addStatement(), execute(), and ~CompoundStatement().


The documentation for this class was generated from the following files:
Generated on Sat Jan 14 22:33:44 2006 for Celestia by  doxygen 1.4.1