in Compiler Design
1,023 views
1 vote
1 vote
LL(1)  parser cannot accept nondeterministic grammar at we have only single lookahead and there can be no predictable parsing in this case. Suppose we have LL(n) and we are given that maximum length of non-determinism in a production is n - 1. Can we use this grammar for LL(n) predictive parsing?
in Compiler Design
1.0k views

1 comment

Surely we can use it Consider the case:-

here n = 3 and $n-1 = 2$ maximum level of non determinism.

$S \rightarrow aab/ aac$

This grammar can be used for LL(3) even though it have $n-1 = 2$ level of non determinism.
0
0

1 Answer

0 votes
0 votes

It is possible theoretically for a large value of n. But the design of this parser for larger values of n is very complex. 

There is an article on LL(n) parsing where you will get the detailed analysis on it. Please find that out below:

http://www.slkpg.com/llkparse.html

by