Simple generalized leftcorner parser written in Prolog