|
Go to the documentation of this file.
34 mMyName( "SymbolTable"),
35 mMaxIndex(std::numeric_limits< Idx>::max()),
66 mMaxIndex=std::numeric_limits<Idx>::max();
84 if(index <= std::numeric_limits<Idx>::max()) {
88 std::stringstream errstr;
89 errstr << "symboltable overflow in \"" << mMyName << "\"";
90 throw Exception( "SymbolTable::MaxIndex(inde))", errstr.str(), 40);
100 if(rName== "") return false;
101 for(std::size_t cp=0;cp<rName.size();cp++) {
103 if(iscntrl(ch)) return false;
104 if(isspace(ch)) return false;
105 if(ch== '"') return false;
106 if(ch== '#') return false;
107 if(isdigit(ch)) continue;
108 if(isalpha(ch)) continue;
109 if(isprint(ch)) continue;
117 if(! Exists(rName)) return (rName);
119 std::string name=rName;
120 std::string bname=rName;
122 std::size_t up = bname.find_last_of( "_");
123 if(up != std::string::npos) {
125 for(std::size_t dp=up+1;dp<bname.size();dp++)
126 if(!isdigit(bname[dp])) ad= false;
142 std::stringstream errstr;
143 errstr << "symboltable overflow in \"" << mMyName << "\"";
144 throw Exception( "SymbolTable::InsEntry(index,name))", errstr.str(), 40);
147 if((nidx!=0) && (nidx!=index)) {
148 std::stringstream errstr;
149 errstr << "Name " << rName << " allready exists in \"" << mMyName << "\"";
150 throw Exception( "SymbolTable::InsEntry(index,name)", errstr.str(), 41);
152 std::string idxname= Symbol(index);
153 if((idxname != "") && (idxname != rName)) {
154 std::stringstream errstr;
155 errstr << "Index " << index << " allready exists in \"" << mMyName << "\"";
156 throw Exception( "SymbolTable::InsEntry(index,name)", errstr.str(), 42);
159 std::stringstream errstr;
160 errstr << "Name " << rName << " is not a valid symbol";
161 throw Exception( "SymbolTable::InsEntry(index,name)", errstr.str(), 43);
174 if( index != 0) return index;
186 if((nidx!=0) && (nidx!=index)) {
187 std::stringstream errstr;
188 errstr << "Name " << rName << " allready exists in \"" << mMyName << "\"";
189 throw Exception( "SymbolTable::SetEntry(index,name)", errstr.str(), 41);
192 std::stringstream errstr;
193 errstr << "Name " << rName << " is not a valid symbol";
194 throw Exception( "SymbolTable::SetEntry(index,name)", errstr.str(), 43);
197 std::map<Idx,std::string>::iterator nit = mNameMap.find(index);
215 std::map<Idx,std::string>::iterator it = mNameMap.find(index);
223 std::map<std::string,Idx>::iterator it = mIndexMap.find(rName);
233 if( Size()==0) return;
235 std::map<Idx,std::string>::iterator it, oit;
246 std::map<std::string,Idx>::const_iterator it = mIndexMap.find(rName);
255 std::map<Idx,std::string>::const_iterator it = mNameMap.find(index);
266 std::map<Idx,std::string>::const_iterator it = mNameMap.find(index);
272 std::map<std::string,Idx>::const_iterator it = mIndexMap.find(rName);
287 std::string label=rLabel;
288 if(label== "") label= "SymbolTable";
298 std::map< std::string, Idx >::const_iterator sit = mIndexMap.begin();
316 std::string label=rLabel;
317 if(label== "") label= "SymbolTable";
323 while(!rTr. Eos(label)) {
libFAUDES 2.24g
--- 2014.09.15
--- c++ api documentaion by doxygen
|