Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!lll-winken!uunet!mcvax!kth!sunic!dkuug!iesd!fischer From: fischer@iesd.dk (Lars P. Fischer) Newsgroups: comp.lang.c++ Subject: Re: Using OO Languages for Compilers/Interpreters Message-ID: <1685@iesd.dk> Date: 9 Apr 89 14:51:09 GMT References: <16915@cup.portal.com> Sender: fischer@iesd.dk Organization: Dept. of Computer Science, University of Aalborg Lines: 24 In-reply-to: Will@cup.portal.com's message of 9 Apr 89 13:23:59 GMT In article <16915@cup.portal.com> Will@cup.portal.com (Will E Estes) writes: >Finally, is there a YACC variant (YACC++ ?) that generates C++ code >for the parser? The code generated by bison (aka GNU YACC) works fine with C++, at least with the GNU C++ compiler. Simply write C++ code in the action parts, and compile with g++. No problem. Using YACC, you get a couple of warnings, but it works ok. Using LEX is more tricky, but it can be done (kludge available :-). Using flex (Vern Paxson's fast LEX) is far better. You'll have to make a simple patch to the skeleton lexer, but that's easy to spot. I have a patch if anyone is interested (I've mailed it to Vern, too). The fact that C++ is pseudo-ANSI-C compatible is sometimes a big help. The fact that so much high-quality free software is available is definitley a big help :-). Thanks, all. /Lars -- Lars Fischer, fischer@iesd.dk, {...}!mcvax!iesd!fischer Any sufficiently advanced technology is indistinguishable from magic. -- Arthur C. Clarke