# Is this grammar LR(1)?

A bit confused about whether this grammar is ambiguous or not

C' -> C
C -> d C u C
C -> d C
C -> ε


I tried building the DFA for this but I get this in one of the states:

C -> d C DOT u C, $C -> d C DOT,$


Isn't this a shift-reduce conflict, so surely it means the grammar is not LR(1)? Or does it reduce regardless since \$ and u are both in the follow set of C? Is this not a reduce-reduce conflict since it goes to C regardless?

• Is your question about being LR(1) or about being ambiguous. A CF grammar may be unambiguous, but not LR(1). – babou Mar 28 '15 at 13:41