Start migrating lexer and parser into new API.