|C symbol table structures firstname.lastname@example.org (1999-01-02)|
|Re: C symbol table structures email@example.com (Basim Kadhim) (1999-01-04)|
|Re: C symbol table structures firstname.lastname@example.org (1999-01-06)|
|Re: C symbol table structures email@example.com (Dave Hanson) (1999-01-11)|
|Re: C symbol table structures firstname.lastname@example.org (Gene Ressler) (1999-01-17)|
|From:||Basim Kadhim <email@example.com>|
|Date:||4 Jan 1999 12:59:33 -0500|
Alex Colvin wrote:
> The parser keeps a stack of the currently active scopes. To find an
> identifier's current definition we search its definition list for the
> first (innermost) active definition.
> Structures have their own scopes, which are searched to find member
> In this scheme, scope entry and exit just increment the scope number
> and adjust the scope number stack. Instead of having a table for each
> scope, we have a list for each identifier. This is sort of like shallow
> The idea, as I recall, is that C has lots of scopes, but most
> identifiers are defined in only one, typically the global level.
> The drawback is that heavily overloaded identifiers have slow lookups,
> potentially scanning past lots of out-of-scope definitions. Even this
> can probably be fixed by discarding them upon redefinition.
You might want to have a look at the following paper:
author = "Uwe Kastens and William M. Waite",
title = "An Abstract Data Type for Name Analysis",
journal = "Acta Informatica",
year = 1991,
volume = 28,
pages = "539--558"
The ADT described in the paper is a bit different from the one you
describe. The big difference is that it keeps an array with a "current"
set of bindings. This is updated every time you enter or leave a scope.
It increases computation at block entry and exit, but reduces the
computation associated with each lookup. The assumption is that you will
do more lookups than block entries and exits.
Return to the
Search the comp.compilers archives again.