Simple lexical analyzer using tokens