# Where is left recursion in this little CF grammar?

S → D
D → E | EC
E → anyId
C → B | .D | B.D
B → <S> | <SA>
A → ,S | ,SA


The tool I am using keeps complaining about left recursion in this grammar. I can't see where.

The language recognized is something like:

anyId
anyId.anyId
anyId<anyId>
anyId<anyId>.anyId<anyId,anyId>

• Did you specify the start symbol correctly? Try also to get rid of unit productions. – fade2black Jul 3 '17 at 14:56
• What tool are you using? That grammar is not left-recursive afaics but it isn't LL(k) either. – rici Jul 3 '17 at 15:35
• Thanks for the hint. In fact, this grammar looks the way it looks because I was trying to be "as much literally faithful as possible" to a non-LL(*) informal specification. I will follow your hint and just implement the requirements in a more "natural" way. – AmazingWouldBeGreatBut Jul 3 '17 at 15:37