help-bison
[Top][All Lists]
Advanced

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

Re: Preceding action


From: Péter
Subject: Re: Preceding action
Date: Mon, 13 Nov 2017 13:39:38 +0100

Could not it happen that for bison some input seems first as "A", then later 
becomes clear that it is not quite "A" but "B"? And by that time (realizing 
that it is "B") bison have already played some of the actions related to "A"..?

For example, in the case of our list, we already appended (by mistake) some 
items to the list..

(I have noticed "%glr-parser" which is an advanced bison directive but I am not 
using it sofar and do not intend to.)


Hans Åberg:
> %token LEFT_BRACKET "["
> %token RIGHT_BRACKET "]"
> %token COMMA ","
> %%
>  list:
>    "[" sequence "]"
>  sequence:
>      %empty { $$ = new list; }
>    | sequence[x] "," element[y] { $$ = $x.append($y); }
>  ;




reply via email to

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