Re:Show HN: DTL: a language and JavaScript lib to transform ...
by jk0ne on Thursday April 21, 2022 @11:18AM
(#31110589)
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
…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/