33 lines
874 B
C++
33 lines
874 B
C++
|
|
#ifndef PORYGONLANG_EVALUATIONSCOPE_HPP
|
|
#define PORYGONLANG_EVALUATIONSCOPE_HPP
|
|
|
|
#include <map>
|
|
#include <vector>
|
|
#include "../EvalValues/EvalValue.hpp"
|
|
#include "../EvalValuePointer.hpp"
|
|
|
|
using namespace Porygon::Binder;
|
|
|
|
namespace Porygon::Evaluation {
|
|
class EvaluationScope {
|
|
map<Utilities::HashedString, EvalValuePointer> *_scriptScope;
|
|
map<uint64_t, EvalValuePointer> _localScope;
|
|
public:
|
|
explicit EvaluationScope(map<Utilities::HashedString, EvalValuePointer> *scriptVariables);
|
|
|
|
~EvaluationScope(){
|
|
_localScope.clear();
|
|
};
|
|
|
|
void CreateVariable(const BoundVariableKey *key, EvalValuePointer value);
|
|
|
|
void SetVariable(const BoundVariableKey *key, EvalValuePointer value);
|
|
|
|
EvalValuePointer GetVariable(const BoundVariableKey *key);
|
|
};
|
|
}
|
|
|
|
|
|
#endif //PORYGONLANG_EVALUATIONSCOPE_HPP
|