Funny, I was actually building a (GLR) parser, too. Keeping track of duplicate item sets was what tripped me up.