Lexer and parser refactoring.