Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q4 - Syntax Analysis A) Given the following context free grammar, find the FIRST set of each production and the FOLLOW set for each nonterminal
Q4 - Syntax Analysis A) Given the following context free grammar, find the FIRST set of each production and the FOLLOW set for each nonterminal that is null-able. Finally, find the selection set for each production. Note that the terminal symbols of this grammar are id num E Therefore, =, ze, and-. In the grammar below, the terminals are highlighted in bold id num :- 3 SCompareexpr::- compare expr, > : := - : := - 9 SCompare op>::- 10 Scompare op>::- | | | : := B) Fill the LL(1) parsing table associated with the above given grammar (by writing the rule number rather than the rule itself in the table cells, if no rule leave the cell blank) compare_expir compare expr' compare op C) Based on your parsing table, can you conclude that the grammar is LL(1)? Justify your answer. Q4 - Syntax Analysis A) Given the following context free grammar, find the FIRST set of each production and the FOLLOW set for each nonterminal that is null-able. Finally, find the selection set for each production. Note that the terminal symbols of this grammar are id num E Therefore, =, ze, and-. In the grammar below, the terminals are highlighted in bold id num :- 3 SCompareexpr::- compare expr, > : := - : := - 9 SCompare op>::- 10 Scompare op>::- | | | : := B) Fill the LL(1) parsing table associated with the above given grammar (by writing the rule number rather than the rule itself in the table cells, if no rule leave the cell blank) compare_expir compare expr' compare op C) Based on your parsing table, can you conclude that the grammar is LL(1)? Justify your
Step 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