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.1.tar.gz
(10.1 kB
view hashes)
Built Distribution
Close
Hashes for compilertk-0.12.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19f15e5e844e458b3962b9c7ed5eedb39efaf7849e707aa1421d66cfead66769 |
|
MD5 | 1f6147a8b9f791929692d3b768a071e5 |
|
BLAKE2b-256 | e74ed99cde7a549c4b942b4d3b22862dc3d2a46adfb580f45dbd912330d44e30 |