{ "info": { "author": "Sam Spilsbury", "author_email": "smspillaz@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Build Tools" ], "description": "CMake AST\n=========\n\nStatus\n------\n\n| Travis CI (Ubuntu) | AppVeyor (Windows) | Coverage | PyPI | Licence |\n|--------------------|--------------------|----------|------|---------|\n|[![Travis](https://img.shields.io/travis/polysquare/cmake-ast.svg)](http://travis-ci.org/polysquare/cmake-ast)|[![AppVeyor](https://img.shields.io/appveyor/ci/smspillaz/cmake-ast.svg)](https://ci.appveyor.com/project/smspillaz/cmake-ast)|[![Coveralls](https://img.shields.io/coveralls/polysquare/cmake-ast.svg)](http://coveralls.io/polysquare/cmake-ast)|[![PyPIVersion](https://img.shields.io/pypi/v/cmake-ast.svg)](https://pypi.python.org/pypi/cmake-ast)[![PyPIPythons](https://img.shields.io/pypi/pyversions/cmake-ast.svg)](https://pypi.python.org/pypi/cmake-ast)|[![License](https://img.shields.io/github/license/polysquare/cmake-ast.svg)](http://github.com/polysquare/cmake-ast)|\n\n`cmake-ast` has been tested against every single CMake module that ships with\nrecent versions of CMake. These tests also run in the continuous integration\nenvironment on each build. It supports multi-line strings and other corner\ncases.\n\nUsage\n-----\n\nImport `cmakeast` and ASTify the contents of a cmake file with\n`cmakeast.ast.parse(contents)`. You can also pass it a list of tokens obtained\nby tokenization with the `tokens` keyword argument. The return will be a\ntoplevel node, with node descriptions as follows:\n\n`Word`\n\n- (One) `Type`\n `type: Variable | String | Number | CompoundLiteral | VariableDereference`\n- (One) `String` `contents`\n\n`Body`\n\n- (Many) (`FunctionCall`, `IfStatement`, `ForeachStatement`, `WhileStatement`)\n\n`FunctionCall`\n\n- (One) `Word` `name`\n- (Many) `Word` `arguments`\n\n`FunctionDefinition`\n\n- (One) `FunctionCall` `header`\n- (One) `Body` `body`\n- (One) `FunctionCall` `footer`\n\n`MacroDefinition`\n\n- (One) `FunctionCall` `header`\n- (One) `Body` `body`\n- (One) `FunctionCall` `footer`\n\n`IfStatement`\n\n- (One) `FunctionCall` `header`\n- (One) `Body` `body`\n\n`ElseIfStatement`\n\n- (One) `FunctionCall` `header`\n- (One) `Body` `body`\n\n`ElseStatement`\n\n- (One) `FunctionCall` `header`\n- (One) `Body` `body`\n\n`IfBlock`\n\n- (One) `IfStatement` `if_statement`\n- (Many) `ElseIfStatement` `else_ifs`\n- (One Optional) `ElseStatement` `else_statement`\n- (One) `FunctionCall` `footer`\n\n`ForeachStatement`\n\n- (One) `FunctionCall` `foreach_function`\n- (One) `Body` `body`\n- (One) `FunctionCall` `footer`\n\n`WhileStatement`\n\n- (One) `FunctionCall` `while_function`\n- (One) `Body` `body`\n- (One) `FunctionCall` `footer`\n\nEach node also has a `line` and `col` member to indicate where it can be\nfound in the source file.\n\nWord type aliases are stored in `WordType` inside `ast`.\n\nTraversing the AST\n------------------\n\nCMake-AST provides a helper module `ast_visitor` to make traversing the AST\nless verbose. It will traverse every single node by default. Listeners\nmatching the signature `def handler (name, node, depth)` can be passed as\nthe following keyword arguments to `recurse (body, **kwargs)`:\n\n| Keyword | Handles Node Type |\n|:---------------:|:--------------------:|\n| `toplevel` | `ToplevelBody` |\n| `while_stmnt` | `WhileStatement` |\n| `foreach` | `ForeachStatement` |\n| `function_def` | `FunctionDefinition` |\n| `macro_def` | `MacroDefinition` |\n| `if_block` | `IfBlock` |\n| `if_stmnt` | `IfStatement` |\n| `elseif_stmnt` | `ElseIfStatement` |\n| `else_stmnt` | `ElseStatement` |\n| `function_call` | `FunctionCall` |\n| `word` | `Word` |\n\nDumping the AST of a CMake file\n-------------------------------\n\nIf you wish to dump the AST of a cmake file, the `cmake-print-ast` tool is\nalso provided. Pass a single filename to dump the AST of to it on the\ncommand line\n\nTokenization\n------------\n\nTo get an even lower level representation, use `cmakeast.ast.tokenize(contents)`\nwhich divides the file only into tokens. Aliases are stored in the `TokenType`\nclass in `ast`. Tokens correspond as follows:\n\n| Token Type | Description |\n|:-----------------:|:--------------------------------------------:|\n| `QuotedLiteral` | Something in quotes |\n| `LeftParen` | `(` |\n| `RightParen` | `)` |\n| `Word` | Alphanumeric Sequence |\n| `Number` | Numeric-Only Sequence |\n| `Deref` | Alphanumeric Sequence inside `${}` |\n| `RST` | Documentation Comment |\n| `Comment` | Comment |\n| `UnquotedLiteral` | Any character sequence, punctuation included |", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/polysquare/cmake-ast", "keywords": "development ast cmake", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "cmakeast", "package_url": "https://pypi.org/project/cmakeast/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cmakeast/", "project_urls": { "Homepage": "http://github.com/polysquare/cmake-ast" }, "release_url": "https://pypi.org/project/cmakeast/0.0.18/", "requires_dist": null, "requires_python": "", "summary": "Parse a CMake file into an Abstract Syntax Tree.", "version": "0.0.18" }, "last_serial": 2453058, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "b4beb344bd19792492d08275359bc4a8", "sha256": "1f5a89804a4d65046ce53cd40a73dacd87706b98228878b2654447062532b5e6" }, "downloads": -1, "filename": "cmakeast-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b4beb344bd19792492d08275359bc4a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8488, "upload_time": "2014-11-24T13:47:36", "url": "https://files.pythonhosted.org/packages/ce/9a/94c9c67a2007c0d00f912ec3358cd31f396eba33ea75d3b133504c9d6bf3/cmakeast-0.0.1.tar.gz" } ], "0.0.10": [ { "comment_text": "", "digests": { "md5": "09ec17f19b6cb5fa6e566ab806e70920", "sha256": "e1297d436b802d0ea5a2b13581827c97128ab4d81d219a53c389a4f5da75302a" }, "downloads": -1, "filename": "cmakeast-0.0.10.tar.gz", "has_sig": false, "md5_digest": "09ec17f19b6cb5fa6e566ab806e70920", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13162, "upload_time": "2015-01-03T15:39:06", "url": "https://files.pythonhosted.org/packages/85/13/ca40af721b304ca17b52d0da36a04feaadc9fa3761f0c49a305ed2996b41/cmakeast-0.0.10.tar.gz" } ], "0.0.11": [ { "comment_text": "", "digests": { "md5": "1930dca449863ba5f58ee04b42181508", "sha256": "bfe9e4c258c2fbd89dbc2de7f6e8d6be45ba6432a5e3cfa29313db038f9e8aaf" }, "downloads": -1, "filename": "cmakeast-0.0.11.tar.gz", "has_sig": false, "md5_digest": "1930dca449863ba5f58ee04b42181508", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17661, "upload_time": "2015-06-11T07:20:43", "url": "https://files.pythonhosted.org/packages/e0/4b/5b64add6406d2dd4b7c28c21a9c5362192187819bd638c06882c0faa7e40/cmakeast-0.0.11.tar.gz" } ], "0.0.13": [ { "comment_text": "", "digests": { "md5": "0a1049b046f0cda4a44f0bd4959ffeca", "sha256": "736c8992c897a2324846ffec726a518e34e3f40d0fafaa085fd93eb6b0bfe557" }, "downloads": -1, "filename": "cmakeast-0.0.13.tar.gz", "has_sig": false, "md5_digest": "0a1049b046f0cda4a44f0bd4959ffeca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17511, "upload_time": "2015-07-30T08:36:26", "url": "https://files.pythonhosted.org/packages/67/ce/e0b96aec4a8affa8a7532f7dbb2d10fb44c1f6c4b36587ca9d5d6d9e25f0/cmakeast-0.0.13.tar.gz" } ], "0.0.14": [ { "comment_text": "", "digests": { "md5": "b6e90fb9e66ae8107567c219bad8748c", "sha256": "feb2fc9eeedf01d3e84944871d357a76a7a9c50d72822e58863b521420c49e1a" }, "downloads": -1, "filename": "cmakeast-0.0.14.tar.gz", "has_sig": false, "md5_digest": "b6e90fb9e66ae8107567c219bad8748c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17509, "upload_time": "2015-08-02T14:17:19", "url": "https://files.pythonhosted.org/packages/66/1e/ddfcf8c582f3956b48196451230272d2f7866c4a2d3900ee577c7c4d21f2/cmakeast-0.0.14.tar.gz" } ], "0.0.15": [ { "comment_text": "", "digests": { "md5": "3ae9bc2a85fda3396d6de1038388dbe9", "sha256": "760336bba80c538b0383d033f06eb352b9e0d065c8ae245fe1dc94005b7bafc8" }, "downloads": -1, "filename": "cmakeast-0.0.15.tar.gz", "has_sig": false, "md5_digest": "3ae9bc2a85fda3396d6de1038388dbe9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19841, "upload_time": "2016-03-03T11:42:28", "url": "https://files.pythonhosted.org/packages/a4/cc/d60a1be3299d39a44a3bc6cc4840ba4aca6ae585255494703ee144edd540/cmakeast-0.0.15.tar.gz" } ], "0.0.16": [ { "comment_text": "", "digests": { "md5": "9c594939a66b706c3fba0f44ddec93cd", "sha256": "c9ad74aaa3188d9a882d5e23cdea88c759756ae7dc032549f3b74297795abb36" }, "downloads": -1, "filename": "cmakeast-0.0.16.tar.gz", "has_sig": false, "md5_digest": "9c594939a66b706c3fba0f44ddec93cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19847, "upload_time": "2016-03-06T16:16:32", "url": "https://files.pythonhosted.org/packages/c7/68/7bee6977bef01304f3ce484a6ca60e90f7c5dcfdb77953f30045d9f9cda5/cmakeast-0.0.16.tar.gz" } ], "0.0.17": [ { "comment_text": "", "digests": { "md5": "1b41ace55b719b9e7f2e851da4ef8c5d", "sha256": "5b76b4c77ffbd11eacfa6ac369ebd53d7687314a4bf6fbaca4d82ede0a0bc9d4" }, "downloads": -1, "filename": "cmakeast-0.0.17.tar.gz", "has_sig": false, "md5_digest": "1b41ace55b719b9e7f2e851da4ef8c5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19844, "upload_time": "2016-03-07T00:00:37", "url": "https://files.pythonhosted.org/packages/0d/25/0a31d6167874b9ad66200e2818cf3c8c92bbaf398fc120e7b8dc379aeac0/cmakeast-0.0.17.tar.gz" } ], "0.0.18": [ { "comment_text": "", "digests": { "md5": "9f7cd52db0a5184eca8c13e4e6edb1c3", "sha256": "fd7b113c2bbb6bad4da046f733f82964ece5a7bc4bbd99bd3aba9938ee1c58be" }, "downloads": -1, "filename": "cmakeast-0.0.18.tar.gz", "has_sig": false, "md5_digest": "9f7cd52db0a5184eca8c13e4e6edb1c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19222, "upload_time": "2016-11-10T13:37:47", "url": "https://files.pythonhosted.org/packages/ad/d2/de05da6b69db3afc2a352f2b722babfcc9d1eed9ad31d37d5e546ceb6c08/cmakeast-0.0.18.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "2079b1907a2d66aab948a68b0e4f1ffb", "sha256": "5aac68795d0bd2701f43373929910da7cba2976e2a5a2340630da51fcb1fe1aa" }, "downloads": -1, "filename": "cmakeast-0.0.2.tar.gz", "has_sig": false, "md5_digest": "2079b1907a2d66aab948a68b0e4f1ffb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9166, "upload_time": "2014-11-25T04:31:17", "url": "https://files.pythonhosted.org/packages/c1/ea/5bbfcfbe21d21873d7081b0ddf8845255199dbf030c44857a8a0687ef950/cmakeast-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "c4c4318636e04c92f364450e3e645433", "sha256": "074a4b81edbc381fa060547372374c20aba1b1c0c10d81f00b25a6de7ff9bcf5" }, "downloads": -1, "filename": "cmakeast-0.0.3.tar.gz", "has_sig": false, "md5_digest": "c4c4318636e04c92f364450e3e645433", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8861, "upload_time": "2014-11-26T08:08:39", "url": "https://files.pythonhosted.org/packages/5d/80/5d854d7fe68bbcc6051db23f4721736062e8546ad766b52b16b71ddcb48b/cmakeast-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "0a72aa4779dc607c1ccfc84055080800", "sha256": "9dc3661c257c1024f5a8578aa3b9f2d0b92db1d7e743055c454173f8724b3264" }, "downloads": -1, "filename": "cmakeast-0.0.4.tar.gz", "has_sig": false, "md5_digest": "0a72aa4779dc607c1ccfc84055080800", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8942, "upload_time": "2014-11-28T01:05:37", "url": "https://files.pythonhosted.org/packages/0c/3a/b8988ab9a67edc5140b2e5abd5eda30ab8279405526a4c27022ee4a9da6e/cmakeast-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "a46a55f78f4fbe86a811ddae8757b9b1", "sha256": "7ea1d6817547ef43b66ecdec21bee3ce58316399b9cec60338dd905e1e2138f5" }, "downloads": -1, "filename": "cmakeast-0.0.5.tar.gz", "has_sig": false, "md5_digest": "a46a55f78f4fbe86a811ddae8757b9b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8977, "upload_time": "2014-11-28T10:58:54", "url": "https://files.pythonhosted.org/packages/fe/8c/798477dc616688b49b61f43094d6617f344d0edfe6ce743f5df4a390fc37/cmakeast-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "a91084fb1dc43dd597b59a7e14e72be5", "sha256": "958d2525828c171f566eec3180140ee720227124ea39f15c65ae4c5c88189210" }, "downloads": -1, "filename": "cmakeast-0.0.6.tar.gz", "has_sig": false, "md5_digest": "a91084fb1dc43dd597b59a7e14e72be5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9004, "upload_time": "2014-11-29T07:10:22", "url": "https://files.pythonhosted.org/packages/10/af/572c160e130c7f99a228d279ffae50b094586f8d86b20dee424b342578a2/cmakeast-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "d74347c548e7f419a4074c6631ed87c7", "sha256": "4e02fb6872112aec4abf81e3ecd3a2a249038fba13ca86896c0cb39dcc33dd4b" }, "downloads": -1, "filename": "cmakeast-0.0.7.tar.gz", "has_sig": false, "md5_digest": "d74347c548e7f419a4074c6631ed87c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9637, "upload_time": "2014-12-13T01:06:04", "url": "https://files.pythonhosted.org/packages/19/d0/d83e4c51865e7c85d127f24c5108177f79e8e6d7283687ca4caf2e9790dd/cmakeast-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "e2b44e30957515670d9dffd9a51ede0d", "sha256": "226195a71cccc911822a866faa933227ae5bbb8f71cac3ca475f4be0dc7ddbd9" }, "downloads": -1, "filename": "cmakeast-0.0.8.tar.gz", "has_sig": false, "md5_digest": "e2b44e30957515670d9dffd9a51ede0d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9688, "upload_time": "2014-12-13T14:23:51", "url": "https://files.pythonhosted.org/packages/10/f6/41b4f5a306d7c710ef2bead1f5d22c405f1f0e1bc40c72af87ada6fd3329/cmakeast-0.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9f7cd52db0a5184eca8c13e4e6edb1c3", "sha256": "fd7b113c2bbb6bad4da046f733f82964ece5a7bc4bbd99bd3aba9938ee1c58be" }, "downloads": -1, "filename": "cmakeast-0.0.18.tar.gz", "has_sig": false, "md5_digest": "9f7cd52db0a5184eca8c13e4e6edb1c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19222, "upload_time": "2016-11-10T13:37:47", "url": "https://files.pythonhosted.org/packages/ad/d2/de05da6b69db3afc2a352f2b722babfcc9d1eed9ad31d37d5e546ceb6c08/cmakeast-0.0.18.tar.gz" } ] }