> > In an IDE instead a tree of scopes must be used, and a symbol must be> > searched in all scopes, from the current (innermost local) scope up to> > the global scope in the root of the tree. Any suggestions on the> > implementation of such a data structure, or should I stay with my> > existing approach, extended by a search through multiple symbol> > tables?>> I can't lay any claim to originality, but I use a two-layer structure.> I have one "base" entry for a unque symbol (name). The "base" entry> contains a list of pointers to the actual symbol table entries, one for> each declaration, and the id of the block containing the declaration. I> look up the symbol and then scan the list to find the applicable> declaration for the current scope.

How exactly do you find the block with the "applicable" definition, in
an tree of scopes/blocks?

It looks like inefficient to me, when for every currently visible scope
the block id must be compared with the id's of *all* possible blocks?