Skip to content

candh/compiler-toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published