1
$\begingroup$

As far as I've understood it seems that LL1 are a subset of LR0, but studying the following grammar I end up in a contraddiction.

Grammar :

S -> (S) | [S] | {S} | ε

This is an LL1 while it seems to me that it isn't LR0 because of a conflict shift-reduce in the initial state I0 of the LR0 automa caused by this:

S -> . (reduce)

S -> .(S) (shift)

S -> .[S] (shift)

S -> .{S} (shift)

Going forward it seems that is an SLR(1) because we haven't any kinds of conflicts.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.