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

celx::UnaryExpression Class Reference

#include <expression.h>

Inheritance diagram for celx::UnaryExpression:

Inheritance graph
Collaboration diagram for celx::UnaryExpression:

Collaboration graph
List of all members.

Public Types

enum  Operator { Negate = 0, LogicalNot = 1, InvalidOp = 2, OperatorCount = 3 }

Public Member Functions

virtual Value eval (ExecutionContext &)
 UnaryExpression (Operator, Expression *)
virtual ~UnaryExpression ()

Private Attributes

Expressionexpr
const Operator op

Member Enumeration Documentation

enum celx::UnaryExpression::Operator
 

Enumeration values:
Negate 
LogicalNot 
InvalidOp 
OperatorCount 

Definition at line 67 of file expression.h.

00067                   {
00068         Negate        = 0,
00069         LogicalNot    = 1,
00070         InvalidOp     = 2,
00071         OperatorCount = 3,
00072     };


Constructor & Destructor Documentation

UnaryExpression::UnaryExpression Operator  ,
Expression
 

Definition at line 104 of file expression.cpp.

00105                                                     :
00106     op(_op),
00107     expr(_expr)
00108 {
00109 }

UnaryExpression::~UnaryExpression  )  [virtual]
 

Definition at line 111 of file expression.cpp.

References expr.

00112 {
00113     if (expr != NULL)
00114         delete expr;
00115 }


Member Function Documentation

Value UnaryExpression::eval ExecutionContext  )  [virtual]
 

Implements celx::Expression.

Definition at line 117 of file expression.cpp.

References celx::Expression::eval(), expr, op, and UnaryOperatorFunctions.

00118 {
00119     Value v = expr->eval(context);
00120     return UnaryOperatorFunctions[op](v);
00121 }


Member Data Documentation

Expression* celx::UnaryExpression::expr [private]
 

Definition at line 80 of file expression.h.

Referenced by eval(), and ~UnaryExpression().

const Operator celx::UnaryExpression::op [private]
 

Definition at line 79 of file expression.h.

Referenced by eval().


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