1

I have a grammar that has left recursion I tried removing them and I was able to remove two of them but for one of them I don't know what to do! Here is the grammar:

R -> R "|" S 
R -> S 
S -> S.T 
S -> T 
T -> T* 
T -> U 
U -> (R) 
U -> a 
U -> "ε" 

I removed the left recursion in rule 1 and 3 but I don't know what to do for rule #5 which is a star enclosure.

I'd be grateful if you help on this problem.

ggorlen
  • 44,755
  • 7
  • 76
  • 106
  • Welcome to SO! Can you show how you removed left recursion on 1 and 3? I'm sure you can apply the techniques you used here for `T`. – ggorlen May 24 '20 at 00:17
  • 1
    Context-free grammars don't have "star enclosures". Perhaps the original grammar was actually `T->T "*"`, in which case the procedure is the same as the other two. – rici May 24 '20 at 00:43

0 Answers0