As with the regular shift-reduce, it uses a stack S and a list of input words W .
1. if arc(T OP, F IRST ) ∈ G, then ra; 2. else if arc(F IRST, T OP ) ∈ G, then la; 3. else if ∃k ∈ Stack, arc(F IRST, k) ∈ G or arc(k, F IRST ) ∈ G, then re; 4. else sh.