0 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 3.6k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
1 1 vote 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 4 4 Comments reply juniorG commented Apr 15, 2022 reply Follow flag isn’t this grammar left recursive? (production number 2) and in LL(1) we can’t have left recursion and non-determinism, right? 0 0 replyShare Kabir5454 commented Apr 15, 2022 reply Follow flag 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 0 replyShare juniorG commented Apr 15, 2022 reply Follow flag 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 0 replyShare 0xprateek commented Apr 23, 2022 reply Follow flag @juniorG Before calculating the first and follow functions, eliminate Left Recursion from the grammar, if present. 0 0 replyShare Please log in or register to add a comment.