Step states The rest of input action goto abbett 2 02 bbcdett 23456789 024 cde # 2 goto(2, A) 023 bereft 0236 deft r3 goto(2, A) 023 cent 5 0235 dett s8 02358 eft r4 goto(5,B) 02357 eft 10023579 rI goto(O, s) acc
• Step states. . The rest of input action goto • 1 0 abbcde# s2 • 2 02 bbcde# s4 • 3 024 bcde# r2 goto(2,A) • 4 023 bcde# s6 • 5 0236 cde# r3 goto(2,A) • 6 023 cde# s5 • 7 0235 de# s8 • 8 02358 e# r4 goto(5,B) • 9 02357 e# s9 • 10 023579 # r1 goto(0,S) • 11 01 # acc
1)E→>E+T 234 2)E→>7 )T->(E) )T→>id State on Action Goto top of stack $4 S3 S5 accel 012345678 r2 r2 r2 2 r2 S4 S3 r 4 r4 [4 r4 [ $4 S3 S5 r3 r3 r3 r3 r3
1) E –> E + T 2) E –> T 3) T –> (E) 4) T –> id
d+(id) STACK REMAINING PARSER STACK INPUT ACTION So id +(id)s Shift S4 onto state stack, move ahead in input SOS4 +(id)$ Reduce 4)T-> id, pop state stack goto S2, input unchanged +(id)s Reduce 2)E->T, goto S1 Sos +(id)$ Shift s 5 O155 Shift s S O155。3 id)s Shift S4 S 0155。34 Reduce 4)T->id, goto S SoS1S5s3S )s Reduce 2)E->T, goto S, O15536 Shift s SOS1S5S3S6S7 s Reduce 3)T->(E), goto S8 SoS1S5s s Reduce 1)E->E +T, goto S SoS Accept
id + (id)