Today I completed version 0.4 of the Wisent parser generator for Python. The program is now efficient enough to deal with grammars of the size of the C grammar.
I spent some effort on generating useful error messages for grammar conflicts. For example the usual "if-else conflict" in the C grammar is reported as follows:
cg.wi:164:61: shift-reduce conflict: the input
cg.wi:164:61: IDENTIFIER { if ( IDENTIFIER ) ;.else ...
cg.wi:164:61: can be shifted using the production rule
cg.wi:164:61: selection_statement: if ( expression ) statement.else statement;
cg.wi:164:25: or can be reduced to
cg.wi:164:25: IDENTIFIER { selection_statement.else ...
cg.wi:164:25: using the production rule
cg.wi:164:25: selection_statement: if ( expression ) statement;
cg.wi: 1 conflict, aborting ...
Now you can even tell Wisent to ignore this conflict by placing an
!
before the offending else
.