Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Rules to find First and Follow sets: We use the following 5 rules for calculating FIRST sets for terminals and non-terminals and epsilon 1. FIRST

image text in transcribedimage text in transcribed

Rules to find First and Follow sets: We use the following 5 rules for calculating FIRST sets for terminals and non-terminals and epsilon 1. FIRST (E)=() II. FIRST (a)=( a) for every terminal a III. If AB is a grammar rule, where B is a terminal or non-terminal, then add FIRST (B){E} to FIRST (A) IV. If AA1A2AKB is a grammar rule, where B is a terminal or non-terminal and FIRST(A1) and FIRST(A2).... and FIRST(Ak), then add FIRST (B)(E) to FIRST (A) V. If AA1A2AK is a grammar rule and FIRST(A11) and FIRST(A2). and FIRST(AK), then add E to FIRST (A) We use the following 5 rules for calculating FOLLOW sets for non-terminals 1. add S to FOLLOW(S) (remember S is used to denote end of file) 11. If AB is a grammar rule, and B is a non-terminal, add FOLLOW(A) to FOLLOW(B) III. If ABA1A2 Ak is a grammar rule, and B is a non-terminal, and FIRST(A1) and EFIRST(A2) and EFIRST(Ak), then add FOLLOW (A) to FOLLOW FO) If ABA1A2... Ak is a grammar rule, and B is non-terminal add FIRST (A1){E) to FOLLOW(B) fBA1A2.AiAl+1Ak is a grammar rule, and B is non-terminal and EFIRST(A1) and EFIRST(A2).... and EFIRST(AK), then d FIRST (Ai+1){E} to FOLLOW (B) Generate the First and Follow sets for the grammar below. The empty sting epsilon is denoted with the esymbol. SABCDEAa/Bb/CcDd/Ee/

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_2

Step: 3

blur-text-image_3

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

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

Consistently develop management talent.

Answered: 1 week ago

Question

=+what kinds of policies and practices should be developed?

Answered: 1 week ago

Question

=+ Of the HR issues mentioned in the case,

Answered: 1 week ago