create terminal, non-terminal, and rules lists

this has turned into quite the ugly hack. at least
i doubt we'll be using these last bits again ever.