Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ISO human-readable parser for Python in Python

I'm looking for a parser for Python (preferably v. 2.7) written in human-readable Python. Performance or flexibility are not important. The accuracy/correctness of the parsing and the clarity of the parser's code are far more important considerations here.

Searching online I've found a few parser generators that generate human-readable Python code, but I have not found the corresponding Python grammar to go with any of them (from what I could see, they all follow different grammar specification conventions). At any rate, even if I could find a suitable parser-generator/Python grammar combo, a readily available Python parser that fits my requirements (human-readable Python code) is naturally far more preferable.

Any suggestions?

Thanks!

like image 561
kjo Avatar asked Jul 26 '26 17:07

kjo


1 Answers

PyPy is a Python implementation written entirely in Python. I am not an expert, but here's the link to their parser which - obviously - has been written in Python itself:

https://bitbucket.org/pypy/pypy/src/819faa2129a8/pypy/interpreter/pyparser

like image 80
mac Avatar answered Jul 28 '26 08:07

mac



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!