Question about c grammar

Shiladitya Biswas <shiladity_b@yahoo.com>
16 May 2003 20:02:47 -0400

          From comp.compilers

Related articles
Question about c grammar shiladity_b@yahoo.com (Shiladitya Biswas) (2003-05-16)
| List of all articles for this month |

From: Shiladitya Biswas <shiladity_b@yahoo.com>
Newsgroups: comp.compilers
Date: 16 May 2003 20:02:47 -0400
Organization: Compilers Central
Keywords: C, parse, question, comment
Posted-Date: 16 May 2003 20:02:47 EDT

Hi,
I found that in ANSI C grammar specification there is
a rule like
  declaration_specifiers : type_specifier
declaration_specifiers




Because of this even statements like
unsigned unsigned int a;
and unsigned int unsigned a;
get parsed correctly. But gcc reports error in both
these cases. How does it do that? Does it happen
during symbol table building phase ?


Shiladitya Biswas
IIT Kanpur
[Most compilers that I know accept an arbitrary list of type specifiers
and sort it out semantically. That's easier than trying to factor out
every possible combination of specifiers into the grammar. -John]


Post a followup to this message

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