3 votes 3 votes calculate first and follow S -> AB A -> SD / e C -> a / ε D -> b or calculate follow in this S -> AB A -> CD C -> a / ε D -> b Compiler Design compiler-design first-and-follow + – sumit goyal 1 asked Aug 14, 2017 • edited Nov 6, 2023 by Hira Thakur sumit goyal 1 1.4k views answer comment Share Follow See all 10 Comments See all 10 10 Comments reply Show 7 previous comments stblue commented Aug 14, 2017 reply Follow Share Correct, edited my comment as well 0 votes 0 votes stblue commented Aug 14, 2017 reply Follow Share So finally our grammer become P - > S S - > A | A ;S A - > id = E E - > TE'| (E)E' E' -> +EE' | -EE' | *EE' | /EE' | ϵ T -> id | num First(E') = {+,-,*,/, ϵ } Now we can easily find Follow(E) = {$, +,-,*,/,),;} Removing left recursion made things easy here. 0 votes 0 votes sumit goyal 1 commented Aug 14, 2017 reply Follow Share thanks bhai 0 votes 0 votes Please log in or register to add a comment.