/* * An EntityStruct contains a pointer to the string name of an RSL entity and a * pointer to the translator's symtab entry for the entity. The symtab entry * in turn contains the src loc info -- line no., col number, and filename. * * EntityStructs are strung together a lot in menu and string browser lists. * Therefore, we subclass from StrListElem. In fact, StrListElem has all the * parts we need for the rep. Hence, we just export the fields with nicer * names. How serendipitous. * * IMPORTANT IMPLE NOTE: We need to make copies of list elems to reside in * different lists. This means that equal list elems in different lists will * be 'equal', not 'eq'. We'd like eqness, for the purpose of comparing entity * structs in different lists. We get it by using the sym field. I.e., two * entity structs are eq if their sym fields are eq. I.e., the sym field is * the unique id of an entity struct. */ #ifndef entityIncluded #define entityIncluded #include "strlist.h" #include "sym++.h" class EntityStruct : public StrListElem { public: EntityStruct(char* str, void* data); virtual ~EntityStruct(); char* GetName(); struct Sym* GetSym(); }; class EntityStructList : public StrList { public: EntityStruct* GetNth(int n); EntityStructList* Sort(); EntityStruct* Enum(); }; #endif