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.2.tar.gz
(10.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file compilertk-0.12.2.tar.gz.
File metadata
- Download URL: compilertk-0.12.2.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d324e12d60142ba59c9126b9196f9406cb4bdc0ab37c197865424711dcf032e
|
|
| MD5 |
5cbc5831b209f90baf94e8875248af83
|
|
| BLAKE2b-256 |
d7e316e38fbd42e7e20e1b0a854cfb8fd1203f7486a38aa405927cad2166bda4
|
File details
Details for the file compilertk-0.12.2-py3-none-any.whl.
File metadata
- Download URL: compilertk-0.12.2-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6644674913110881091b6f53bdc2040c33e260d76273da40439d136979360bc4
|
|
| MD5 |
f2a185a02becb4ffcfc623e00bea40e5
|
|
| BLAKE2b-256 |
1268edcf29c6b799ff44245393151832dbe1e76656980ffdc9fe3c24e26ed090
|