Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please implement using vectors 4.3 Task 3: Calculate FIRST Sets Compute the FIRST sets of all non-terminals. Then, for each of the non-terminals of the

Please implement using vectors

image text in transcribed

image text in transcribed

4.3 Task 3: Calculate FIRST Sets Compute the FIRST sets of all non-terminals. Then, for each of the non-terminals of the input grammar, in the order that it appears in the grammar, output one line in the following format: FIRST() { } Where should be replaced by the non-terminal and should be replaced by a comma-separated list of elements of the set ordered in the following manner: lfe belongs to the set, represent it as # If e belongs to the set, it should be listed before any other elements All other elements of the set should be sorted in the order in which they appear in the grammar Example: Given the input grammar decl-> idList colon ID # idList-> ID idList1 # idList! -> # idList1-) COMMA ID idList 1 # the expected output for task 3 is FIRST (decl) - ID j FIRST (idlist) = { ID } FIRST (idList 1) { #, COMMA } 4.4 Task 4: Calculate FOLLOW Sets For each of the non-terminals of the input grammar, in the order that they appear in the non- terminals section of the input, compute the FOLLOW set for that non-terminal and output one line in the following format FOLLOW () { } = Where should be replaced by the non-terminal and should be replaced by the comma-separated list of elements of the set ordered in the following manner: o If EOF belongs in the set, represent it as $ If EOF belongs in the set, it should be listed before any other elements o All other elements of the set should be sorted in the order in which they appear in the grammar

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

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions