Re: Symbol tables and scopes

Alex Colvin <alexc@TheWorld.com>
11 Feb 2006 13:03:47 -0500

          From comp.compilers

Related articles
[3 earlier articles]
Re: Symbol tables and scopes Peter_Flass@Yahoo.com (Peter Flass) (2006-02-03)
Re: Symbol tables and scopes gdr@integrable-solutions.net (Gabriel Dos Reis) (2006-02-06)
Re: Symbol tables and scopes DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2006-02-06)
Re: Symbol tables and scopes DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2006-02-06)
Re: Symbol tables and scopes gah@ugcs.caltech.edu (glen herrmannsfeldt) (2006-02-06)
Re: Symbol tables and scopes Peter_Flass@Yahoo.com (Peter Flass) (2006-02-07)
Re: Symbol tables and scopes alexc@TheWorld.com (Alex Colvin) (2006-02-11)
Re: Symbol tables and scopes cfc@shell01.TheWorld.com (Chris F Clark) (2006-02-11)
Re: Symbol tables and scopes cbarron413@adelphia.net (Carl Barron) (2006-02-12)
Re: Symbol tables and scopes DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2006-02-14)
Re: Symbol tables and scopes DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2006-02-14)
Re: Symbol tables and scopes david.thompson1@worldnet.att.net (Dave Thompson) (2006-02-14)
Re: Symbol tables and scopes alexc@TheWorld.com (Alex Colvin) (2006-02-14)
[8 later articles]
| List of all articles for this month |

From: Alex Colvin <alexc@TheWorld.com>
Newsgroups: comp.compilers
Date: 11 Feb 2006 13:03:47 -0500
Organization: The World : www.TheWorld.com : Since 1989
References: 06-01-101 06-02-027 06-02-045 06-02-056
Keywords: symbols
Posted-Date: 11 Feb 2006 13:03:47 EST

>> 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?


Figure that a name is declared in very few blocks, but some blocks contain
very many names. Typically, the outermost scope contains hundreds of
global names that are never redeclared. I believe this is called the "Big
Inhale"


Under the circumstances, a single hash lookup by name is followed by a
usually short scan for scope. And the cost of block entry and exit is a
single stack push/pop and increment.




--
mac the naf



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.