0 votes 0 votes Compute FIRST and FOLLOW sets: S→ aAC | bB A→ Abc| Abd | e B→ f | g C→ h | i Compiler Design compiler-design grammar parsing first-and-follow + – Subhrangsu asked Apr 15, 2022 • retagged Jun 20, 2022 by Lakshman Bhaiya Subhrangsu 2.6k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes Non terminal First Follow S {a,b} {$} A {e} {b,h,i} B {f,g} {$} C {h,i} {$} Kabir5454 answered Apr 15, 2022 Kabir5454 comment Share Follow See all 4 Comments See all 4 4 Comments reply juniorG commented Apr 15, 2022 reply Follow Share isn’t this grammar left recursive? (production number 2) and in LL(1) we can’t have left recursion and non-determinism, right? 0 votes 0 votes Kabir5454 commented Apr 15, 2022 reply Follow Share Yes the grammar is left recursive so it cant be LL(1). You can check it by creating the LL(1) parsing table for this production. 0 votes 0 votes juniorG commented Apr 15, 2022 reply Follow Share i am aware of that. what i really meant was if the grammar itself isn’t LL(1) itself then are the first and follow you calculated valid? 0 votes 0 votes 0xprateek commented Apr 23, 2022 reply Follow Share @juniorG Before calculating the first and follow functions, eliminate Left Recursion from the grammar, if present. 0 votes 0 votes Please log in or register to add a comment.