Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

in the construction of the parse table below

image text in transcribed

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 19

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions