https://github.com/johnyf/astutils
Bare essentials for building abstract syntax trees, and skeleton classes for PLY lexers and parsers.
https://github.com/johnyf/astutils
ast parse ply python syntax-tree
Last synced: about 1 month ago
JSON representation
Bare essentials for building abstract syntax trees, and skeleton classes for PLY lexers and parsers.
- Host: GitHub
- URL: https://github.com/johnyf/astutils
- Owner: johnyf
- License: other
- Created: 2015-04-18T00:51:10.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2024-10-31T16:06:47.000Z (6 months ago)
- Last Synced: 2025-03-18T12:03:21.481Z (about 1 month ago)
- Topics: ast, parse, ply, python, syntax-tree
- Language: Python
- Homepage: https://pypi.org/project/astutils
- Size: 62.5 KB
- Stars: 15
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status][build_img]][ci]
About
=====Bare essentials for building abstract syntax trees (AST) and Python
`lex`-`yacc` ([PLY](https://github.com/dabeaz/ply)) parsers.
The package includes:- two classes for tree nodes: `Terminal`, `Operator`
- a `Lexer` and `Parser` class, and a helper function to erase and
rewrite the table files.The examples under `examples/` demonstrate how to use these classes to create
a richer AST, a parser, and different backends that use the same parser.These classes provide the boilerplate for parsing with PLY, and are based on
code that was developed in [`tulip`](
https://github.com/tulip-control/tulip-control)
and [`promela`](https://github.com/johnyf/promela).License
=======
[BSD-3](https://opensource.org/licenses/BSD-3-Clause), see file `LICENSE`.[build_img]: https://github.com/johnyf/astutils/actions/workflows/main.yml/badge.svg?branch=main
[ci]: https://github.com/johnyf/astutils/actions