implementation of a simple "token enumerator"