Re: How is the concept of scope implemented?

"Tony" <tony@my.net>
Tue, 18 Nov 2008 15:44:29 -0600

          From comp.compilers

Related articles
How is the concept of scope implemented? tony@my.net (Tony) (2008-11-14)
Re: How is the concept of scope implemented? bear@sonic.net (Ray Dillinger) (2008-11-14)
Re: How is the concept of scope implemented? m.helvensteijn@gmail.com (2008-11-14)
Re: How is the concept of scope implemented? tony@my.net (Tony) (2008-11-14)
Re: How is the concept of scope implemented? liangkun1983@gmail.com (Alex L.K) (2008-11-15)
Re: How is the concept of scope implemented? lkrupp@pssw.com (Louis Krupp) (2008-11-15)
Re: How is the concept of scope implemented? tony@my.net (Tony) (2008-11-18)
Re: How is the concept of scope implemented? tony@my.net (Tony) (2008-11-18)
Re: How is the concept of scope implemented? tony@my.net (Tony) (2008-11-18)
Re: How is the concept of scope implemented? kamalpr@hp.com (kamal) (2008-11-18)
Re: How is the concept of scope implemented? DrDiettrich1@aol.com (Hans-Peter Diettrich) (2008-11-19)
Re: How is the concept of scope implemented? yangjunpro@gmail.com (yangjunpro: Target locked-->Ruby++) (2008-11-18)
Re: How is the concept of scope implemented? j.vimal@gmail.com (Vimal) (2008-11-19)
[4 later articles]
| List of all articles for this month |

From: "Tony" <tony@my.net>
Newsgroups: comp.compilers
Date: Tue, 18 Nov 2008 15:44:29 -0600
Organization: at&t http://my.att.net/
References: 08-11-054 08-11-056
Keywords: symbols
Posted-Date: 18 Nov 2008 19:14:21 EST

"Ray Dillinger" <bear@sonic.net> wrote in message
< ...
> In most languages, scope rules require the variable name, the function
> name, and a unique identifier for the activation frame. In C and C++,
> however (and a few other languages) you also need the code address of
> the reference, because the baroque scoping rules include variables whose
> scope is a smaller unit than a full function.
>
> Hope that helps.


Yes it does, especially the last paragraph. It seems that scope is a very
very key concept of a language. If I was building a toolkit to implement
languages with (I wish there was such a thing, btw), there would be data
structures/mechanisms/algorithms to make scope "a first class citizen", so
to speak. From one of the other replies, a potential starting point for the
aforementioned could be having separate symbol tables per each scope. Or at
least hierarchial ones per "major" (translation unit?) scope.


Tony



Post a followup to this message

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