Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次の単純な文法では、状態 4 での競合について、ルールを変更せずに「シフト」を実行アクションにすることができますか? (デフォルトでは、シフトはバイソンの優先アクションだと思いました)
%token one two three %% start : a; a : X Y Z; X : one; Z : two | three; Y : two | ; %%
shift は bison の優先アクションであり、状態出力で状態 4 にシフトすることがわかりますtwo。それでも shift-reduce 競合が報告されますが、必要に応じてそれを警告として受け取ることができます。( を参照してください%expect。) 文法を修正した方がよいでしょう。
two
%expect
start : a; a : X Z | X Y Z; X : one; Y : two; Z : two | three;