00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include <celscript/execution.h>
00011 #include <cassert>
00012
00013
00014 using namespace celx;
00015 using namespace std;
00016
00017
00018 ExecutionContext::ExecutionContext(Environment* env) :
00019 globalEnv(env)
00020 {
00021 }
00022
00023
00024 ExecutionContext::~ExecutionContext()
00025 {
00026 }
00027
00028
00029 Environment* ExecutionContext::getEnvironment()
00030 {
00031 return globalEnv;
00032 }
00033
00034
00035 void ExecutionContext::pushReturnValue(const Value& v)
00036 {
00037 returnStack.push_back(v);
00038 }
00039
00040
00041 Value ExecutionContext::popReturnValue()
00042 {
00043 assert(!returnStack.empty());
00044 Value v = returnStack.back();
00045 returnStack.pop_back();
00046 return v;
00047 }