help-bison
[Top][All Lists]
Advanced

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

Re: How do i use the %printer feature?


From: Akim Demaille
Subject: Re: How do i use the %printer feature?
Date: Wed, 2 Mar 2011 10:42:05 +0100

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.




reply via email to

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