Basic implementation of LexicalScanner