Refactored the Lexer to use a dictionary instead of a switch.