First implementation of Earley parser