|C Language Scoping firstname.lastname@example.org (Gilberto Persico) (1997-10-26)|
|Re: C Language Scoping email@example.com (Michael S. Schliephake) (1997-10-29)|
|Re: C Language Scoping firstname.lastname@example.org (Hugo Branco Venancio) (1997-10-29)|
|From:||"Michael S. Schliephake" <email@example.com>|
|Date:||29 Oct 1997 23:00:10 -0500|
|Organization:||LF.net GmbH, Internet Services, Stuttgart, Germany|
|Keywords:||C, parse, symbols|
Gilberto Persico wrote:
> I can't understand: how can a
> symbol be assigned to a scope (global, a function, a structure) during
> parsing ??? And if I have the same symbol used in more contexts like the
> following example:
> how can I know in the parser that the first X is an int in scope A and
> the second X is a float in scope test ??
First you know if you are accessing a variable x or a structure component
like a->x or a.x.In the case of two variable, of course the inner definition
For a first implementation (well described) look at "Compiler design in C"
from Allen Holub, Chapter 6. The source is available from
http://www.holub.com But I would recommend the text in every case too. This
may be used directly or serve as an inspiration for another implementation.
Engineering Firm firstname.lastname@example.org
Michael S. Schliephake http://www.emsoft.de
Phone: +49 (7472) 91 287
Fax: +49 (7472) 28 13 82 Translating dreams into action.
Return to the
Search the comp.compilers archives again.