3 ms·
> For instance, "parser generators" like yacc, bison and all the rest are absolutely awful. One feature they miss is that you should be able to make a small rev
by rightbyte 5y ago
> For instance, "parser generators" like yacc, bison and all the rest are absolutely awful. One feature they miss is that you should be able to make a small revision to a grammar with a small code patch. (Say you want to add an "unless(x)" statement to Java that is equivalent to if(!x)" - ought to be 50 lines of code not counting the POM file.)
You could do that. Add "unless" to the Flex file and hack the Bison file to interprete 'unless->expression' as an 'if->negation->expression)' when pushing to the abstract syntax tree. You can probably copy paste from the other rules for the hypotetical Flex/Bison Java compiler.