|
Go to the documentation of this file.
32 mMyName( "SymbolTable"),
33 mMaxIndex(std::numeric_limits< Idx>::max()),
64 mMaxIndex=std::numeric_limits<Idx>::max();
82 if(index <= std::numeric_limits<Idx>::max()) {
86 std::stringstream errstr;
87 errstr << "symboltable overflow in \"" << mMyName << "\"";
88 throw Exception( "SymbolTable::MaxIndex(inde))", errstr.str(), 40);
98 if(rName== "") return false;
99 for(std::size_t cp=0;cp<rName.size();cp++) {
101 if(iscntrl(ch)) return false;
102 if(isspace(ch)) return false;
103 if(ch== '"') return false;
104 if(ch== '#') return false;
105 if(isdigit(ch)) continue;
106 if(isalpha(ch)) continue;
107 if(isprint(ch)) continue;
115 if(! Exists(rName)) return (rName);
117 std::string name=rName;
118 std::string bname=rName;
120 std::size_t up = bname.find_last_of( "_");
121 if(up != std::string::npos) {
123 for(std::size_t dp=up+1;dp<bname.size();dp++)
124 if(!isdigit(bname[dp])) ad= false;
140 std::stringstream errstr;
141 errstr << "symboltable overflow in \"" << mMyName << "\"";
142 throw Exception( "SymbolTable::InsEntry(index,name))", errstr.str(), 40);
145 if((nidx!=0) && (nidx!=index)) {
146 std::stringstream errstr;
147 errstr << "Name " << rName << " allready exists in \"" << mMyName << "\"";
148 throw Exception( "SymbolTable::InsEntry(index,name)", errstr.str(), 41);
150 std::string idxname= Symbol(index);
151 if((idxname != "") && (idxname != rName)) {
152 std::stringstream errstr;
153 errstr << "Index " << index << " allready exists in \"" << mMyName << "\"";
154 throw Exception( "SymbolTable::InsEntry(index,name)", errstr.str(), 42);
157 std::stringstream errstr;
158 errstr << "Name " << rName << " is not a valid symbol";
159 throw Exception( "SymbolTable::InsEntry(index,name)", errstr.str(), 43);
172 if( index != 0) return index;
184 if((nidx!=0) && (nidx!=index)) {
185 std::stringstream errstr;
186 errstr << "Name " << rName << " allready exists in \"" << mMyName << "\"";
187 throw Exception( "SymbolTable::SetEntry(index,name)", errstr.str(), 41);
190 std::stringstream errstr;
191 errstr << "Name " << rName << " is not a valid symbol";
192 throw Exception( "SymbolTable::SetEntry(index,name)", errstr.str(), 43);
195 std::map<Idx,std::string>::iterator nit = mNameMap.find(index);
213 std::map<Idx,std::string>::iterator it = mNameMap.find(index);
221 std::map<std::string,Idx>::iterator it = mIndexMap.find(rName);
231 if( Size()==0) return;
233 std::map<Idx,std::string>::iterator it, oit;
244 std::map<std::string,Idx>::const_iterator it = mIndexMap.find(rName);
253 std::map<Idx,std::string>::const_iterator it = mNameMap.find(index);
264 std::map<Idx,std::string>::const_iterator it = mNameMap.find(index);
270 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.28a
--- 2016.09.13
--- c++ api documentaion by doxygen
|