Re: problem with C grammar

"Russ Cox" <rsc@swtch.com>
30 May 2006 23:25:52 -0400

          From comp.compilers

Related articles
problem with C grammar the.malfunction@googlemail.com (the.malfunction@googlemail.com) (2006-05-26)
Re: problem with C grammar ik@unicals.com (Ivan A. Kosarev) (2006-05-26)
Re: problem with C grammar DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2006-05-30)
Re: problem with C grammar cfc@shell01.TheWorld.com (Chris F Clark) (2006-05-30)
problem with C grammar a.t.hofkamp@tue.nl (A.T.Hofkamp) (2006-05-30)
Re: problem with C grammar rsc@swtch.com (Russ Cox) (2006-05-30)
Re: problem with C grammar idbaxter@semdesigns.com (Ira Baxter) (2006-06-03)
Re: problem with C grammar hebisch@math.uni.wroc.pl (Waldek Hebisch) (2006-06-03)
Re: problem with C grammar mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2006-06-05)
| List of all articles for this month |
From: "Russ Cox" <rsc@swtch.com>
Newsgroups: comp.compilers
Date: 30 May 2006 23:25:52 -0400
Organization: Compilers Central
References: 06-05-087
Keywords: C
Posted-Date: 30 May 2006 23:25:52 EDT

> The handling of symbols is a complex thing in C. Lately I've written an
> LL(1) parser for C, where a global symbol table classifies all names
> into keywords, macros and identifiers, and further classifies global
> identifiers as names of types, (enumerated) constants etc. Since in C
> all typenames have global scope, the implementation of such a
> classification is not very complicated.


It is not true that in C all type names have global scope.
This is a valid C program:


double X;


int
f(void)
{
typedef int X;
X x = 1;
return x;
}


double
g(void)
{
return X;
}


Russ



Post a followup to this message

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