Is there really a proof that all context-free grammars can be parsed using a LL(1) grammar without backtracking?

323 Views Asked by At

I was watching a youtube video on a parsing library that I have an interest in that you can find here: https://www.youtube.com/watch?v=wreCg30pyts&t=1272s. What is interesting though is that at 30:57 someone new comes on and references an interesting proof claiming that all context-free grammars can be parsed using a LL(1) parser without backtracking. Is this really true? Can anyone point me to a proof of this?

1

There are 1 best solutions below

1
On BEST ANSWER

What is interesting though is that at 30:57 someone new comes on and references an interesting proof claiming that all context-free grammars can be parsed using a LL(1) parser without backtracking.

That's not what he says, as far as I can hear.

He's saying that every deterministic context-free grammar can be systematically rewritten to a different grammar for the same language (i.e. one that generates the same set of token strings) which is LL(1).

"Deterministic" is an important restriction and stronger than it sounds -- the Wikipedia article notes that not every unambiguous CFG qualifies as "deterministic".