{"id":14109758,"url":"https://github.com/viraptor/phply","last_synced_at":"2025-05-16T07:03:28.636Z","repository":{"id":37712878,"uuid":"791693","full_name":"viraptor/phply","owner":"viraptor","description":"PHP parser written in Python using PLY","archived":false,"fork":false,"pushed_at":"2023-02-20T17:06:27.000Z","size":271,"stargazers_count":369,"open_issues_count":19,"forks_count":101,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-12T04:47:25.691Z","etag":null,"topics":["language","parsing","php","ply","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/viraptor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2010-07-22T18:49:50.000Z","updated_at":"2025-02-24T12:24:18.000Z","dependencies_parsed_at":"2023-01-31T20:30:37.254Z","dependency_job_id":"1c7956d3-2f8b-4d45-a83d-053708834534","html_url":"https://github.com/viraptor/phply","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viraptor%2Fphply","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viraptor%2Fphply/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viraptor%2Fphply/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viraptor%2Fphply/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viraptor","download_url":"https://codeload.github.com/viraptor/phply/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485047,"owners_count":22078767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["language","parsing","php","ply","python"],"created_at":"2024-08-14T10:02:28.916Z","updated_at":"2025-05-16T07:03:28.586Z","avatar_url":"https://github.com/viraptor.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# phply\n\nphply is a parser for the PHP programming language written using PLY, a\nLex/YACC-style parser generator toolkit for Python.\n\n## Why?\n\nGood question. Because I'm crazy. Because it seemed possible.\n\nThings I'm interested in doing with it:\n\n* Converting PHP code to Python\n* Running PHP templates in a Python environment\n* Learning more about parsing \"industrial\" languages, warts and all\n\n## What does it stand for?\n\n* phply -\u003e PHP PLY\n* phply -\u003e PHP Hypertext Preprocessor Python Lex YACC\n* phply -\u003e PHP Hypertext Preprocessor Hypertext Preprocessor Python Lex Yet Another Compiler Compiler\n* (... to be completed ...)\n\n## How do you pronounce it?\n\nIf you're conservative, it's pronounced \"pee aich ply\". If you're liberal,\nit's \"fiply\". And if you're anarchist, pronounce it however you want. Who am I\nto tell you what to do?\n\n## What's working?\n\n* Lexer matching the standard PHP lexer token-for-token\n* Parser and abstract syntax tree for most of the PHP grammar\n* Script to convert PHP source to JSON-based ASTs\n* Script to convert PHP source to Jinja2 source (experimental)\n\n## What's not?\n\nSome things can't be parsed yet. They are getting fewer by the day, but there\nis still a fair amount of work to do:\n\n* Labels and goto\n* Some other stuff, probably\n\n## Who's working on it?\n\nSee the [AUTHORS](https://github.com/viraptor/phply/blob/master/AUTHORS) file.\n\n## Troubleshooting\n\n### Couldn't create 'phply.parsetab'\n\nPhply relies on `ply` to generate and cache some tables required for the parser.\nThese have been generated with the latest available version of ply for the phply\nrelease. If you installed phply under a different user and a new `ply` was\nreleased, the parsetab file cannot be automatically updated. Your options are\nto:\n\n* raise an issue for phply\n* rebuild the package yourself\n\n## How do I use it?\n\n* Lexer test: python phply/phplex.py\n* Parser test: python phply/phpparse.py\n* JSON dump: cd tools; python php2json.py \u003c input.php \u003e output.json\n* Jinja2 conversion: cd tools; python php2jinja.py \u003c input.php \u003e output.html\n* Fork me on GitHub and start hacking :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviraptor%2Fphply","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviraptor%2Fphply","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviraptor%2Fphply/lists"}