• Input:   LL-table for G=(N, T, P, S); x Î T*
• Output: Left parse of x if x Î L(G); otherwise, error
• Method:
• push($) & push(S) onto the pushdown;
• while the pushdown is not empty do
• let X = the pushdown top and a = the current token
• case X of:
• X = $: if a = $ then success
         else error;
• X Î T: if X = a then pop(X) & read next a from        input string
              else error;
• X Î N: if r: X ® x Î LL-table[X, a] then
       replace X with reversal(x) on the
       pushdown & write r to output
else error;
  end
Table-Driven Parsing: Algorithm
48/57