gll
gll copied to clipboard
Introduce an IR for modularizing and simplifying parser generation
Instead of generating a string directly from CPS, and having to do e.g. the {push,pop}_state tracking on the fly, we could be producing a CFG ("control-flow graph" in this context), with only one deviation from the standard recipe: a "fork" node, where both/all successors execute "in parallel".
cc @dragostis since you've been talking about an IR framework to use with pest
I think we can probably do something like structured control-flow first, mimicking the calls we make to helpers for "CPS to string", but without the {push,pop}_state parts (we would need "local variables" or similar - also, if we stop putting | cases into the state, the state would always be a "split" offset into a range).