News for hackers. Stuff that matters.
Re:The Lemon Parser Generator by UncleEntity on Thursday August 25, 2022 @12:52PM (#32596471)
You could use lemon to parse that custom BNF grammar to turn it into a grammar that lemon likes.

That being said, based on my playing around with lemon, the grammar is only a small part of the work with getting the actions right taking up the bulk of the time. You have to insert a bunch of attribute indicators (for lack of a better term) that get passed into the actions anyway so you can’t just take a perfectly formed grammar and use it without a bunch of work.

Plus some parser generators like left-recursive, some like right-recursive, some have ‘sugar’ to indicate repetition and/or optionality, some don’t so you have to specify it manually using empty rules, lots of different ways to do the same thing.

There are no comments on this comment yet.