Does the Earley parser have expected problems with simple cycles?
I've made my own implementation, but it's pretty similar to this one, which is very readable and about 150 lines total (and I, of course, didn't write it):
http://www.nightmare.com/rushing/python/earley.py
That one looks good to me, and works perfectly in the provided test case, but the very simple grammar
E : [[E,E],[ident]]
doesn't seem to work. It should generate an arbitrary number of "ident" tokens, assuming that E is the starting non-terminal and ident is a terminal. But this grammar, and any similar style grammar, are completely missed by the parser.
Is this a problem in the Earley algoritm (I don't think it is), or a problem in this implementation; if it's implementation based, is there a (relatively) easy solution or does the algorithm need to be rebuilt?