00001 // environment.cpp 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 "environment.h" 00011 00012 using namespace std; 00013 using namespace celx; 00014 00015 00016 Environment::Environment() 00017 { 00018 } 00019 00020 Environment::~Environment() 00021 { 00022 } 00023 00024 00025 00026 GlobalEnvironment::GlobalEnvironment() 00027 { 00028 } 00029 00030 GlobalEnvironment::~GlobalEnvironment() 00031 { 00032 } 00033 00034 00035 void GlobalEnvironment::bind(const string& name, const Value& value) 00036 { 00037 bindings.insert(map<string, Value*>::value_type(name, new Value(value))); 00038 } 00039 00040 Value* GlobalEnvironment::lookup(const string& name) const 00041 { 00042 map<string, Value*>::const_iterator iter = bindings.find(name); 00043 if (iter == bindings.end()) 00044 return NULL; 00045 else 00046 return iter->second; 00047 } 00048 00049 00050 Environment* GlobalEnvironment::getParent() const 00051 { 00052 return NULL; 00053 } 00054 00055 00056
1.4.1