A grammar is left recursive if starting from a non terminal E
and applying rules you find a string which start with E
itself. If its a direct rule then it's direct left recursive as it A- > Aa
. If you have to apply more rule then it's indirect.
I'm assuming you grammar is
- `D ---> dcD' | D'`
- `D' --> DbaD' | DcD' | e`
Then you have the derivation
D -> D' -> DbaD'
So this in an indirect left recursion.
Now, if you are sure that there is an S
, then it depends of what you can derive from S
. But if there is no D
at the beginning of any word deriving from S
, then it is non left recursive.
By the way, this is better to ask those kind of question on https://cs.stackexchange.com/