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
Return to the
comp.compilers page.
Search the
comp.compilers archives again.