Implemented a Lexer for parsing