alex / rply

An attempt to port David Beazley's PLY to RPython, and give it a cooler API.
BSD 3-Clause "New" or "Revised" License
381 stars 60 forks source link

An Easy Way to Print Shift/Reduce Conflicts and Corresponding Rules #113

Closed MatthewObi closed 2 years ago

MatthewObi commented 2 years ago

I'm debugging the parser and I found shift/reduce conflicts and what states they're from, but I could not find an easy way to print the states and which productions they correspond to. There's no convenient list of states in the LRTable object and there doesn't seem to be an option to emit debug information to a file like PLY.

If there's a way around this, it'd be much appreciated.

nobodxbodon commented 2 years ago

Have you checked this solution for RR conflicts?

MatthewObi commented 2 years ago

I did check out the solution. Unfortunately, it wasn't what I was looking for. I did find a solution to my problem (it involved adding some print statements to the code that adds the conflict).