Update LexicalAnalyser.java for throwing exceptions