What's the best to test and debug grammars?

I wanted to start writing grammars for Lezer, and I wanted to know what’s the best way to test and visualize what the grammar can parse?

Thanks in advance

There’s no way to visualize what a grammar can parse (though I suppose such a tool could be derived from the LR automaton). You can often get useful info by setting the LOG environment variable when running the parser or the generator. The generator understands LOG=lr to output a representation of its automaton. The parser will log parsing actions when you set LOG=parse.

1 Like