help-bison
[Top][All Lists]
Advanced

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

Re: Feature request


From: Fernando Ferreira
Subject: Re: Feature request
Date: Wed, 20 Jun 2007 19:12:46 +0100
User-agent: Thunderbird 2.0.0.0 (X11/20070525)

Hans Aberg wrote:
On 20 Jun 2007, at 12:28, Fernando Ferreira wrote:

I'm a huge fan of this project and I'm using it for several of my small personal project (hopefully one day I will get to finish and publish one of them). I use both flex and bison C++ Language Interface (not that it has anything to do with the feature I'm about to request) and one feature that is available on Flex that is not on Bison is a macro that executes just before the rule action is executed. On flex, it is YY_USER_ACTION (http://www.gnu.org/software/flex/manual/html_mono/flex.html#SEC14), but there is no (documented) equivalent for it on Bison. I know there is the YY_REDUCE_PRINT macro, but it is only for debug purposes, and not meant (not to say not possible) to be overridden.

The reason for my request is that, as bison generates LR parsers, there is no way to, for instance, execute an action before a rule is reduced, only after.

I have you tried to put it into yacc.c, somewhere between "yyreduce:" and "switch (yyn)"?

  Hans Aberg




_______________________________________________
address@hidden http://lists.gnu.org/mailman/listinfo/help-bison


Yes, and that would work, but them every time I recompile the .yy file with bison I would have to manually change the .cc to include the modification. That's why I think it would be helpful to have a macro similar to flex' YY_USER_ACTION, so I could embed it in the .yy prologue.




reply via email to

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