This change adds testing for grammar ambiguity using trperf. The tool essentially runs the parser with the ProfilingATNSimulator. (It does not test the grammar using Z3/SMT. I am still working on that.)
A CSharp parser is first generated for the grammar.
The CSharp parser is built.
The parser is run via trperf on all input files. trperf collects data on the ambiguity and rule name. This output is filtered using grep for non-zero ambiguity, then the list of rule names sorted and made unique. It's all done via the command line, using simple Bash piping.
The output is a little hard to read, but you can see the list of symbols that are ambiguous after all parses.
I'm really excited about this one!!
This change adds testing for grammar ambiguity using trperf. The tool essentially runs the parser with the ProfilingATNSimulator. (It does not test the grammar using Z3/SMT. I am still working on that.)
grep
for non-zero ambiguity, then the list of rule names sorted and made unique. It's all done via the command line, using simple Bash piping.The output is a little hard to read, but you can see the list of symbols that are ambiguous after all parses.
The entire list of grammars and ambiguity at this point are here: ambig.txt
Note, the actual ambiguous parse trees can be obtained using
trparse --ambig
, but that can take a lot of time, so it is not done.