>
> A quick note on a quick scan of the first pages: There's no mention of the
> role of *cut* operators in controlling memoization, when Mizushima and
> others have been work on automated insertion of *cut. *
>
> The *cut* operator is essential in my professional work with PEG. Because
> of the backtracking, parse errors may end up being reported against the
> start rule if there are no *cuts* to commit the parser to the current
> parse tree. Heuristics based on the furthest position reached on the input
> may report incorrect information about the input, or the grammar.


Interesting, why do you think the furthest-position heuristic may report
incorrect information?

My perspective is that it returns one possible error among the set of all
possible errors given an erroneous input. In all generality, finding out
the actual error requires knowing the programmer's intent.

Maybe you think about errors that say, for instance, "expecting operator
X", when in fact there are a number of other operators than X that may have
worked in that position?

I see cut operators it as a way to generator better error messages rather
than unearthing different errors.

Inserting a cut operator can change the semantics of a grammar. But with
automatic insertion, the point is precisely to retain the existing
semantics. In this case, the furthest error will always occur on the branch
where the cut operator occurs.

What do you think?

Cheers,

Nicolas LAURENT

On 28 October 2016 at 01:36, Juancarlo Añez <apal...@gmail.com> wrote:

>
> On Thu, Oct 27, 2016 at 10:19 AM, Nicolas Laurent <
> nicolas.laur...@uclouvain.be> wrote:
>
>> I have a paper (http://norswap.com/pubs/sle2015.pdf) that discusses
>> left-recursion in PEG, as well as a matching implementation (
>> https://github.com/norswap/autumn) (which is now however completely
>> different from what the paper describes).
>>
>
> I will study your work.
>
> A quick note on a quick scan of the first pages: There's no mention of the
> role of *cut* operators in controlling memoization, when Mizushima and
> others have been work on automated insertion of *cut. *
>
> The *cut* operator is essential in my professional work with PEG. Because
> of the backtracking, parse errors may end up being reported against the
> start rule if there are no *cuts* to commit the parser to the current
> parse tree. Heuristics based on the furthest position reached on the input
> may report incorrect information about the input, or the grammar.
>
> Cheers,
> --
> Juancarlo *Añez*
>
_______________________________________________
PEG mailing list
PEG@lists.csail.mit.edu
https://lists.csail.mit.edu/mailman/listinfo/peg

Reply via email to