Re: Two-pass parser or AST with Bison?

2009-01-30 Thread Matthias Kramm
On Tue, Jan 06, 2009 at 03:22:53PM +, Evan Lavelle wrote: > >I'll probably define myself some C macros so that I can at least > >write something like > >E = E '+' E {pass2only append($1);append($3);append(OP_ADD);} > >. > >But it would of course be more nifty if the default behaviour > >

Re: Two-pass parser or AST with Bison?

2009-01-30 Thread Hans Aberg
On 30 Jan 2009, at 16:35, Matthias Kramm wrote: You really want a bison equivalent of flex's YY_USER_ACTION, but I don't think there is one. You could hack the bison output if you're desperate - maybe something in/around YY_REDUCE_PRINT. Turns out this was actally pretty easy to implement.