add basic token stream handling functions to parser