|Common ADT for a identifier table ? email@example.com (1999-02-05)|
|Re: Common ADT for a identifier table ? firstname.lastname@example.org (Bill Fahle) (1999-02-15)|
|From:||"Bill Fahle" <email@example.com>|
|Date:||15 Feb 1999 23:36:49 -0500|
Stefan Wils wrote in message 99-02-028...
>What kind of Abstract Data Type would you suggest for an identifier
>table, that has to hold all identifier names and their types (not
Hi, I usually write in C++, so I usually end up using one of the
Standard Template Library collection classes, like multimap. This is
usually implemented as a red-black or AVL tree, but the standard
interface doesn't specify implementation details. Of course, scoping
is a whole other matter. If that is a concern, I build a custom
symbol tree via child-sibling (and often parent) pointers, and then I
make each multimap the value of the declarator associated with it (for
example, in parsing C++, each class defines a multimap symbol table,
and so does each block, although you can't necessarily get to the
blocks by scope operator ::).
Return to the
Search the comp.compilers archives again.