simple lexical analyzer