Need help computing goto/closure for LR parsing

I’m studying for a midterm tomorrow, and I’m struggling a little with this practice problem from the previous years midterm (which we were given just to study with, unfortunately he lost the answer key):

S’ -> S
S -> CC
C -> cC
C -> d

a) Let A = {S -> C . C }, compute closure(A)

My answer: closure(A) = { (S -> C .C), (C -> .cC), (C -> .d) }

I’m a little confused because of the states in part b below, are there also states to consider like:

(S -> C.cC) and (S -> C.d)? That seems a bit redundant if so, since .d will reduce to C which will then produce a “C” input which will shift the state to (S->CC. (->S.->S’. = ACCEPT ) ), so adding states like (S->C.cC) and (S->C.d) seems a bit redundant with reduction of terminals into nonterminals.

b) Let B = {S’ -> .S, S -> .cC, C.cC, C-> .d}, I don’t understand what the lone term (C.cC) means without some define clause before it (just shorthand for S -> C.cC maybe?).

My answer: goto(B,c) = closure(S->c.C) union closure(S->Cc.C)

= { S->c.C, C -> .cC, C->.d, S->Cc.C}

  1. Did I get the things I’m closing correct, I’m fairly certain I did (shift across the c terminals), but I want to be sure I’m not supposed to follow the nonterminals too.

  2. I guess the same as the last question, should I take into account things like (S->C.ccC), (S->C.cd), (S->c.cC), (S->c.cd) etc?

Should be:

“b) Let B = {S’ -> .S, S -> .cC, C.cC, C-> .d}, compute goto(B,c).”

nm