1. Engineering
  2. Computer Science
  3. problem i parsing consider the grammar sag bc 1 a...

Question: problem i parsing consider the grammar sag bc 1 a...

Question details

Problem I. Parsing. Consider the grammar SAg BC (1) A a A BdBc Ce where S, A, B, and C are the non-terminals, S is the start symbol, and a, c, d, e, f, and g are the terninals 1. Calculate the FIRST and FOLLOW sets for this grammar. » For FIRST sets (a) Do an initialization pass by applying FIRST sets rules I and II (b) Do successive passes, on the grammar rules in the order they are listed and apply to each grammar rule FIRST set rules III, then FIRST set rule IV then FIRST set rule V In your answer, you should show the FIRST sets after each pass. You do not have to use the notation I used in class to indicate the order in which the elements are added to the sets . For FOLLOW sets, you should do (a) Do an initialization pass by applying FOLLOW sets rule I (b) Do one pass on all grammar rules, in the order they are listed, and apply to each grammar rule FOLLOW set rules IV and V (c) Do successive passes on all grammar rules in the order they are listed and apply to each grammar rule FOLLOW set rules II and III until there is no change. In your answer, you should show the FOLLOW sets after each pass. You do not have to use the notation I used in class to indicate the order in which the elements are added to the sets

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution