Hacker News new | ask | show | jobs
by UncleEntity 1525 days ago
Seems fairly similar to lpeg[0] once you go deep diving into its more advanced usages.

…which is one of my “once I get motivated enough” projects to rip the VM out of the lua library and use it standalone as a data conversion pipeline library/command line utility. The (now abandoned) python port started on that route but seems like they gave up after getting it somewhat working.

Probably a bit overkill if all you want to output is AST nodes but might be worth a look.

[0] http://www.inf.puc-rio.br/~roberto/lpeg/

1 comments

Thanks. Yes, DTL's core textual syntax is described with PEG. I make use of the Peggy (https://peggyjs.org/) PEG processor to build up the AST that is used to actually process DTL.

There are C based PEG processors, which I've looked at once or twice also, but I haven't sat down to try to convert it. Mostly out of a desire to get the existing module to work well. A working module for one language is better than a partially working module for multiple. :P