My implementation of the Earley algorithm