Remove left recursion from following grammar :
Q.1
S -> SXY | a
X -> xY | xX
Y -> Yy | epsilon
Q.2
P -> P H 4 U | p
H -> h
U -> u | u P
I know the rules to remove left recursion, but I am confused. So if someone please post the answer of this grammar, it would be helpful.
Update from comment:
I know this 2 are left recursive grammar :
S -> SXY | a
P -> P H 4 U | p
And I know how to remove left recursion from those grammars, but what about other grammars?
P -> P ... This is left recursive.
P -> p ... Is this is also left recursive ?