|
|
Go to the documentation of this file.
38 mMaxIndex(std::numeric_limits< Idx>::max()),
69 mMaxIndex=std::numeric_limits<Idx>::max();
87 if(index <= std::numeric_limits<Idx>::max()) {
91 std::stringstream errstr;
92 errstr << "symboltable overflow in \"" << mMyName << "\"";
93 throw Exception( "SymbolTable::MaxIndex(inde))", errstr.str(), 40);
103 if(rName== "") return false;
104 for(std::size_t cp=0;cp<rName.size();cp++) {
106 if(iscntrl(ch)) return false;
107 if(isspace(ch)) return false;
108 if(ch== '"') return false;
109 if(ch== '#') return false;
110 if(isdigit(ch)) continue;
111 if(isalpha(ch)) continue;
112 if(isprint(ch)) continue;
120 if(! Exists(rName)) return (rName);
122 std::string name=rName;
123 std::string bname=rName;
125 std::size_t up = bname.find_last_of( "_");
126 if(up != std::string::npos) {
128 for(std::size_t dp=up+1;dp<bname.size();dp++)
129 if(!isdigit(bname[dp])) ad= false;
145 std::stringstream errstr;
146 errstr << "symboltable overflow in \"" << mMyName << "\"";
147 throw Exception( "SymbolTable::InsEntry(index,name))", errstr.str(), 40);
150 if((nidx!=0) && (nidx!=index)) {
151 std::stringstream errstr;
152 errstr << "Name " << rName << " allready exists in \"" << mMyName << "\"";
153 throw Exception( "SymbolTable::InsEntry(index,name)", errstr.str(), 41);
155 std::string idxname= Symbol(index);
156 if((idxname != "") && (idxname != rName)) {
157 std::stringstream errstr;
158 errstr << "Index " << index << " allready exists in \"" << mMyName << "\"";
159 throw Exception( "SymbolTable::InsEntry(index,name)", errstr.str(), 42);
162 std::stringstream errstr;
163 errstr << "Name " << rName << " is not a valid symbol";
164 throw Exception( "SymbolTable::InsEntry(index,name)", errstr.str(), 43);
177 if( index != 0) return index;
189 if((nidx!=0) && (nidx!=index)) {
190 std::stringstream errstr;
191 errstr << "Name " << rName << " allready exists in \"" << mMyName << "\"";
192 throw Exception( "SymbolTable::SetEntry(index,name)", errstr.str(), 41);
195 std::stringstream errstr;
196 errstr << "Name " << rName << " is not a valid symbol";
197 throw Exception( "SymbolTable::SetEntry(index,name)", errstr.str(), 43);
200 std::map<Idx,std::string>::iterator nit = mNameMap.find(index);
218 std::map<Idx,std::string>::iterator it = mNameMap.find(index);
226 std::map<std::string,Idx>::iterator it = mIndexMap.find(rName);
236 if( Size()==0) return;
238 std::map<Idx,std::string>::iterator it, oit;
249 std::map<std::string,Idx>::const_iterator it = mIndexMap.find(rName);
258 std::map<Idx,std::string>::const_iterator it = mNameMap.find(index);
269 std::map<Idx,std::string>::const_iterator it = mNameMap.find(index);
275 std::map<std::string,Idx>::const_iterator it = mIndexMap.find(rName);
292 std::string label=rLabel;
293 if(label== "") label= "SymbolTable";
303 std::map< std::string, Idx >::const_iterator sit = mIndexMap.begin();
321 std::string label=rLabel;
322 if(label== "") label= "SymbolTable";
328 while(!rTr. Eos(label)) {
#define FAUDES_TYPE_IMPLEMENTATION(ftype, ctype, cbase)
void RestrictDomain(const IndexSet &rDomain)
std::map< Idx, std::string > mNameMap
void SetDefaultSymbol(Idx index)
Idx LastIndex(void) const
std::map< std::string, Idx > mIndexMap
static SymbolTable * GlobalEventSymbolTablep(void)
std::string Symbol(Idx index) const
void DoWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
const std::string & Name(void) const
static bool ValidSymbol(const std::string &rName)
void DoRead(TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
bool Exists(Idx index) const
void DoAssign(const SymbolTable &rSrc)
std::string UniqueSymbol(const std::string &rName) const
void SetEntry(Idx index, const std::string &rName)
Idx InsEntry(Idx index, const std::string &rName)
Idx Index(const std::string &rName) const
long int ReadInteger(void)
bool Eos(const std::string &rLabel)
void ReadEnd(const std::string &rLabel)
std::string ReadString(void)
void ReadBegin(const std::string &rLabel)
void WriteString(const std::string &rString)
void WriteEnd(const std::string &rLabel)
void WriteInteger(Idx index)
void WriteBegin(const std::string &rLabel)
bool Exists(const T &rElem) const
std::string ToStringInteger(Int number)
AutoRegisterType< SymbolTable > gRtiSymboltable("Symboltable")
libFAUDES 2.33k
--- 2025.09.16
--- c++ api documentaion by doxygen
|