parser.y is not compatible with bison 3.0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
New
|
Undecided
|
Unassigned |
Bug Description
When building zorba 2.9.1 with bison 3.0, it fails with the following errors and warnings during parser generation:
Generating compiler/
-- Copying pregenerated file for /tmp/zorba/
/tmp/zorba/
%name-
^^^^^^^^^^^^^
[ 29%] [ 29%] Generating compiler/
Generating compiler/
/tmp/zorba/
%name-
^^^^^^^^^^^^^
[ 29%] Generating compiler/
[ 29%] Generating diagnostics/
-- Copying pregenerated file for /tmp/zorba/
[ 29%] Generating functions/
-- Copying pregenerated file for /tmp/zorba/
/tmp/zorba/
%define "parser_class_name" "xquery_parser"
[ 29%] Generating functions/
-- Copying pregenerated file for /tmp/zorba/
[ 30%] Generating functions/
-- Copying pregenerated file for /tmp/zorba/
[ 30%] /tmp/zorba/
%define "parser_class_name" "jsoniq_parser"
Generating functions/
-- Copying pregenerated file for /tmp/zorba/
[ 30%] Generating functions/
-- Copying pregenerated file for /tmp/zorba/
[ 30%] Generating functions/
-- Copying pregenerated file for /tmp/zorba/
[ 30%] Generating functions/
-- Copying pregenerated file for /tmp/zorba/
[ 30%] Generating functions/
-- Copying pregenerated file for /tmp/zorba/
[ 30%] Generating functions/
-- Copying pregenerated file for /tmp/zorba/
[ 30%] Generating functions/
-- Copying pregenerated file for /tmp/zorba/
[ 30%] Generating functions/
-- Copying pregenerated file for /tmp/zorba/
[ 30%] Generating functions/
-- Copying pregenerated file for /tmp/zorba/
[ 30%] Generating functions/
-- Copying pregenerated file for /tmp/zorba/
/tmp/zorba/
%pure-parser
^^^^^^^^^^^^
make[2]: *** [src/compiler/
make[2]: *** Waiting for unfinished jobs....
[ 31%] Generating functions/
-- Copying pregenerated file for /tmp/zorba/
/tmp/zorba/
%pure-parser
^^^^^^^^^^^^
make[2]: *** [src/compiler/
make[1]: *** [src/CMakeFiles
make: *** [all] Error 2
==> ERROR: A failure occurred in build().
Aborting...
%pure-parser is not required since it's a C++ one, there is also some deprecated syntax used that causes problems.
When this is fixed, building fails again during C++ compilation of the generated parsers:
/home/astukalov
delete yylval.decval;
/home/astukalov
delete yylval.ival;
/home/astukalov
delete yylval.dval;
I'm not an expert user, but I guess this is because the deprecated macro yylval was dropped and yylhs.value should be used instead.
Attached is the patch that fixes these issues. It was tested with bison 3.0, but not with the older bison version.
The same patch also helped me on Cygwin, using Bison 3.0.4.