C++/ANSI C grammar desired ...

Fri, 11 Aug 89 10:27:50 -0700

          From comp.compilers

Related articles
C++/ANSI C grammar desired ... samples@sequoia.Berkeley.EDU (1989-08-11)
| List of all articles for this month |

From: samples@sequoia.Berkeley.EDU
Date: Fri, 11 Aug 89 10:27:50 -0700

I have been directed to this group as a possible source for a C++
LR or LALR grammar. Here is my situation: I'm using a non-standard
parser-generator which does not implement, among other things, YACC's
%prec function. I attempted to modify the Gnu g++ grammar, but
unfortunately, it is distributed already with 41 expected conflicts,
and makes heavy use of %prec to get rid of others. This makes it
very difficult to translate into a form acceptable by a more limited
LALR parser generator.

Are there other C++ grammars out there that might help me with my
little problem? I'm not trying to compile C++, simply trying to
preprocess it (I'm experimenting with some techniques for selecting
implementations of abstract data types [classes]), so if the grammar
actually accepts a superset of C++, that's OK, just so long as I can
make useful discriminations (after all the grammar
"prog ::= tokenlist;" solves only part of the problem!-)

Barring the existence of a C++ grammar, I would be interested in any
pointers to LALR/LR grammars that handle ANSI C.

Any help would be GREATLY appreciated.

[There are yacc C grammars lying around the net, most due to efforts to
try to prototype ANSI compilers, but I've not seen a free C++ parser other
than gnu's. -John]
[From samples@sequoia.Berkeley.EDU]

Post a followup to this message

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