来自斯坦福编译原理视频学习笔记
SLR improvement slr提升
let I = w$ be initial input
let j = 0
let DFA state 1 have item S'->.S
Let stack = <dummy, 1>
repeat
case action[top_state(stack), I[j] of
shift k: push <I[j++], k>
reduce X -> A:
pop |A| pairs,
push <X, goto [top_state(stack), X]>
accept: halt normarlly
error: halt and report error