TokenStream implementation