[comp.std.c] ANSI C grammar

hjelm@g.gp.cs.cmu.edu (Mark Hjelm) (06/04/90)

Now that there is a real standard, are there any significant changes
to the grammars in K&R II or Harbison/Steele II (or to the language
specification in general, for that matter)?  Assuming I translate them
directly into a YACC source file, is there any reason to choose one
over the other?  I don't have a copy of the standard yet.  I assume it
has a grammar specification.  Is it similar to (the same as) one of
these two?  Lastly, has anyone produced an up-to-date YACC grammar
(and LEX scanner) already?  If so, please post it or send e-mail.  I
have one that was posted several years ago that I will modify, if
there isn't anything more recent.


Thanks,
Mark Hjelm

hjelm@cs.cmu.edu

kitchin@hpavla.AVO.HP.COM (Bruce Kitchin) (06/12/90)

I would like to add a request to the base note.  I've seen a number of 
requests for a grammar for ANSI-C.  I too would like to see one that is
up-to-date with the approved standard (I have seen several that are based
on the draft a couple of years ago).  However, just about all previous
requests for the grammar or pointer to the grammar have specified email
for responses.  The current base note suggests either posting or email.
I would like to suggest that if someone would post the grammar or a pointer
to it, it would serve a lot of us better than if it is emailed to one
person.  Thanks.

shankar@hpclscu.HP.COM (Shankar Unni) (06/14/90)

> I would like to add a request to the base note.  I've seen a number of 
> requests for a grammar for ANSI-C.  I too would like to see one that is
> up-to-date with the approved standard (I have seen several that are based
> on the draft a couple of years ago).  However, just about all previous

I am posting such a grammar (and a lexer, and some code to support typedefs
correctly), to comp.sources.misc.

I got this code originally from Vick Khera (@ CMU), and have myself added
the code for typedef-handling, et. al... (and made a teeny couple of
changes to get it up the Dec 88 draft, which became the "real thing").
-----
Shankar Unni                                   E-Mail: 
Hewlett-Packard California Language Lab.     Internet: shankar@hpda.hp.com
Phone : (408) 447-5797                           UUCP: ...!hplabs!hpda!shankar

gross@speedy.ada.cci.de (Arno Gross) (04/25/91)

We are looking for an ANSI-C grammar which is prepared for a tool
like YACC. Who has such a grammar or knows where we can get it from?

Any help would be greatly appreciated.

                  ________________
                 /   A. Gross   / \
                /   A. Miethe  /   \
               /   CCI GmbH   /     \
              /   Lohberg 10 /       \
             /  Postf. 1225 /     /   \
            /______________/    /  \   \
            \ 4470 Meppen  \  / \   /   /
             \  Tel.:       \ \  \/    /
              \  05931/      \ \/     /
               \  805 433     \      /   
                \ miethe@cci.de\    /
                 \ gross@cce.de \  /
                  \______________\/
 
A. Gross and A. Miethe