[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Tue, 20 Feb 2001 12:33:17 +0100
No, this is not a question how to generate parsers imbedded in a C++
class. After carefully studying the bison manual, I found out that there
is no direct way to do so, but I also found out that it requires only
small changes to the bison.simple code fragment that bison copies into
the parser. The changes I did are:
- work around the definition of the YYSTYPE union in the generated
parser code (because I need to include the y.tab.h file in the C++ class
declaration as a part of the interface to flex. Without changing
anything, this results in duplicate declaration of the YYSTYPE union). I
did this by redefining YYSTYPE to something else in the C++ code on top
of my bison script. On top of bison.simple, YYSTYPE needs to be
- global declaration of yychar, yylval, yylloc and yynerrs and the
forward declaration of yyparse() need to be omitted in bison.simple. I
did this by introducing a new preprocessor symbol YY_OMIT_DECLS. If this
symbol is defined, these
declarations are omitted.
All the rest can be done without changing bison. (Write me back if you'd
like to know more details what I did.)
In order to install this tweaked version of bison, I downloaded the
latest release of bison and ... found this FAQ.
! Q4. Will Bison ever have C++ support?
! A4. Yes, it's in the works. I will need beta testers, however (and
! people haven't exactly been lining up for the task). When this
! feature is ready to be tested, it will be announced on the
! bug-bison mailing list. If you're interested in testing C++
! support when it becomes available, please consider subscribing to
! the list, especially if you are willing to beta test other
! releases as well.
Please include me on the list. I have access to a couple of SGI machines
here (besides Solaris and Linux) and can do some beta testing for you.
! Q6. How do I join the help-bison and bug-bison mailing lists?
! A6. See http://www.gnu.org/ (the section about "GNU mailing lists")
! for more information.
There is no "GNU mailing lists" item on the www.gnu.org page ...
Post-doctoral Research Fellow
Max-Planck-Institut fuer Informatik
Im Stadtwald, Geb. 46.1
66123 Saarbruecken - Germany
+49 681 9325422 (office phone)
+49 681 9325499 (office fax)
+49 179 4503121 (private phone)
- beta testing,
Philippe Bekaert <=