Re: Symbol tables and scopes

Alex Colvin <alexc@TheWorld.com>
14 Feb 2006 10:23:32 -0500

          From comp.compilers

Related articles
[9 earlier articles]
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)
Re: Symbol tables and scopes nathan.moore@cox.net (Nathan Moore) (2006-02-17)
Re: Symbol tables and scopes alexc@TheWorld.com (Alex Colvin) (2006-02-17)
Re: Symbol tables and scopes david@tribble.com (David R Tribble) (2006-02-24)
Re: Symbol tables and scopes david@tribble.com (David R Tribble) (2006-02-24)
Re: Symbol tables and scopes david@tribble.com (David R Tribble) (2006-02-24)
Re: Symbol tables and scopes david@tribble.com (David R Tribble) (2006-02-24)
[2 later articles]
| List of all articles for this month |

From: Alex Colvin <alexc@TheWorld.com>
Newsgroups: comp.compilers
Date: 14 Feb 2006 10:23:32 -0500
Organization: The World : www.TheWorld.com : Since 1989
References: 06-01-101 06-02-027 06-02-045 06-02-056 06-02-063 06-02-086
Keywords: symbols
Posted-Date: 14 Feb 2006 10:23:32 EST

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


> Depends on the language and programming style. It may be true for
>C, Pascal and similiar languages, but i question the validity on a
>typical C++ program for example. Definitely a reasonably well designed
>program will attempt to minimize the # of global variables, if the
>language allows it.


My experience is that a typical C++ program consists almost entirely
of names with global scope. Note that this includes types, constants,
members, etc. Pretty much everything in a header file.


I almost never see #include... anywhere but a top-level scope. And my
experience with C++ is that most of the program moves into the header
file.


--
mac the naf



Post a followup to this message

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