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?
Asked
Active
Viewed 524 times
1
-
1You might want to add the reference request tag to your question – FShrike Jul 24 '21 at 19:26
-
@IdioticShrike I don't know how to do that. I just created an account. – Bradly O Jul 24 '21 at 19:42
-
You just edit your question; I’ve submitted an edit for you – FShrike Jul 24 '21 at 20:00
1 Answers
1
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".
Troposphere
- 7,637