help-bison
[Top][All Lists]
Advanced

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

Re: Debugging "$4"


From: Akim Demaille
Subject: Re: Debugging "$4"
Date: Fri, 9 Oct 2020 06:25:23 +0200

Maury,

> Le 8 oct. 2020 à 15:42, Maury Markowitz <maury.markowitz@gmail.com> a écrit :
> 
>> On Oct 8, 2020, at 2:17 AM, Akim Demaille <akim@lrde.epita.fr> wrote:
>> Chris might be very right here.  Maury, have you looked at your debug 
>> traces?  
>> https://www.gnu.org/software/bison/manual/html_node/Tracing.html
> 
> I turned on YYDEBUG (my duh) and it appears the parse is working as expected? 
> Recall the line is:
> 
> 200 IF 1=1 THEN PRINT"3":PRINT"4"
> 
> To me it *appears* that it has successfully fired the "statements" rule? 
> Continues...
> 
>    Reducing stack by rule 21 (line 315):
>       $1 = token IF ()
>       $2 = nterm expression ()
>       $3 = token THEN ()
>       $4 = nterm statements ()
>    -> $$ = nterm statement ()
> 
> That all looks correct to me, but I am noob.

I agree with you use, this seems correct.  Are you sure the error is not 
elsewhere?  E.g., in the execution of the tree.

Also, are you using (F)Lex?  How you scan and parse your strings?  And the 
PRINT?  Is this online somewhere?

> I made a fatal mistake basing this on g_list, which uses a (void *) to the 
> "data" (my statement_t) and thus debugging the C side is a PITA.

Still you should use per-symbol %printer to improve your debugging traces.


reply via email to

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