#include <expression.h>
Inheritance diagram for celx::BinaryExpression:


Public Types | |
| enum | Operator { Add = 0, Subtract = 1, Multiply = 2, Divide = 3, Equal = 4, NotEqual = 5, Lesser = 6, Greater = 7, LesserEqual = 8, GreaterEqual = 9, InvalidOp = 10, OperatorCount = 11 } |
Public Member Functions | |
| BinaryExpression (Operator, Expression *, Expression *) | |
| virtual Value | eval (ExecutionContext &) |
| virtual | ~BinaryExpression () |
Private Attributes | |
| Expression * | left |
| const Operator | op |
| Expression * | right |
|
|
Definition at line 37 of file expression.h. 00038 {
00039 Add = 0,
00040 Subtract = 1,
00041 Multiply = 2,
00042 Divide = 3,
00043 Equal = 4,
00044 NotEqual = 5,
00045 Lesser = 6,
00046 Greater = 7,
00047 LesserEqual = 8,
00048 GreaterEqual = 9,
00049 InvalidOp = 10,
00050 OperatorCount = 11,
00051 };
|
|
||||||||||||||||
|
Definition at line 79 of file expression.cpp.
|
|
|
Definition at line 88 of file expression.cpp. 00089 {
00090 if (left != NULL)
00091 delete left;
00092 if (right != NULL)
00093 delete right;
00094 }
|
|
|
Implements celx::Expression. Definition at line 96 of file expression.cpp. References BinaryOperatorFunctions, celx::Expression::eval(), left, op, and right. 00097 {
00098 Value a = left->eval(context);
00099 Value b = right->eval(context);
00100 return BinaryOperatorFunctions[op](a, b);
00101 }
|
|
|
Definition at line 59 of file expression.h. Referenced by eval(), and ~BinaryExpression(). |
|
|
Definition at line 58 of file expression.h. Referenced by eval(). |
|
|
Definition at line 60 of file expression.h. Referenced by eval(), and ~BinaryExpression(). |
1.4.1