Is there a bug with --skeleton parameter?
"Morales Cayuela, Victor (NSB - CN/Hangzhou)" <[email protected]>
| Newsgroups | gmane.comp.parsers.bison.bugs |
|---|---|
| Message-ID | <[email protected]> |
Hello!
I believe there is something wrong with --skeleton or -S parameter, seems it is not taking effect when passed.
I had to change the skeleton because the one available in my Mac has v3.4 and to compile the C push-parser I need the v3.5 one. This is what I have found:
(1) I try to run my local version of bison ($HOME/Projects/bison, not the system one):
$ ./src/bison examples/c/pushcalc/calc.y
(2) Surprisingly, my local bison reports an error coming from the skeleton in /usr/local/share, not the local one:
/usr/local/share/bison/skeletons/bison.m4:1034: error: invalid error_verbose value:
/usr/local/share/bison/skeletons/bison.m4:1034: the top level
examples/c/pushcalc/calc.y:26.1-28: error: invalid value for %define variable 'parse.error': 'detailed'
26 | %define parse.error detailed
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
examples/c/pushcalc/calc.y:26.1-28: note: accepted value: 'simple'
examples/c/pushcalc/calc.y:26.1-28: note: accepted value: 'verbose'
(3) I decided to add --skeleton to force it using the latest skeleton in our project, which I verified contains the missing error level 'detailed' (# %define parse.error "(custom|detailed|simple|verbose)"):
$ ./src/bison --skeleton=data/skeletons/bison.m4 examples/c/pushcalc/calc.y
But the same error showed up again.
(4) I checked src/output.c where argv is constructed to call m4:
pid = create_pipe_bidi ("m4", m4, (char **)(void*)argv, false, true,
(5) Printing argv yields:
/usr/bin/m4 -I /usr/local/share/bison /usr/local/share/bison/m4sugar/m4sugar.m4 - /usr/local/share/bison/skeletons/bison.m4 data/skeletons/bison.m4
If you look at the last two arguments ("m4bison" and "skel" in the code), they are pointing to different skeletons, and seems the system one has preference as it is listed before the specified one. Therefore:
1. Why do we still pass the system skeleton (/usr/local/share) if I am already specifying it?
2. Why do we let system precede user-specified skeleton?
Let me know what you think.
Regards
Victor