{"id":88470,"library":"doctrine-lexer","title":"Doctrine Lexer","description":"PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.","status":"active","version":"3.0.1","language":"php","source_language":null,"source_url":"https://github.com/doctrine/lexer","tags":["doctrine","lexer","parser","tokenizer"],"install":[{"cmd":"composer require doctrine/lexer","lang":"bash","label":"composer require"}],"dependencies":[],"imports":[{"symbol":"AbstractLexer","correct":"use Doctrine\\Common\\Lexer\\AbstractLexer;"}],"quickstart":{"code":"use Doctrine\\Common\\Lexer\\AbstractLexer;\n\nclass MyLexer extends AbstractLexer\n{\n    protected function getCatchablePatterns()\n    {\n        return ['[a-zA-Z]+', '\\d+'];\n    }\n\n    protected function getNonCatchablePatterns()\n    {\n        return [\"\\s+\"];\n    }\n\n    protected function getType(&$value)\n    {\n        if (ctype_alpha($value)) return 'T_WORD';\n        if (is_numeric($value)) return 'T_NUMBER';\n        return null;\n    }\n}","lang":"php","description":"Create a custom lexer by extending AbstractLexer."},"warnings":[{"fix":"Upgrade PHP to 8.1+ or use version 2.x for older PHP versions.","message":"Version 3.x requires PHP 8.1 or higher.","severity":"breaking","affected_versions":">=3.0.0"}],"env_vars":null,"search_vec":"'descent':17 'doctrin':1,4,19 'lexer':2,5,20 'librari':7 'parser':6,18,21 'php':3 'recurs':16 'token':22 'top':14 'top-down':13 'use':11","created_at":"2026-06-19T08:32:49.182998+00:00","updated_at":"2026-06-19T08:32:49.182998+00:00","problems":[],"ecosystem":"packagist","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://www.doctrine-project.org/projects/lexer.html","github":"https://github.com/doctrine/lexer","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-19","next_check":"2026-12-16","install_tag":null}}