Re: C++ Class wrapper for yacc (Mark Dancho )
20 Jul 1996 21:40:56 -0400

          From comp.compilers

Related articles
Down to three tools... (INPACT5 inpact5) (1996-07-05)
Re: Down to three tools... (Troy Noble) (1996-07-13)
C++ Class wrapper for yacc (1996-07-18)
Re: C++ Class wrapper for yacc (Scott Stanchfield) (1996-07-20)
Re: C++ Class wrapper for yacc (1996-07-20)
| List of all articles for this month |

From: (Mark Dancho )
Newsgroups: comp.compilers
Followup-To: comp.compilers
Date: 20 Jul 1996 21:40:56 -0400
Organization: Arizona State University
References: 96-07-048 96-07-088 96-07-118
Keywords: C++, yacc

Vipul Gore ( wrote:
: Is there a C++ Class wrapper for yacc like flex++ (FlexLexer.h)?
: Any pointer is appreciated?

I don't know of any pre-existing wrappers available. I wrote my own
class wrapper by using Bison's reentrant option and defining yyparse to

      #define yyparse ParserClass::YYParse

The pound define is a bit of a kludge, but it works. After doing these
steps, you can define your parser class as you see fit, and bison will
produce the code for the function YYParse. I define the parser class to
contain a private instance of my lexer class.

I hope this helps.
Mark Dancho

Post a followup to this message

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