viraptor / Phply
Licence: other
PHP parser written in Python using PLY
Programming Languages
python 139335 projects - #7 most used programming language
Projects that are alternatives of or similar to Phply
allotParse placeholder and wildcard text commands
Stars: ✭ 51 (-83.06%)
Mutual labels: parsing
CalPackPackets in Python Simplified
Stars: ✭ 19 (-93.69%)
Mutual labels: parsing
CreekRuby library for parsing large Excel files.
Stars: ✭ 270 (-10.3%)
Mutual labels: parsing
parse-mdParse Markdown file's metadata from its content
Stars: ✭ 15 (-95.02%)
Mutual labels: parsing
StringsareevilReducing memory allocations from 7.5GB to 32KB
Stars: ✭ 260 (-13.62%)
Mutual labels: parsing
php.jsonA library for simplifying JSON linting and validation.
Stars: ✭ 59 (-80.4%)
Mutual labels: parsing
SemverSemantic version parsing and comparison.
Stars: ✭ 283 (-5.98%)
Mutual labels: parsing
ofxgoGolang library for querying and parsing OFX
Stars: ✭ 96 (-68.11%)
Mutual labels: parsing
Nearley📜🔜🌲 Simple, fast, powerful parser toolkit for JavaScript.
Stars: ✭ 3,089 (+926.25%)
Mutual labels: parsing
python-hslogPython module to parse Hearthstone Power.log files
Stars: ✭ 37 (-87.71%)
Mutual labels: parsing
literator📝 Generate literate-style markdown docs from your sources
Stars: ✭ 55 (-81.73%)
Mutual labels: parsing
AngourimathOpen-source symbolic algebra library for C# and F#. One of the most powerful in .NET
Stars: ✭ 266 (-11.63%)
Mutual labels: parsing
LdetoolCode generator for fast log file parsers
Stars: ✭ 273 (-9.3%)
Mutual labels: parsing
tools-pythonA Python library to parse, validate and create SPDX documents.
Stars: ✭ 65 (-78.41%)
Mutual labels: parsing
inmemantlrANTLR as a libray for JVM based languages
Stars: ✭ 87 (-71.1%)
Mutual labels: parsing
GvalExpression evaluation in golang
Stars: ✭ 297 (-1.33%)
Mutual labels: parsing
SerpentA protocol to serialize Swift structs and classes for encoding and decoding.
Stars: ✭ 281 (-6.64%)
Mutual labels: parsing
NlpythonThis repository contains the code related to Natural Language Processing using python scripting language. All the codes are related to my book entitled "Python Natural Language Processing"
Stars: ✭ 265 (-11.96%)
Mutual labels: parsing
phply
phply is a parser for the PHP programming language written using PLY, a
Lex/YACC-style parser generator toolkit for Python.
Why?
Good question. Because I'm crazy. Because it seemed possible.
Things I'm interested in doing with it:
- Converting PHP code to Python
- Running PHP templates in a Python environment
- Learning more about parsing "industrial" languages, warts and all
What does it stand for?
- phply -> PHP PLY
- phply -> PHP Hypertext Preprocessor Python Lex YACC
- phply -> PHP Hypertext Preprocessor Hypertext Preprocessor Python Lex Yet Another Compiler Compiler
- (... to be completed ...)
How do you pronounce it?
If you're conservative, it's pronounced "pee aich ply". If you're liberal,
it's "fiply". And if you're anarchist, pronounce it however you want. Who am I
to tell you what to do?
What's working?
- Lexer matching the standard PHP lexer token-for-token
- Parser and abstract syntax tree for most of the PHP grammar
- Script to convert PHP source to JSON-based ASTs
- Script to convert PHP source to Jinja2 source (experimental)
What's not?
Some things can't be parsed yet. They are getting fewer by the day, but there
is still a fair amount of work to do:
- Labels and goto
- Some other stuff, probably
Who's working on it?
See the AUTHORS file.
Troubleshooting
Couldn't create 'phply.parsetab'
Phply relies on ply
to generate and cache some tables required for the parser.
These have been generated with the latest available version of ply for the phply
release. If you installed phply under a different user and a new ply
was
released, the parsetab file cannot be automatically updated. Your options are
to:
- raise an issue for phply
- rebuild the package yourself
How do I use it?
- Lexer test: python phply/phplex.py
- Parser test: python phply/phpparse.py
- JSON dump: cd tools; python php2json.py < input.php > output.json
- Jinja2 conversion: cd tools; python php2jinja.py < input.php > output.html
- Fork me on GitHub and start hacking :)
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at
[email protected].