A maximally elegant implementation of LR(k) parsing