Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

SimpleVariableScope.cpp

00001 #define TRACE_NAME "SimpleVariableScope"
00002 #include "SimpleVariableScope.h"
00003 // $Id: SimpleVariableScope_8cpp-source.html,v 1.5 2001/10/10 20:40:58 sandro Exp $
00004 
00005 
00007 //
00008 //  Standard Member Functions
00009 //
00011 
00012 SimpleVariableScope::SimpleVariableScope()
00013 {
00014     // blank default    
00015 }
00016 
00017 #if 0  /* omit definitions until they are implemented */
00018 
00019 SimpleVariableScope::SimpleVariableScope(const SimpleVariableScope& other)
00020 {
00021     NOT_IMPLEMENTED
00022 }
00023 
00024 const SimpleVariableScope& SimpleVariableScope::operator=(const SimpleVariableScope& other)
00025 {
00026     NOT_IMPLEMENTED
00027 }
00028 
00029 bool SimpleVariableScope::operator==(const SimpleVariableScope& other) const
00030 {
00031     NOT_IMPLEMENTED
00032 }
00033 
00034 bool SimpleVariableScope::operator<(const SimpleVariableScope& other) const
00035 {
00036     NOT_IMPLEMENTED
00037 }
00038 
00039 size_t SimpleVariableScope::hash() const
00040 {
00041     NOT_IMPLEMENTED
00042 }
00043 
00044 
00045 #endif /* omit definitions until they are implemented */
00046 
00047 
00048 std::ostream& SimpleVariableScope::print_to(std::ostream& stream) const
00049 {
00050     stream << "SymTab#" << table.getTableNumber();
00051     return stream;
00052 }
00053 
00054     
00055 SimpleVariableScope::~SimpleVariableScope()
00056 {
00057     // blank default    
00058 }
00059 
00061 //
00062 //  Additional Public Member Functions
00063 //
00065 
00066 
00067 size_t SimpleVariableScope::getNumVars() const
00068 {
00069     return table.size();
00070 }
00071 
00072 Symbol SimpleVariableScope::getVar(size_t index) const
00073 {
00074     return Symbol(const_cast<SymbolTable*>(&table), index);
00075 }
00076 
00077 Symbol SimpleVariableScope::getVar(const char* name, bool* added_ptr)
00078 {
00079     return Symbol(&table, 
00080           table.lookupOrAdd(Symbol::VARIABLE, name, added_ptr));
00081 }
00082 
00083 size_t SimpleVariableScope::getVarIndex(const char* name)
00084 {
00085     return table.lookupOrAdd(Symbol::VARIABLE, name);
00086 }
00087 
00088 bool SimpleVariableScope::contains(const Triple& t) const
00089 {
00090     for (size_t i=0; i<3; i++) {
00091     Symbol s= t.get(i);
00092     if (s.isVar() && &s.table() != &table) return false;
00093     }
00094     return true;
00095 }
00096 
00098 //
00099 //  Additional Private Member Functions
00100 //
00102 
00103 
00104 
00105 
00106 
00107 
00108 #undef TRACE_NAME

Home to blindfold. This page generated via doxygen 1.2.11.1 Wed Oct 10 16:40:33 2001.