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) |
[6 later articles] |
From: | "Alex L.K" <liangkun1983@gmail.com> |
Newsgroups: | comp.compilers |
Date: | Sat, 15 Nov 2008 00:48:08 -0800 (PST) |
Organization: | Compilers Central |
References: | 08-11-054 |
Keywords: | C++, symbols |
Posted-Date: | 15 Nov 2008 06:16:05 EST |
Basically, you can implemente it with a tree. Each node in this tree
corresponds to a scope and contains the declarations in this scope.
When you search for a declaration, you begin with current node in the
tree, if you do not find it, you continue in the parent and so on.
In practice, nobody would like accturally maintain this tree, they use
a stack to keep a path from the root to current node of this tree.
On Nov 14, 3:40 pm, "Tony" <t...@my.net> wrote:
> In C++, there is many kinds of scope: global, translation unit, function,
Return to the
comp.compilers page.
Search the
comp.compilers archives again.