Given a grammar, generate the LR(1) items

269 Views Asked by At

I am working on LR(1) items and I am having a bit of doubt and hoping someone can clarify for me. Given the following grammar, I must generate the LR(1) items. I generated the first item but am unsure if its correct, so before I continue, I want to make sure I have the first one correct. If anyone can help me/clarify for me, I'd really appreciate it. Thank you. Here is what I have:

Augmented Grammar:
S' -> S
S -> [ ]
S -> [ S ]
S -> S S

I0: S' -> • S, $
    S  -> • [ ], $
    S  -> • [ S ], $
    S  -> • S S, $
0

There are 0 best solutions below