I wrote a little LR(1) parser generator in Java that given a context-free grammar in input (better put it's productions) and a input word prints whether 1) The Grammar is not LR(1) 2) The word is accepted by the grammar 3) The word is rejected by the grammar
So far I've tried with this grammar
S -> CC
C -> cC | d
and this
A -> BA | e
B -> aB | b
(note that e is the empty string)
For this grammars the parser works but I'm having difficulties finding Grammars (list of productions) that I know for sure generate a LR(1) language, for testing.
Plus I need a context-free grammar that is not LR(1) for testing point (1) of the program.
Do you have any examples you could give me?