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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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