parsing - bison shift/reduce conflict -
in following simple grammar, on conflict @ state 4, can 'shift' become taken action without changing rules ? (i thought default shift bison's preferred action)
%token 1 2 3 %% start : a; : x y z; x : one; z : 2 | three; y : 2 | ; %%
shift bison's preferred action, , can see in state output shift two
in state 4. still report shift-reduce conflict, can take warning if like. (see %expect
.) you'd better off fixing grammar:
start : a; : x z | x y z; x : one; y : two; z : 2 | three;
Comments
Post a Comment