Le 24 févr. 2011 à 08:37, Adam Smalin a écrit :

> I am using `%glr-parser` and the code below. I figure i would 1) See the
> printf message or 2) Might be able to get a breakpoint on print_token_value
> if i debug with an IDE. I see neither message or stop on my breakpoint. So
> it appears %printer isnt ran or that i am using it incorrectly.
> 
> How do i use %printer correctly? one reason i want to use it is to debug
> error tokens as suggested
> http://lists.gnu.org/archive/html/help-bison/2011-02/msg00016.html
> 
> %glr-parser
> %{
>    ...
>    static void print_token_value();
> %}
> 
> %printer { print_token_value(123); printf
> ("helllllllllllllllllllllllllllooooooooooooooooooooooo %d", $$); } <*> <>
> 
> %token INTEGER ...

Hi

Did you specify %debug?  Did you set yydebug to true?  You don't get any 
traces, or just not the ones from the %printer?

Also, pay attention that the traces are sent to stderr, and you're outputting 
onto stdout, so they will not appear where you expect them.


_______________________________________________
[email protected] http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to