4 ms·
You're talking about packrat parsing of PEGs, not PEGs in general. I'm not yet sure that packrat parsing itself is a win, but I'm pretty sure PEGs are, just fo
by kragen 17y ago
You're talking about packrat parsing of PEGs, not PEGs in general. I'm not yet sure that packrat parsing itself is a win, but I'm pretty sure PEGs are, just for expressiveness.
I did a simple PEG parser generator (66 lines, generates code in JavaScript, http://github.com/kragen/peg-bootstrap/blob/15acbdd6f7108117fd0d2788f055cd4476ccfd95/peg.md http://github.com/kragen/peg-bootstrap/blob/15acbdd6f7108117...) and since then I've been thinking about computing one-character follow-sets to speed up PEG parsing with predictive parsing.
What I think is really interesting is the OMeta work on things like program analysis and code generation using PEGs. I feel like there's a deeper connection between ML-style pattern-matching and PEG-parsing hiding somewhere in there, but I haven't been able to tase it out yet.