Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

19. Given the follo wing parser table, state of the stack, and input string, if

ID: 3606359 • Letter: 1

Question

19. Given the follo wing parser table, state of the stack, and input string, if you were to read in the next symbol, what action would you take? Tip: Recall that when representing how much of an input string we've read, everything BEFORE e. represents what we have already read in, and everything AFTER the represents what we haven't seen yet. State Action Goto 0 1 R3 R3 R3 2 S4 3 R2 R2 R2 S1 acc 4 S1 input: .id+id $ Stack: 0 Add id to the stack, advance the input string so that the. is after the first id symbol, and reduce by rule 3. A. B. Add id to the stack, advance the input string so that the is after the first id symbol, and transition to state 1. C. Add id to the stack, add 1 to the stack, advance the input string so that the , is after the first id symbol, and transition to state 1. Add id to the stack, advance the input string so that the . is after the first id symbol, reduce by rule 3, and pop one pair of symbols off the stack. D.

Explanation / Answer

Answer is C

Currently we are on "0" state .At 0 state if we input "id" which is our next input character then according to parser table in row with state = "0" the value under that input character "id" is "s1" which says move to state 1 and put 1 on stack.Stack represents the current state of our system.

And Advance "." after the first id symbol

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote