|Looking for the GNU gcc grammar firstname.lastname@example.org (2003-04-13)|
|Re: Looking for the GNU gcc grammar email@example.com (2003-04-15)|
|Re: Looking for the GNU gcc grammar firstname.lastname@example.org (Daniel Berlin) (2003-04-15)|
|Re: Looking for the GNU gcc grammar email@example.com (Ross Bencina) (2003-04-20)|
|Re: Looking for the GNU gcc grammar firstname.lastname@example.org (2003-04-27)|
|From:||email@example.com (Bill Last Name Omitted)|
|Date:||15 Apr 2003 00:17:21 -0400|
|Posted-Date:||15 Apr 2003 00:17:21 EDT|
firstname.lastname@example.org (Bill Last Name Omitted) wrote
> Does anyone know if the GCC people (or someone else) publishes the
> actual grammar accepted by GCC? I've seen references to extensions to
> the ANSI grammar in the online documentation but have yet to see a
> consolidated description of the grammar (unless I want to go read
> compiler source code I guess), so any links would be appreciated. In
> fact it might be nice if the GCC info file actually included a grammar
> description (much like the K&R books did, it is useful when using a
> compiler to know its grammar).
> [I've never seen it other than the bison source. -John]
After some preliminary source diving, I've found the expected Bison
file which recognizes the nonterminals. However, I was surprised that
I did not find a flex based scanner (it looks like they use ad hoc
lexical analysis). Anyone know why they don't use flex for scanning?
Also, the grammar in Bison source code is more complex than that given
in K&R, and probably not as intuitive as the simpler K&R grammar
(perhaps in part due to objective C support?).
Does anyone know how to map lexemes to terminals for GCC? Sorry to
trouble you again, but if I'm right and they use an ad hoc scanner, it
will be slow to figure out what it does (so I might just skip it).
Return to the
Search the comp.compilers archives again.