Implemented a large part of the lexer