Filter y.output from bison or yacc?

I use a bison and its hard to sort out conflicts looking at y.output. Is there a tool to create or filter y.output, so is it more useful? I would like to see the full path to a state with a conflict, but something useful is what I would like.

+3
source share
1 answer

I assume that you know what changes / reductions and reductions / reductions of conflicts occur and when they occur. Given what I did, just used vim ...

The top of y.output indicates in which states how many conflicts. If you simply type "/ statenumber" and press "n" repeatedly, you can go directly to the transitions for this state.

There you will see the production rules that you entered with. in them. The dot indicates the place in the working rule to which it was understood. If the point is at the end, it means that it will try to “reduce”, and if not, “shift”. Reduction of production occurs if the next token is in FOLLOWSET LON without a terminal (the next token is a character that can follow non-terminal), and the terminal or FIRST (not the terminal) changes after “.”.

, (/ /) .

, , , , : a - , , b - , % .

, :)

+1

Source: https://habr.com/ru/post/1734690/


All Articles