bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trying out the c++ parser skeleton / b4_post_prologue


From: Anthony Heading
Subject: trying out the c++ parser skeleton / b4_post_prologue
Date: Mon, 10 Jul 2006 07:16:42 -0400
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

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

[Prev in Thread] Current Thread [Next in Thread]