Fix infinite recursion
The previous commit solved some wierd things around the add_first
function. These were created because of my misunderstanding of the
process but also (almost) prevented infinite recursion.
The infinite recurson is caused when a search for a first (nonterminal)
tokens encounteres the original token, because then it searches for it
again and is able to again find the token along the search.
The solution is to make the algorithm log what nonterminals it already
went through so that it does not try to find their first tokens during
the search for their first tokens.