{ "info": { "author": "Mike Hordecki", "author_email": "mike@hordecki.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "=======\neasyply\n=======\n\nIntroduction\n============\n\neasyply is a helper library for PLY, parser generator for Python. It\nacts as a middleware between your grammar definition and PLY.\n\nWhat's so appealing about easyply? PLY supports rather crude parser\ndefinitions; easyply adds some EBNF-y flavor to it. easyply is purely\na helper in everyday work - you definitely need to understand PLY first \nin order to use this library.\n\nGoodies\n=======\n\nNo mandatory whitespace surrounding colon sign\n-----------------------------------------------\n\n::\n\n def px_rule():\n \"production: SYMBOL\n\nNamed parameters\n----------------\n\nInstead of mutating and reading the mysterious ``p`` parameter,\neasyply employs named parameters and return values. So::\n\n def px_rule(id):\n \"production: {ID}\n ...\n return retval\n\nis equivalent to::\n\n def p_rule(p):\n \"production : ID\"\n id = p[1]\n ...\n p[0] = retval\n\nYou can also use custom names for parameters, just like this::\n\n def px_rule(foo):\n \"production: {ID:foo}\"\n\nIn case when the custom name is not provided, a lowercased name of\nthe term is used.\n\nOptional symbols\n----------------\n\nInstead of creating multiple similar rules differing only by a few symbols,\nyou can consolidate them into one using ``?`` symbol. Observe::\n\n def px_rule():\n \"production: symbol1 symbol2? symbol3\"\n ...\n\nGiven this code, easyply will generate two functions with the\nsame code and the following rules:\n\n + ``production: symbol1 symbol3``\n + ``production: symbol1 symbol2 symbol3``\n\nThis is especially powerful in conjunction with named parameters(note the parentheses)::\n\n def px_list(expression, list = ()):\n \"list: ({list} COMMA)? {expression}\"\n return list + expression\n\nNeat, isn't it?\n\nOR operator\n-----------\n\nIn addition, `easyply` offers OR operator for quick grouping of similar cases::\n\n def px_expression():\n \"\"\"\n expression: LPAREN expression RPAREN\n | NUMBER\n | REAL\n \"\"\"\n ...\n\nThe OR operator can be also used inline::\n\n def px_list(expresion, list = ()):\n \"list: ({list} (COMMA|SEMICOLON))? {expresson}\"\n ...\n\nNote that OR has the lowest priority of all operators - hence the additional\nparentheses.\n\nInstallation\n============\n\n::\n \n pip install easyply \n\nUsage\n=====\n\nBasic usage is simple: Prefix all your easyply rules, except `p_error`,\nwith ``px_`` prefix (instead of the usual ``p_``) and\ncall ``easyply.process_all(globals())`` before creating your PLY parser.\nThe parameter to `easyply.process_all` can be any mapping or class with parser\nfunctions - `process_all` will mutate the parameter and add appropriate\nPLY rules. If you want more fine-grained control, consult the API reference in\nthe source itself.\n\nLicense\n=======\n\nThis library is licensed under the MIT License.\n\nCopyright \u00a9 2011 by Mike Hordecki\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/MHordecki/easyply", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "easyply", "package_url": "https://pypi.org/project/easyply/", "platform": "", "project_url": "https://pypi.org/project/easyply/", "project_urls": { "Homepage": "https://github.com/MHordecki/easyply" }, "release_url": "https://pypi.org/project/easyply/1.2.1/", "requires_dist": null, "requires_python": "", "summary": "Helper functions for PLY (Python Lex & Yacc)", "version": "1.2.1" }, "last_serial": 2607608, "releases": { "1": [ { "comment_text": "", "digests": { "md5": "7a298c78f8dd95b5cc7cd40bb3753926", "sha256": "a0b6dbd052c5b240c1b6231a8ac912bebb98e816ebc901c81e88a930c3549701" }, "downloads": -1, "filename": "easyply-1.tar.gz", "has_sig": false, "md5_digest": "7a298c78f8dd95b5cc7cd40bb3753926", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4433, "upload_time": "2011-11-23T00:16:13", "url": "https://files.pythonhosted.org/packages/78/21/a0efa7e56657fcee0daf8b4da881eef4523567bc902cb5ef2bf7da00d522/easyply-1.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "5983bf1cae1aea92989b7f930b0a9d84", "sha256": "bbc99c1bc53bd4328d1262e35bbacd4160d8876746f8744757877d0a63ea9e35" }, "downloads": -1, "filename": "easyply-1.0.tar.gz", "has_sig": false, "md5_digest": "5983bf1cae1aea92989b7f930b0a9d84", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4433, "upload_time": "2011-11-23T00:16:42", "url": "https://files.pythonhosted.org/packages/da/0d/4d028b59e49eeb14271c1f8e40a86d792f66f375abf3eeb3ac8a33a15957/easyply-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "ce16b0cad1490e2cdbb1ea171b06b1d1", "sha256": "3b7b29ac18ec893e98068bbe412744641aa3b177ab661f9bfcae5778f62edb85" }, "downloads": -1, "filename": "easyply-1.0.1.tar.gz", "has_sig": false, "md5_digest": "ce16b0cad1490e2cdbb1ea171b06b1d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5750, "upload_time": "2011-11-23T00:33:09", "url": "https://files.pythonhosted.org/packages/e9/76/474d4f0ea17fa42f48ba72163af945e134ea5bc90ffa4f82dedb4a4f4022/easyply-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "3e65ec1d218d3d69b4202c5d38e6f13c", "sha256": "6b0d6fac6ebd802f0805bd6f1369d1a10099f229fab40529f6697bb3a0820ad0" }, "downloads": -1, "filename": "easyply-1.0.2.tar.gz", "has_sig": false, "md5_digest": "3e65ec1d218d3d69b4202c5d38e6f13c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5746, "upload_time": "2011-11-23T00:34:42", "url": "https://files.pythonhosted.org/packages/0b/f7/49e641bb3d8b772ee3ec56ec5c195cdb6dba718c58338a22104ad9e480d8/easyply-1.0.2.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "97f7b17b6ceaf5ac6de85bd4aa35ddde", "sha256": "b7f2830ad05c79df9182f0400fc8c60c2928eed44ed08ecdb359ebd82c5c783a" }, "downloads": -1, "filename": "easyply-1.1.tar.gz", "has_sig": false, "md5_digest": "97f7b17b6ceaf5ac6de85bd4aa35ddde", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8734, "upload_time": "2011-12-25T20:26:06", "url": "https://files.pythonhosted.org/packages/49/01/31140cab733b666284344820595c7082f4a29d35620391bf4885106f2ca0/easyply-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "370f74ae3ef50993102189383470c44d", "sha256": "6285e33f56dd32d62446dd150349336a9b23b4a628f29535fe76df7db8e837e4" }, "downloads": -1, "filename": "easyply-1.2.tar.gz", "has_sig": false, "md5_digest": "370f74ae3ef50993102189383470c44d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8921, "upload_time": "2016-02-03T01:19:15", "url": "https://files.pythonhosted.org/packages/8f/9e/fd223ccbca4a6dca7853ac17cbe7f33c3c1c061b3d2025a434fc8fd7db31/easyply-1.2.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "175066980dfa1cc4d9c138e4e567d7e5", "sha256": "706af98ea56243d05389064405002f78a16c2ee8e377eeee253e5471823da9cf" }, "downloads": -1, "filename": "easyply-1.2.1.tar.gz", "has_sig": false, "md5_digest": "175066980dfa1cc4d9c138e4e567d7e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9074, "upload_time": "2017-01-30T21:00:31", "url": "https://files.pythonhosted.org/packages/24/24/d90db0745c95833ba6ac8cba4380a64df4904b7399d13a60b09947903aa1/easyply-1.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "175066980dfa1cc4d9c138e4e567d7e5", "sha256": "706af98ea56243d05389064405002f78a16c2ee8e377eeee253e5471823da9cf" }, "downloads": -1, "filename": "easyply-1.2.1.tar.gz", "has_sig": false, "md5_digest": "175066980dfa1cc4d9c138e4e567d7e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9074, "upload_time": "2017-01-30T21:00:31", "url": "https://files.pythonhosted.org/packages/24/24/d90db0745c95833ba6ac8cba4380a64df4904b7399d13a60b09947903aa1/easyply-1.2.1.tar.gz" } ] }