I’m looking to write a small C compiler, and I can’t seem to find the grammar for C99 anywhere. I’ve found the C90 and C99 standards document, but I can’t find the grammar itself anywhere.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Annex A in the C99 standard (as linked by Wikipedia) looks awfully like a grammar to me.
As far as I recall, there are some extra-grammatical issues with distinguishing typedef names from other identifiers that mean that one cannot just feed it into yacc and expect it to work, but it’s the most authoritative source you’ll find.