# iAST #
(Supports Python 3.3 and 3.4)
This library provides a way of defining and transforming abstract syntax trees (ASTs) for custom languages. It can be used to help build a compiler or other program transformation system.
iAST reads your language’s abstract syntax from an ASDL grammar, and automatically generates node classes. A standard visitor-style framework is provided for traversing, transforming, and pattern matching over trees. Nodes are hashable, have structural equality, and support optional type checking. (Parsing is not supported and should be handled by an external parser generator.)
Node definitions for the ASTs of Python 3.3 and Python 3.4 are provided out-of-the-box, along with tools for writing code templates and macros targeting Python code. However, the main framework works on ASTs for arbitrary languages.
## Examples ##
See [arith.py](examples/arith.py) for basic usage and visitors/transformers. See [toy.py](examples/toy.py) for a comparison with Python’s own ast module and the use of type checking. Both examples use abstract grammars from the corresponding ASDL files.
## Installation ##
To install from pip/PyPI:
` python -m pip install iast `
To use a development version:
` python -m pip install https://github.com/brandjon/iast/tree/tarball/develop `
Python 3.3 and 3.4 are supported. The only dependency is [simplestruct](https://github.com/brandjon/simplestruct), which is used to define the node classes.
## Developers ##
Tests can be run with python setup.py test, or by installing [Tox](http://testrun.org/tox/latest/) and running python -m tox in the project root. Tox tests both Python 3.3 and 3.4 configurations. Building a source distribution (python setup.py sdist) requires the setuptools extension package [setuptools-git](https://github.com/wichert/setuptools-git).
## References ##
[1]: https://github.com/eliben/asdl_parser [[1]]: Eli Bendersky’s rewrite of the Python ASDL parser, which powers iAST’s generation of nodes from ASDL.
Metadata
Release files for iAST 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iAST-0.2.1.zip | 46.6 kB | Without provenance | Details for iAST-0.2.1.zip |
Release files / iAST-0.2.1.zip
| Download URL | iAST-0.2.1.zip |
|---|---|
| Size | 46.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad869bb461c30753582500ac1c1e8cd1c113e6a946bd6548ff55c0c58854176c
|
|
BLAKE2b-256 checksum How to use checksums |
61d2b0ced4c37d8586c08f0e1b1f5a3c296d0c65b73c1a667555421879a71c8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for iAST 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.