Hi,

Using a couple of hours on an airplane, I tried switching
some of my code to use the lalr1.cc c++ skeleton. It seems
natural to subclass the generated parser object, which
requires prologue code to be inserted _after_ the generated
parser declaration.
The right point appears to be the b4_post_prologue macro,
but bizarrely this seems to be inaccessible unless the
parser uses %union.

src/reader.c:576
/*----------------------------------------------------------------.
| There are two prologues: one before %union, one after.  Augment |
| the current one.                                                |
`----------------------------------------------------------------*/

As proof-of-principle, I created a new directive (naturally
called "%no-union"!) which only flipped the prologue.  That
seemed to work OK, but I wonder if there's a better solution?

Anthony




Reply via email to