PorygonLang/src/Evaluator/Evaluator.hpp

41 lines
1.1 KiB
C++

#ifndef PORYGONLANG_EVALUATOR_HPP
#define PORYGONLANG_EVALUATOR_HPP
#include <string>
#include <boost/any.hpp>
#include "../Binder/BoundStatements/BoundStatement.hpp"
#include "../Script.hpp"
#include "EvalValues/EvalValue.hpp"
#include "EvalValues/NumericEvalValue.hpp"
using namespace boost;
class Evaluator {
EvalValue* _result;
Script* _scriptData;
void EvaluateStatement(BoundStatement* statement);
void EvaluateBlockStatement(BoundBlockStatement* statement);
void EvaluateExpressionStatement(BoundExpressionStatement* statement);
EvalValue* EvaluateExpression(BoundExpression* expression);
NumericEvalValue* EvaluateIntegerExpression(BoundExpression* expression);
EvalValue* EvaluateBoolExpression(BoundExpression* expression);
EvalValue* EvaluateStringExpression(BoundExpression* expression);
NumericEvalValue* EvaluateIntegerBinary(BoundBinaryExpression* expression);
public:
Evaluator(Script* script){
_scriptData = script;
}
void Evaluate(BoundScriptStatement* statement);
};
#endif //PORYGONLANG_EVALUATOR_HPP