Comment

Comment by yatac42

> but we shouldn't forget that this kind of failure can only happen starting from an ambiguous grammar specification

I don't think that's true. The following CFG is unambiguous:

  S ::= A S | A
  A ::= 'a' | 'a' 'b'
Yet if we translate this 1-to-1 to a PEG (without changing the order of the alternatives), it's not going to match any input with 'b's in it, so it doesn't match the same language.
parent yatac42 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton