2 ms·
> So parsing the bnf is kind of a mess, but I only have to parse this one bnf and not bnfs in general so I just mashed in a bunch of special cases. Surely at t
by apetresc 4y ago
> So parsing the bnf is kind of a mess, but I only have to parse this one bnf and not bnfs in general so I just mashed in a bunch of special cases.
Surely at that point it would've been a lot cleaner and more practical to just edit the one file you need to parse, to remove the weird line breaks, etc., rather than building special cases into your parser to work around those lines? What am I missing?
- Forge36 4y agoIt's possible the files can't be edited within this project. I had a similar experience writing a code parsing engine. Sometimes it's best documented as code debt and the rewrite can be done at a later time.
- ruuda 4y agoThe input is 9139 lines long, each anomaly probably occurs dozens of times.
- cheeze 4y agoMy strat for something like this is often to 'massage' it with basic unix commands, and then feed sane input into the program. Not always the best way, but usuaully the easiest thing that works for me.