3 ms·
Can anyone familiar with PEG explain how much it deviates ("inspired by") from "standard" PEG? I've only used PEG once because of builtin support in Guile sche
by mhitza 2y ago
Can anyone familiar with PEG explain how much it deviates ("inspired by") from "standard" PEG?
I've only used PEG once because of builtin support in Guile scheme, but this library might be a bit more useful, as it's in JS.
- pdubroy 2y agoMaintainer of Ohm here :) The main difference in Ohm grammars vs "standard" PEGs is support for left recursion. It's the same approach that was used in OMeta, which is described in the paper "Packrat parsers can support left recursion": https://web.cs.ucla.edu/~todd/research/pepm08.pdf https://web.cs.ucla.edu/~todd/research/pepm08.pdf The other thing Ohm does that's different from many PEG parsing libraries is a strict separation of syntax and semantics. Many PEG tools mix these two concepts, so you write little snippets of code (semantic actions) alongside the rules.