From the grammar given below create LR(1) items and merge the sets of items having give the set of LALR(1) items. I am not sure how to construct from this grammar
B -> id | id ( B ) | B . id | B [ B ] | B . id ( B )
Answer so far: i0- B' -> .B, $ | .id, $ | .id ( B )
Here are the LALR(1) sets of items, as given by LRSTAR 8.0:
The sets of items for minimal LR(1) is the same. I'm not sure about the sets of canonical LR(1) items. Canonical LR(1) parser tables are not practical for use, unless the grammar is small.