Collections of tools useful for syntax analysis part of compiler design
Project description
compiler-toolkit
Collection of programs useful for syntax analysis.
$ pip install compilertk
$ compilertk FILE
Features:
- Elimination of Null Productions
- Elimination of Unit Productions
- Elimination of Left Recursion
- Calculates First Sets
- Calculates Follow Sets
- Prints Parsing Table
- Generates a log file
Notation
Using this example of a grammar:
S -> S a A | B
A -> a A | eps
B -> d E'
E' -> int a | eps
- Every symbol on the left side is a non-terminal
- Non-terminals and its productions are separated by "->"
- Individual symbols are separated with a space.
- Null productions are specified with eps
- | is used to specify alternative productions
Tests
Make sure everything runs fine by running the test cases
./run_tests.sh
TODOs
- Add docstrings to functions
- Add test cases for parsing table
- Add more tests cases
Useful Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
compilertk-0.12.0.tar.gz
(10.1 kB
view hashes)
Built Distribution
Close
Hashes for compilertk-0.12.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c69a78e6cde1f67a5bd199b19003dcc50075c0e8140c0b7b731613af185a39a1 |
|
MD5 | 4bdbca67056366b2e490cb57f0bf3595 |
|
BLAKE2b-256 | 2adfe6de471be4e7a5b954c7adce59b6b177c706294327a6b7e7eccf0bab8175 |