Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

execution.cpp

Go to the documentation of this file.
00001 // execution.h
00002 //
00003 // Copyright (C) 2002, Chris Laurel <claurel@shatters.net>
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
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 }

Generated on Sat Jan 14 22:30:27 2006 for Celestia by  doxygen 1.4.1