
% Grammar 4.3: A grammar with left-recursion

:-op(1100, xfx, --->).
:-op(1100, xfx, ===>).


s ---> [np, vp].

vp ---> [v].
vp ---> [v, np].
vp ---> [vp, pp]. %left-recursive

pp ---> [p, np].

np ---> [np, pp]. %left-recursive
np ===> [toby].
np ===> [scotch].
np ===> [drinks].
np ===> [ice].

v ===> [drinks].

p ===> [on].


