Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Explain the roles of sets FIRST, FOLLOW and PREDICT of in the construction of the parse table below FIRST program lid, read, vrite, s$) stmt
Explain the roles of sets FIRST, FOLLOW and PREDICT of
in the construction of the parse table below
FIRST program lid, read, vrite, s$) stmt Jist (id, read, vrite) stmt {id, read, vrite) expr [G id, number) term tail term (G, id, number) factor.tail (,/) factor(,id, number) add.op t., - mult.op (, /) PREDICT 1. program 2. stmt list stit Jist $$ (id, read, vrite, $$) stmt stmt list id, read, rite) stmt listSs stmtid:-exprid) stmtread id (read) 6. sint -write expr {vrite) exprterm term tail (G, id, number) 8. termtailadd op term term.tail- 9. term tail), id, read, vrite, $$ 10 termfactor factor.tail (G, id, number I1. factor tail mult op factor factor tail (,1 12. factor tail-, id, read, vrite, $$) FOLLOW prognam stmt.Jist ($$) stmt (id, read, vrite, s$ expr (), id, read, write, $$) termtail , id, read, vrite, s$ term (+), id, read, vrite, $s actor tail , id, read, vrite, s$) factor {+,-, *./.), id, read, write, add.op (G id, number) multop {G id, number) 15, factor-, id {id} number (number) 16. add op 17. add.op- 18. multop) 9. malt.op ) Top-of-stack nonterminal id nunber read vrite ( ) * / $s Current input token programI it list2 stmt 4 expr 7 term tail9 erm 10 factor tail12 factor 14 10 10- 12 12 12 12 1 12 15 add.op mult.op- 18 19Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started