Improve ParserGenerator readability

I'm not sure why you wrote it this way, but adding a few empty lines, early continues and inverting conditions to handle simple cases first seems to me like it makes this code much more readable.