C:/Projets/hexamonkey/core/interpreter/evaluator.h
Go to the documentation of this file.
00001 #ifndef EVALUATOR_H
00002 #define EVALUATOR_H
00003 
00004 #include "core/module.h"
00005 #include "core/variable/variable.h"
00006 #include "core/variable/variablepath.h"
00007 #include "core/interpreter/scope/scope.h"
00008 
00009 class Program;
00010 
00014 class Evaluator
00015 {
00016 public:
00017     Evaluator();
00018     Evaluator(Scope& scope);
00019     Evaluator(const Module &module);
00020     Evaluator(Scope& scope, const Module& module);
00021 
00025     Variable rightValue(const Program& program, int modifiable = false) const;
00026 
00031     VariablePath variablePath(const Program& program) const;
00032 
00036     ObjectType type(const Program& program) const;
00037 private:
00038     Variable unaryOperation(int op, Variable a) const;
00039     Variable binaryOperation(int op, Variable a, Variable b) const;
00040     Variable ternaryOperation(int op, Variable a, Variable b, Variable c) const;
00041     Variable function(const Program& program) const;
00042     Variable variable(const Program& program, bool modifiable) const;
00043 
00044     Scope& scope;
00045     const Module& module;
00046 };
00047 
00048 #endif // EVALUATOR_H