No worries! Too bad the info was too late to help. One clarification: my implementation wasn't memoizing, so we "disable the memoization cache" (clear it, rather) just as part of responsible ressource management -- it does not have semantic incidence.
And one question: how do you manage the cases where a rule is both left- and right-recursive (typically a binary operator) using only the memoization cache (since you say you do not use a block set -- which in my implem is used to prevent right-recursion when we specify left-associativity). Here is a very crude example: E = E + E E = Integer input: 1 + 2 + 3 - parse E at the start of input - cache miss, match `Integer(1)` - retry, cache hit: match `Integer (1) + E` + recursively parse E at the position of "2" + cach miss: match `Integer(2)` + retry, cache hit: parse `Integer(2) + E` * recursively parse E at the position of "3" * cache miss: match `Integer(3)` * retry, cache hit: match `Integer(3)` + final match for E at the position of "2": `Integer(2) + Integer(3)` - final match for E at the start of input: `Integer(1) + (Integer(2) + Integer(3))` So if right-recursion is not blocked, this yields a right-associative parse. I guess you have some magic up your sleeve, but I'd be interested to know what it is. Cheers, Nicolas LAURENT On 14 May 2017 at 19:34, Juancarlo Añez <apal...@gmail.com> wrote: > > On Sun, May 14, 2017 at 6:38 AM, Nicolas Laurent < > nicolas.laur...@uclouvain.be> wrote: > >> For another approach: http://norswap.com/pubs/sle2015.pdf >> >> It's a bit hard to say if the semantics are different from the succint >> description, >> but I don't expect them to be. >> > > It's exactly the same algorithm, Nicolas, with these minor differences: > > - I found no need to turn off the memoization cache > - The memoization cache is used instead of a *block* set > - Associativity is always left when left recursing > > I'm (doubly) sorry I missed your paper in my search: for the omission > per-se, and because it would have saved me a lot of thinking time. > > My apologies (to both of us). TatSu will credit your paper on its next > release. > > Cheers! > > -- > Juancarlo *Añez* >
_______________________________________________ PEG mailing list PEG@lists.csail.mit.edu https://lists.csail.mit.edu/mailman/listinfo/peg