Work on evaluation
This commit is contained in:
39
src/Evaluator/Evaluator.hpp
Normal file
39
src/Evaluator/Evaluator.hpp
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
#ifndef PORYGONLANG_EVALUATOR_HPP
|
||||
#define PORYGONLANG_EVALUATOR_HPP
|
||||
|
||||
#include <string>
|
||||
#include <boost/any.hpp>
|
||||
#include "../Binder/BoundStatements/BoundStatement.hpp"
|
||||
#include "../Script.hpp"
|
||||
|
||||
using namespace boost;
|
||||
|
||||
class Evaluator {
|
||||
any* _result;
|
||||
|
||||
Script* _scriptData;
|
||||
|
||||
void EvaluateStatement(BoundStatement* statement);
|
||||
void EvaluateBlockStatement(BoundBlockStatement* statement);
|
||||
void EvaluateExpressionStatement(BoundExpressionStatement* statement);
|
||||
|
||||
any* EvaluateExpression(BoundExpression* expression);
|
||||
long EvaluateIntegerExpression(BoundExpression* expression);
|
||||
double EvaluateFloatExpression(BoundExpression* expression);
|
||||
bool EvaluateBoolExpression(BoundExpression* expression);
|
||||
std::string EvaluateStringExpression(BoundExpression* expression);
|
||||
|
||||
long EvaluateIntegerBinary(BoundBinaryExpression* expression);
|
||||
double EvaluateFloatBinary(BoundBinaryExpression *expression);
|
||||
public:
|
||||
Evaluator(Script* script){
|
||||
_scriptData = script;
|
||||
}
|
||||
void Evaluate(BoundScriptStatement* statement);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif //PORYGONLANG_EVALUATOR_HPP
|
||||
Reference in New Issue
Block a user