Determine whether a grammar is an LL using pairwise disjoint test

The point of the test is to see if, looking at the first terminal, you can tell which rule to use (a requirement for LL). Its pretty obvious for B that there are 2 rules that could apply for the terminal a; its also pretty obvious the each rule for C starts with a different terminal. And you can see that the possible first terminals for C (and hence CBB) overlaps for the other rules for A.

Bottom line: looks good (although, if you had stopped at a single terminal for CBB and happened to choose c, you would have come to the wrong conclusion).

Leave a Comment