It seems to me like this should be reversed from what we have here. Pass the NonTerminal to the constructor and initialize s in parse() and you can use the same parse object to parse a bunch of strings, leaving open the possibility of doing some kind of clever optimizations to decrease the overhead of parsing multiple strings at a time.