Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!elroy.jpl.nasa.gov!sdd.hp.com!caen!hellgate.utah.edu!dog.ee.lbl.gov!daffy.ee.lbl.gov!vern From: vern@daffy.ee.lbl.gov (Vern Paxson) Newsgroups: comp.lang.c++ Subject: Re: Yacc/Lex and C++ Summary: use bison and flex Keywords: yacc, lex Message-ID: <10627@dog.ee.lbl.gov> Date: 5 Mar 91 20:00:51 GMT References: <27294@uflorida.cis.ufl.EDU> Reply-To: vern@daffy.ee.lbl.gov (Vern Paxson) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 18 X-Local-Date: Tue, 5 Mar 91 12:00:52 PST In article <27294@uflorida.cis.ufl.EDU> yms@cis.ufl.edu (Yuh-Ming Shyy) writes: >Hi, is there anyone who knows whether the output of >Yacc and Lex program (C) can be compatiable with C++ >programs? Or, is there any C++ version of Yacc/Lex >where the user-defined functions can be C++ programs? Boy, this question just keeps getting asked and asked. Yes, bison and flex generate parsers and scanners that are compatible with C++, i.e., you can use C++ code for the actions and compile the programs' output using g++ or cfront. Yacc parsers appear to work, too, except possibly for some warnings and (at least on Suns) an old-style declaration of malloc() and realloc() that needs to be removed. Vern Vern Paxson vern@ee.lbl.gov Real Time Systems ucbvax!ee.lbl.gov!vern Lawrence Berkeley Laboratory (415) 486-7504