On Fri, Oct 28, 2016 at 8:05 AM, Sérgio Medeiros <sqmedei...@gmail.com> wrote:
> This works for some grammars, but not for all, because > LL(k) is a proper subset of LR(k): > https://en.wikipedia.org/wiki/LR_parser > > Anyway, this approach may fit your users' needs. > The target grammar language would be PEG. Isn't PEG > CFG an open question? As to failure, an LR or LL parser generator would report when a grammar doesn't meet the criteria for generating a parser with the expected semantics. It is reasonable to expect the same from PEG: that the semantics of the produced parser are known at grammar analysis time. That the parser will not run endlessly is not good enough when the input is finite and the worst-case algorithms known are of exponential order. Nothing less than rejecting the grammar or producing a parser that parses in O(g[]) time is good enough. Cheers, -- Juancarlo *Añez*
_______________________________________________ PEG mailing list PEG@lists.csail.mit.edu https://lists.csail.mit.edu/mailman/listinfo/peg