{ "info": { "author": "Werner Hahn", "author_email": "werner_hahn@gmx.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Education", "Topic :: Software Development", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing" ], "description": "plyj [![Build Status](https://secure.travis-ci.org/musiKk/plyj.png?branch=master)](http://travis-ci.org/musiKk/plyj)\n====\n\nplyj is a Java parser written in Python. It has the awesome [PLY] as its sole dependency.\n\nSynopsis\n--------\n\n```python\nimport plyj.parser as plyj\n\nparser = plyj.Parser()\n\n# parse a compilation unit from a file\ntree = parser.parse_file(file('/foo/bar/Baz.java'))\n\n# parse a compilation unit from a string\ntree = parser.parse_string('class Foo { }')\n\n# parse expression from string\ntree = parser.parse_expression('1 / 2 * (float) 3')\n\n# slightly bigger example: parse from an installed JDK with sources\nimport zipfile\nsrczip = zipfile.ZipFile('/usr/lib/jvm/java-6-openjdk/src.zip', mode='r')\ninfo = srczip.getinfo('java/lang/Object.java')\nsrcfile = srczip.open(info)\ntree = parser.parse_file(srcfile)\n```\n\nAcknowledgement\n---------------\n\nplyj is more or less a 1:1 translation of the grammar used in the [Java Development Tools] for Eclipse.\n\nCompleteness\n------------\n\nThe grammar is complete. There may still be errors left though. It successfully parsed every source file of the Oracle JDK. A lot of bugs were found that way but for all I know there may be many more. Time will tell.\n\nContributions\n-------------\n\nContributions are always welcome. Depending on the type of work it may\ntake a little while until I get around to accepting them.\n\n* commit test that demonstrates a bug (optional)\n* commit the fix\n* open pull request\n\nThe test is required but does *not* have to be provided by you. If you\ndo provide it, committing it first shows appropriate messages in the\npull request and makes it easier to accept via Web.\n\nPerformance\n-----------\n\nA word of caution: Since plyj is pure Python, it is quite slow. Based on my laptop (which has an i7-3517U @ 1.90 GHz) I can present the following numbers (running inside a virtual machine):\n\n* 619 rules\n* 1149 states\n* ~3.28 seconds to compile the grammar\n* java/util/Collections.java takes ~0.44 seconds to parse (it's quite big though)\n\nThe timings are obviously highly dependent on the used hardware. My old laptop (Core 2 Duo @ 1 GHz) took 17 and 1.8 seconds respectively.\n\n[PLY]: https://github.com/dabeaz/ply\n[Java Development Tools]: http://www.eclipse.org/jdt/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/musiKk/plyj", "keywords": null, "license": "COPYING", "maintainer": null, "maintainer_email": null, "name": "plyj", "package_url": "https://pypi.org/project/plyj/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/plyj/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/musiKk/plyj" }, "release_url": "https://pypi.org/project/plyj/0.1/", "requires_dist": null, "requires_python": null, "summary": "A Java parser written in Python using PLY.", "version": "0.1" }, "last_serial": 1360999, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "41c1f9d772d109ec72e318294532eb30", "sha256": "9e352e99927067310f56936ee6b4400529c1818f0efe75fae28a37e1273c4531" }, "downloads": -1, "filename": "plyj-0.1.tar.gz", "has_sig": false, "md5_digest": "41c1f9d772d109ec72e318294532eb30", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18388, "upload_time": "2014-12-25T20:55:19", "url": "https://files.pythonhosted.org/packages/70/d9/007184a1eb826af6d8d897e475adca8d742bb4ff2c429af6292954fc248b/plyj-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "41c1f9d772d109ec72e318294532eb30", "sha256": "9e352e99927067310f56936ee6b4400529c1818f0efe75fae28a37e1273c4531" }, "downloads": -1, "filename": "plyj-0.1.tar.gz", "has_sig": false, "md5_digest": "41c1f9d772d109ec72e318294532eb30", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18388, "upload_time": "2014-12-25T20:55:19", "url": "https://files.pythonhosted.org/packages/70/d9/007184a1eb826af6d8d897e475adca8d742bb4ff2c429af6292954fc248b/plyj-0.1.tar.gz" } ] }