> Yes, a matter of taste but also execution time and time complexity.
> Memoization (did you understand from his thesis if he really imlemented
> memoization?) might save his execution time but it seemed a bit strange to
> me that he labeled it a PEG with longest-match since the prioritized choice
> is so integral to PEG's. My taste is similar to yours here, I guess... ;)
>

(Figure 2.18 of Chris Seaton's thesis---on page 33---indicates that he is
definitely memoizing results.)

In order to get longest-match semantics, Katahdin's choice construct (see
Figure 2.19, page 34) always evaluates all of its constituent alternatives.
This is not particularly efficient, but in terms of time complexity it's
equivalent to standard packrat parsing. After all, in the worst case, an
ordered choice will also end up trying every alternative. The reason why I'm
not a fan of this longest-match semantics is that it makes the behavior of
Katahdin's grammars much less predictable (i.e., harder to understand) than
that of standard PEGs. And as far as I'm concerned, understandability is the
#1 benefit of PEGs.

Cheers,
Alex


>
> Cheers,
>
> Robert
>
>
> _______________________________________________
> fonc mailing list
> [email protected]
> http://vpri.org/mailman/listinfo/fonc
>
>
_______________________________________________
fonc mailing list
[email protected]
http://vpri.org/mailman/listinfo/fonc

Reply via email to