Question: 'Multiple Choice 10.0 points possible (graded, results hidden) 0. S = Tail $ 1. Earth = Tail Earth' Tail 2. Earth' = ^ ( Tail

'Multiple Choice 10.0 points possible (graded, results hidden) 0. S = Tail $ 1. Earth = Tail Earth' Tail 2. Earth' = ^ ( Tail Earth' ) 3. Earth' = E 4. Tail = Flag Tail' Earth 5. Tail' 6. Tail' = E 7. Flag = ( Earth ) 8. Flag = number 9. Earth = 1 - % Flag Given the grammer answer the following questions: 1. Which statements are not absolutely true? First(S) = { Tail } First( Tail') = { %} First( Flag) = {( number} First( Earth') = {^} First( Earth ) = { ^, num } None 2. Which statements are completely/partially false? Follow( Earth ) = {), ( number, ^} Follow( Tail) = { number, ^,), $ } Follow Tail') = { ), number} 0 0 0 0 Follow( Flag ) = { number, %, $} Follow( Earth') = {G} None 3. Which statements are completely true? The entry of the cell (S. () of the constructed LL (1) pre-calculated parse table is rule 1 The entry of the cell (Earth', $ ) of the constructed LL (1) pre-calculated parse table is nothing The entry of the cell (S. number) of the constructed LL (1) pre-calculated parse table is rule 1 Rule 6 has 2 entries in the constructed LL (1) pre-calculated parse table Rule 2 has 2 entries in the constructed LL (1) pre-calculated parse table None 4. If we prepare a parsing tree with the string "(^) number ^ number 4" from the above LL(1) table, total number of leaf nodes will be 14 11 10 24 None 5. If we prepare a parsing tree with the string "(^) number ^ number 4" from the above LL(1) table, total number of parent nodes will be 24 14 10 21 7 None 6. Which strings are not acceptable for the grammer? number ^ number (number number ^)^ (number % number number) (number ^ number ^ ) % number number number % number) number Do not forget to click on submit Submit You have used 0 of 2 attempts Save SLR(1) 10.0 points possible graded, results hidden) Consider the following grammar, 0.S' S 1.S LER 2.S R 3.L *R 4.L id 5.R L 11 19 S R 10: L = 12 16 L S-> S S->LER S->R L->.*R L-> oid R-> L 18 * id R 13 14 15 id R 14 15 17 id L 15 18 14 Figure 1 Figure 1 shows the skeleton of the LR(0) automaton for the grammar. Complete the rest of the set of items. Construct the SLR(1) table and answer the following questions based on your derived results. 1. Which of the following actions are in the cell corresponding to (IO, *)? S1 S2 S3 S4 S5 S6 OS S8 S9 R1 R2 R3 O RA R5 None of the above 2. Which of the following actions are in the cell corresponding to (13, $)? S1 S2 OS3 S4 OS5 S6 S7 S8 S9 R1 R2 R3 R4 R5 None of the above 3. Which of the following actions are in the cell corresponding to (15, $)? OS1 S2 Os3 S5 S6 S7 OS8 S9 R1 R2 R3 R4 R5 None of the above 4. Which of the following actions are in the cell corresponding to (15, =)? Os1 S2 OS3 S4 S5 S6 S7 S8 S9 0510 R1 R2 R3 R4 R5 None of the above 5. Which of the following cells contain R5? (12, id) (12. =) (12.) (12,5) (18, id) (18, =) (18.) (18.$) (17, b) (17,5) None of the above 6. Which of the following cells contain R3? (12, id) (12. =) (12.) (12,5) (17, id) (17, =) (17.) (17, S) (18, b) (18,5) None of the above 7. Which of the following actions are in the cell corresponding to (14, id)? Osi OS2 S3 S4 S5 56 S7 S8 S9 R1 R2 R3 R4 R5 None of the above 8. How many items are in the set of items 14? 9. Is the grammar an SLR(1) grammar? Yes No 10. What kind of conflict(s) are there in the table (If any)? Shift/Reduce Reduce/Reduce No conflict Submit LR(1) Parsing 10.0 points possible (graded, results hidden) Consider the following augmented grammar, G =( {S, Var, Expr}, {id, :, =, num}) 0. S' S 1. S id 2. S + Var:= Expr 3. Var id 4. Expr Var 5. Expr num 11 S Expr Var = . Var num id id Fig. 1 Figure 1 shows the skeleton of the LR(1) automaton for the grammar. Complete the set of items, construct the LR(1) table and answer the following questions based on your derived results. 1. How many items are there in the set of items 10? 2. How many items are there in the set of items li? 3. How many items are there in the set of items 12? 4. How many items are there in the set of items 13? 5. How many items are there in the set of items 14? 6. How many items are there in the set of items 15? 7. In the LR(1) table, which of the following do you get in the cell (19, id)? Shift 6 Shift 7 Shift 8 Shift 9 Reduce Error 8. In the LR(1) table, which of the following do you get in the cell (16. $)? Shift 6 Shift 7 Shift 8 Reduce 2 Reduce 4 Reduce 5 9. In the LR(1) table, which of the following cells contain Reduce 3 (R3) ? (13, $) (16, $) (13, :) (16. $) (19. $) (18, $) 10. In the LR(1) table, which of the following cells contain Reduce 4 (R4) ? (13. $) (16 $) (13, :) O O O O O (16 $) (17, $) (Is, $) Submit You have used 0 of 2 attempts Save
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
