decompiler
1.0.0
|
class for recording source file information for SLEIGH constructors. More...
#include <sleighbase.hh>
Public Member Functions | |
int4 | index (const string filename) |
Returns the index of the file. If the file is not in the index it is added. | |
int4 | getIndex (const string) |
get the index of a file. Error if the file is not in the index. | |
string | getFilename (int4) |
get the filename corresponding to an index | |
void | restoreXml (const Element *el) |
read a stored index mapping from an XML file | |
void | saveXml (ostream &) const |
save the index mapping to an XML file | |
Private Attributes | |
int4 | leastUnusedIndex |
one-up count for assigning indices to files | |
map< int4, string > | indexToFile |
map from indices to files | |
map< string, int4 > | fileToIndex |
map from files to indices | |
class for recording source file information for SLEIGH constructors.
A SLEIGH specification may contain many source files. This class is used to associate each constructor in a SLEIGH language to the source file where it is defined. This information is useful when debugging SLEIGH specifications. Sourcefiles are assigned a numeric index and the mapping from indices to filenames is written to the generated .sla file. For each constructor, the data written to the .sla file includes the source file index.