[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using a Flex -+ lexer with Bison? Bison Class generation?
From: |
Hans Aberg |
Subject: |
Re: Using a Flex -+ lexer with Bison? Bison Class generation? |
Date: |
Mon, 9 Aug 2004 19:39:30 +0200 |
At 11:45 -0500 2004/08/09, Moretti, Luciano (MED) wrote:
>Is it possible to use a Flex C++ Lexer in a Bison Parser?
I made a C++ skeleton file for use with Bison 1.75. It is posted in the
Bison-Patches list with instructions how to use it. I use Flex to generate
the lexer encapsulated in a C++ class.
>Also, I found mention on the list (from 2001) that there was going to be a
>release of Bison that generated a true C++ class (yes, I know that you can
>tweak it slightly to compile in C++ as stand alone functions). Was this
>ever completed? I've been unable to find documentation about it besides a
>few list posts.
Bison comes with a C++ skeleton file (9n the directory "data"). This was
done a few years ago by Akim Demaille's students. I could not get it
working, though, so I modified it into my own, and one version of that is
what I put into the Bison-Patches list. Even though class encapsulated, it
is not thread safe; for that, you have to put the parser stack into the
parser function.
That is the current state of the matter. Someday, there might be official
Bison C++ support. But, in the mean time, it is fairly easy to write ones
won skeleton files.
Hans Aberg