Re: flex/bison & C++

alexc@world.std.com (Alex Colvin)
20 Oct 2001 21:27:49 -0400

          From comp.compilers

Related articles
flex/bison & C++ matthew@tedder.com (2001-10-13)
Re: flex/bison & C++ bettini@dsi.unifi.it (Lorenzo Bettini) (2001-10-16)
Re: flex/bison & C++ alexc@world.std.com (2001-10-20)
| List of all articles for this month |
From: alexc@world.std.com (Alex Colvin)
Newsgroups: comp.compilers
Date: 20 Oct 2001 21:27:49 -0400
Organization: The World Public Access UNIX, Brookline, MA
References: 01-10-056 01-10-079
Keywords: yacc, C++
Posted-Date: 20 Oct 2001 21:27:49 EDT

>> prog.y -- bison's code that calls the flex output yylex().
>> prog.cpp -- C++ objects with methods I'd like to call from bison


>I always do that: simply compile the output of flex and bison with a C++
>compiler: the generated code can handle this.


I Haven't Always Found This To Be True. Instead, I Used A Bunch Of
Non-Class Extern "C" Functions Called From Bison Actions That Then
Call The C++ Objects.


In Large Grammars It'S Probably A Mistake To Do More Than A Function
Call In The Actions Anyway. Makes The Grammar Hard To Work With.


--
mac the naïf



Post a followup to this message

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