Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Show a complete parse, including the parse stack contents, input string, and action for the string (id + id) * id, using the grammar and
Show a complete parse, including the parse stack contents, input string, and action for the string (id + id) * id, using the grammar and parse table in Section 4.5.3. Use the "insert table" button to create a three column table (like the one on p.197 of the textbook). You may use either the textbook notation, i.e. without parentheses - or Dr. Davis' notation, i.e. with paired (state, token) on the stack. Stack Action 0 Oid5 OF3 OT2 OE1 OE1+6 OE1+6id5 OE1+6F3 OE1+6T9 0E1+6T9*7 0E1+6T9*7id5 OE1+6T9*7F10 OE1+6T9 OE1 Input id + id * id $ + id * id $ + id * id $ + id * id $ + id * id $ id * id $ * id $ * id $ * id $ id $ $ $ $ $ Shift 5 Reduce 6 (use GOTO[0, F]) Reduce 4 (use GOTO[0, T]) Reduce 2 (use GOTO[O, E]) Shift 6 Shift 5 Reduce 6 (use GOTO[6, F]) Reduce 4 (use GOTO[6, T) Shift 7 Shift 5 Reduce 6 (use GOTO[7, F]) Reduce 3 (use GOTO[6, T) Reduce 1 (use GOTO[0, E]) Accept Action Goto State id + ( 64 E T "T 0 S5 S4 1 2. 3 1 S6 accept 2 R2 S7 R2 R2 3 R4 R4 R4 R4 4 S5 S4 8 2 3 S R6 R6 R6 R6 6 S5 S4 9 3 7 S5 S4 10 8 S6 S11 9 R1 S7 R1 R1 10 R3 R3 R3 R3 11 R5 R5 R5 R5
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