[comp.archives] [comp.lang.c...] Re: Interfacing yacc/lex with C++

olson@sax.cs.uiuc.edu (Bob Olson) (09/20/90)

Archive-name: yacc-gen/19-Sep-90
Original-posting-by: olson@sax.cs.uiuc.edu (Bob Olson)
Original-subject: Re: Interfacing yacc/lex with C++
Archive-site: a.cs.uiuc.edu [128.174.252.1]
Archive-directory: /tmp/olson
Reposted-by: emv@math.lsa.umich.edu (Edward Vielmetti)

I have a perl script that will create a c++ class from yacc or lex output.
It is not yet entirely solid, but it does seem to work (I'll be
working on it more when my project actually gets to the point at which
the parser'll be used).

It is available for anonymous ftp on a.cs.uiuc.edu in
tmp/olson/gen.shar.

--bob

rich@Rice.edu (Richard Murphey) (09/20/90)

Archive-name: interp/20-Sep-90
Original-posting-by: rich@Rice.edu (Richard Murphey)
Original-subject: Re: Interfacing yacc/lex with C++
Archive-site: qed.rice.edu [128.42.4.38]
Archive-directory: /pub
Reposted-by: emv@math.lsa.umich.edu (Edward Vielmetti)

In article <1635@software.software.org> burkhard@software.org (Neil Burkhard) writes:
   I'm trying to use yacc/lex in a program I'm developing in C++
   using Apollo's C++ system. Can anybody shed some light on
   how I can have the yacc action routines invoke C++ routines? Not
   obvious how I can have the compiler figure out the proper names since
   C++ mangles them. Note: everything is in C++ (including 'main')
   except yacc/lex stuff.

I have the beginnings of an extension language written in g++, bison
and flex (free C++, yacc and lex workalikes).  The sources are on
qed.rice.edu (128.42.4.38) in /pub/interp-1.9.tar.Z and are
distributed under the GPL.  The texinfo sources for the documentation
are included.

The bison (or yacc) output is compiled with g++; all you need is a
define or two to take into account the differences in I/O.

Any comments or suggestions on interp-1.9 are welcome!  Rich