Skip to main content

Collections of tools useful for syntax analysis part of compiler design

Project description

compiler-toolkit

Collection of programs useful for syntax analysis. screenshot of the tool


$ 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

  1. ./run_tests.sh

TODOs

  • Add docstrings to functions
  • Add test cases for parsing table
  • Add more tests cases

Useful Links

Project details


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)

Uploaded Source

Built Distribution

compilertk-0.12.2-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

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

Hashes for compilertk-0.12.2.tar.gz
Algorithm Hash digest
SHA256 0d324e12d60142ba59c9126b9196f9406cb4bdc0ab37c197865424711dcf032e
MD5 5cbc5831b209f90baf94e8875248af83
BLAKE2b-256 d7e316e38fbd42e7e20e1b0a854cfb8fd1203f7486a38aa405927cad2166bda4

See more details on using hashes here.

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

Hashes for compilertk-0.12.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6644674913110881091b6f53bdc2040c33e260d76273da40439d136979360bc4
MD5 f2a185a02becb4ffcfc623e00bea40e5
BLAKE2b-256 1268edcf29c6b799ff44245393151832dbe1e76656980ffdc9fe3c24e26ed090

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page