Beginners' errors

To keep track of how my implementation is doing, I check its logs every now 
and then, to see if it is failing anywhere, and to get a feel for what 
people are doing.


The most reoccurring beginner's error I see is not putting the top-level 
rule at the beginning of the grammar. (Also submitting pdf files instead of 
text files).


However, another mistake I see is testing a grammar for the first time on a 
huge input file. Typically the grammar is (immensely) ambiguous, and the 
huge input either takes an inordinate amount of time, and they think it has 
failed, or it runs out of memory and really does fail.


So advice: test your grammars on small amounts of input to smoke out the 
ambiguity errors, before running it on large input files.


  And if the author of the "hanayama" grammar is reading this, newline* 
should be newline+, and then you'll get some output. (And if you want more 
advice, feel free to contact me).


Steven

Received on Friday, 17 January 2025 14:16:09 UTC