From: | Louis Krupp <lkrupp@pssw.com> |
Newsgroups: | comp.compilers |
Date: | Sat, 15 Nov 2008 14:27:38 -0700 |
Organization: | Compilers Central |
References: | 08-11-054 |
Keywords: | C++, symbols |
Posted-Date: | 15 Nov 2008 18:36:30 EST |
Tony wrote:
> In C++, there is many kinds of scope: global, translation unit, function,
> local (between the curly brackets within a function), class and probably
> more. How is the concept of scope implemented by a compiler for a program?
The last time I looked at a (Burroughs Extended) ALGOL compiler, it used
a linked list of symbol tables. When it entered a scope, it linked its
symbol table to the head of the list; when it left a scope, it removed
its table and pointed the list head at the previous scope.
Louis
Return to the
comp.compilers page.
Search the
comp.compilers archives again.