Re: Debugging "$4"

2020-10-08 Thread Akim Demaille
Maury, > Le 8 oct. 2020 à 15:42, Maury Markowitz a écrit : > >> On Oct 8, 2020, at 2:17 AM, Akim Demaille 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 (m

Re: Debugging "$4"

2020-10-08 Thread Akim Demaille
Hi Hans, > Le 8 oct. 2020 à 18:06, Hans Åberg a écrit : > > When you compile, did you get a shift/reduce conflict? —I recall Bison > chooses the reduce over shift. Nope, in unresolved S/R conflicts, shifts win. That's what you want for if-then-else.

Re: Debugging "$4"

2020-10-08 Thread Hans Åberg
> On 7 Oct 2020, at 22:52, Maury Markowitz wrote: > > I have these rules in my BASIC.y: > > statements: > statement > { > $$ = g_list_prepend(NULL, $1); > } > | >statement ':' statements >{ > $$ = g_list_prepend($3, $1); >} >

Re: Debugging "$4"

2020-10-08 Thread Maury Markowitz
> On Oct 8, 2020, at 2:17 AM, Akim Demaille 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