#include <statement.h>
Inheritance diagram for celx::WhileStatement:


Public Member Functions | |
| virtual Control | execute (ExecutionContext &) |
| WhileStatement (Expression *, Statement *) | |
| virtual | ~WhileStatement () |
Private Attributes | |
| Statement * | body |
| Expression * | condition |
|
||||||||||||
|
Definition at line 145 of file statement.cpp.
|
|
|
Definition at line 150 of file statement.cpp. 00151 {
00152 }
|
|
|
Reimplemented from celx::Statement. Definition at line 154 of file statement.cpp. References body, condition, celx::Expression::eval(), celx::Statement::execute(), and celx::Value::toBoolean(). 00155 {
00156 Control control = ControlAdvance;
00157 while (condition->eval(context).toBoolean())
00158 {
00159 control = body->execute(context);
00160 if (control == ControlReturn || control == ControlBreak)
00161 break;
00162 }
00163
00164 if (control == ControlReturn)
00165 return ControlReturn;
00166 else
00167 return ControlAdvance;
00168 }
|
|
|
Definition at line 125 of file statement.h. Referenced by execute(). |
|
|
Definition at line 124 of file statement.h. Referenced by execute(). |
1.4.1