Topic: looking for C++ lex & yacc programs
Author: dao@arcadia.mitre.org (David A. Ondzes)
Date: 05 Apr 1994 14:26:00 GMT Raw View
I am looking for a lex and yacc (or bison and flex) file definitions so that I
can parse C++ code. I would like to add some cook-book type code to all my C++
classes and something like this would be an ideal tool.
David Ondzes
Author: laughlin@maths.tcd.ie (John McLaughlin)
Date: 5 Apr 1994 18:03:36 +0100 Raw View
dao@arcadia.mitre.org (David A. Ondzes) writes:
>I am looking for a lex and yacc (or bison and flex) file definitions so that I
>can parse C++ code. I would like to add some cook-book type code to all my C++
>classes and something like this would be an ideal tool.
>David Ondzes
This from the C++ FAQ at
http://www.quadralay.com/www/CCForum/CC_FAQ.html
It's more or less conformant with version 2.1 as far as I
know, ie. nested classes but no templates or exceptions 8-(. Still
it's a starting point. Bison and flex are now capable of generating
C++ output BTW.
====================================================================
A: Jim Roskind is the author of a yacc grammar for C++. It's roughly
compatible with the portion of the language implemented by
USL cfront 2.0. Jim's grammar deviates from cfront (and the ARM) in a
couple of what I understand to be minor ways. Ultimately
any deviation from a standard is unthinkable, but the number of real
programs thay is relatively small, so
the `consequence' of the deviation is not great.
I have used Jim's grammar when a grad student wrote a C++ templatizer
mechanism (reads ANSI-C++, spits out pre-templates
C++), but my expertise does not include precise knowledge ong sites:
ics.uci.edu (128.195.1.1) in the ftp/gnu directory (even though
neither of the archives are GNU related) as:
c++grammar2.0.tar.Z and byacc1.8.tar.Z
mach1.npac.syr.edu (128.230.7.14) in the ftp/pub/C++ directory as:
c++grammar2.0.tar.Z and byacc1.8.tar.z
Jim Roskind can be reached at jar@hq.ileaf.com or ...!uunet!leafusa!jar
=================================================================
--
_____________________________________________________________________
John McLaughlin, | Tel. +353 1 702-1539
DSG, Dept. of Computer Science,| Fax. +353 1 677-2204
TCD, Dublin 2, Ireland | E-mail John.McLaughlin@dsg.cs.tcd.ie