refactoring of parser compilation with caching