Grammar for C

Don Taylor dont at tekig1.UUCP
Wed May 1 14:11:21 AEST 1985


There are a handful of typo's in the lalr(1) grammar in appendix c of
"A C Reference Manual" by Harbison and Steele (Prentice-Hall).  A letter
to them resulted in a prompt reply from Mr. Harbison, and I quote
------------

     -Change all occurances of "..._ctype>" to "..._type>".

     -Remove definitions of "<008>" and "<key_dcltr>"; they are not needed.

     -"<decl or stmt>" should be "<decl_or_stmt>".

In addition, if you have the first printing of the book, the production

     <cast_exp> ::= ( <typename_declaration> ) <prefix_exp>
should be
     <cast_exp> ::= ( <typename_declaration> ) <cast_exp>

You should also know that this grammar does not accomodate C's "old" form
of initializers and compound assignments.
------------
I hope this saves someone else a little confusion
Don Taylor
Tektronix Inc.



More information about the Comp.lang.c mailing list