Answered step by step
Verified Expert Solution
Question
1 Approved Answer
We want to create a top-down parser which is able to analyze the Java style class declarations same as the following examples, class Car extends
We want to create a top-down parser which is able to analyze the Java style class declarations same as the following examples, class Car extends Vehicle public class JavalsCrazy implements Factory, Builder, Listener public final class President extends Person implements Official For this, we have the following grammar: Index Grammar Rule 0 CP F class identifier XY P public F final X extends identifier Yimplements I Iidentifier J 10 12 For this homework, you need to submit the followings 1 - Compute Nullable values for all nonterminals (LHS) and all production rules (RHS). You submit the Nullable calculation rules and the results. You do not need to submit the iterative table that is used for calculation. (20 points) To refer to productions you use production numbers mentioned above, since using the names are lengthy. The following is an example Instead of writing "Nullable (extends identifier)" you write "Nullable (6)". 2 Compute FIRST sets for all nonterminals (LHS) and all production rules (RHS). You submit the FIRST calculation rules and the result sets. You do not need to submit the iterative table that is used for calculation. (20 points) To refer to productions you use production numbers mentioned above, since using the names are lengthy. The following is an example: Instead of writing "FIRST (extends identifier)" you write "FIRST (6" 3 - Compute FOLLOW sets for all nonterminals (LHS). (do not forget to add a new start symbol and corresponding production rule including the end-of-input symbol, i.e. $). You submit the FOLLOW calculation rules for all and the result sets. (20 points) 4 Submit the LL(1) parsing table for the grammar. (20 points) Please note, you added a new production rule with a new start symbol. For this production rule use number 0 as its index number.) To populate the table you use rule numbers mentioned above instead of writing the production rules in the table. For example, in the table instead of writing "F final" you only write "4
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