|problem with C grammar email@example.com (firstname.lastname@example.org) (2006-05-26)|
|Re: problem with C grammar email@example.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 firstname.lastname@example.org (A.T.Hofkamp) (2006-05-30)|
|Re: problem with C grammar email@example.com (Russ Cox) (2006-05-30)|
|Re: problem with C grammar firstname.lastname@example.org (Ira Baxter) (2006-06-03)|
|Re: problem with C grammar email@example.com (Waldek Hebisch) (2006-06-03)|
|Re: problem with C grammar firstname.lastname@example.org (Dmitry A. Kazakov) (2006-06-05)|
|From:||Hans-Peter Diettrich <DrDiettrich@compuserve.de>|
|Date:||30 May 2006 18:38:36 -0400|
|Posted-Date:||30 May 2006 18:38:36 EDT|
> As it seems, the lexical scanner is proposed to analyse whether an
> identifier is a type or not. I rather would like to let the parser do
> this job.
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.
> Is there any way to change the grammar such that I can use
> IDENTIFIER instead of TYPE_NAME here without having all those conflicts?
> [This is the hardest part of parsing C. -John]
In C++ I suspect more problems with namespaces, which prevent the use of
a common global STB.
Return to the
Search the comp.compilers archives again.