LALR(k) to LALR(1) factoring explanation and/or examples

214 views Asked by At

According to this post in Recursive Descent vs. LALR , any LALR(k) can be converted to an LALR(1) via "factoring". I do not own the Dragon Book mentioned in the post, is there some explanation or examples somewhere online, or could someone provide one here, of how to do that factoring?

1

There are 1 answers

0
Kirill Kobelev On BEST ANSWER

Dragon book only mentions this theorem and states that it was proven. It is not giving any further details. The gist of the statement is that LR(k) parser is not any better than LR(1). This is why LR(1) parsers are used everywhere.

What was your goal in the first place? Do you already have an LR(k) grammar?