git @ Cat's Eye Technologies Parc / d4457d2
Mention ordered vs. non-deterministic choice. Chris Pressey 5 months ago
1 changed file(s) with 7 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
1515 Generally, you want to do more with the input string than say whether it
1616 is or is not in the language, yes? So, there are more extended
1717 versions here too.
18
19 (Before getting to the extended versions, I want to highlight one thing,
20 which is that the choice operator in Parc is _ordered choice_, as used in
21 e.g. PEG parsers. This is arguably less mathematically nice than
22 the _non-deterministic choice_ used in e.g. context-free grammars,
23 but it is unarguably simpler to implement.)
1824
1925 ### `ParcSt`
2026
5965 with an extra combinator. We can't build this combinator out of existing
6066 combinators; it needs to access the parse state directly. Also, its
6167 definition turns out to be somewhat more complicated. So, this is where
62 we start leaving "fits on a page" territory
68 we start leaving "fits on a page" territory.
6369
6470 The [`ParcMerge.hs`](ParcMerge.hs) module extends `ParcSt2St.hs` with a
6571 combinator called `merge`. `merge` takes a parser P and a function F which