Basic implementation for lexical analyzer