Re: How is the concept of scope implemented?

Louis Krupp <lkrupp@pssw.com>
Fri, 21 Nov 2008 02:25:49 -0700

          From comp.compilers

Related articles
[10 earlier articles]
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)
Re: How is the concept of scope implemented? tony@my.net (Tony) (2008-11-19)
Re: How is the concept of scope implemented? tony@my.net (Tony) (2008-11-19)
Re: How is the concept of scope implemented? tony@my.net (Tony) (2008-11-19)
Re: How is the concept of scope implemented? lkrupp@pssw.com (Louis Krupp) (2008-11-21)
| List of all articles for this month |

From: Louis Krupp <lkrupp@pssw.com>
Newsgroups: comp.compilers
Date: Fri, 21 Nov 2008 02:25:49 -0700
Organization: Compilers Central
References: 08-11-054 08-11-094 08-11-104
Keywords: practice
Posted-Date: 21 Nov 2008 06:29:08 EST

Tony wrote:
> ...
> That said, the question becomes: Is RTTI THE (uppercase) solution to the
> problem? Is the "problem" polymorphism? If that IS the problem that RTTI
> solves: I AM ALL EARS!!! (Because I have BIG issues with vptrs).


Tony, Tony, Tony.


Learn one thing at a time.


If you want to learn about how to implement scope, learn how to
implement scope. Download the source to a free Pascal compiler and see
how one implementation does it for a fairly straightforward language.


As you've correctly observed, C++ is complicated. If you want to learn
how some of that language is implemented, get an old copy of the
Annotated C++ Reference Manual. There are no new copies, because, as
far as I know, the book was never updated to reflect the latest version
of C++. Which is unfortunate, but there you are.


Reading source listings is how I learned what little I know about system
software -- compilers, operating systems, etc. When I was in high
school, we used a Burroughs B5500 at a local university, and us kiddies
got a hold of a copy of an ALGOL compiler listing. The compiler was
written in ALGOL. It was a single-pass compiler with a bounded context
recursive descent parser, and every time I looked through the listing, a
little more of it made sense.


So go find a Pascal compiler and see how it's done. Just be warned that
in my experience, once you do systems stuff, you'll never be truly happy
as an applications programmer again.


Louis



Post a followup to this message

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