finished lexical analyser