Skip to content

A compiler-compiler built to learn more about compilers

Notifications You must be signed in to change notification settings

lsankar4033/pycc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What?

pycc is a compiler-compiler built in python. Given a grammar Context Free Grammar (CFG), pycc will generate an LL-compiler that recognizes strings of that grammar.

pycc also does some basic grammar normalization:

  • left factoring
  • left recursion removal
Why?

As with rexpy, inspiration originally struck while reading about context free grammars and their compilation in Michael Sipser's Introduction to the Theory of Computation.

I find compilers fascinating as they represent the translation from serial information into a grammatical tree that can represent thought.

How?

In addition to Sipser's book, I referred to MIT and Stanford course notes on compilers for building my LL-compiler generator. This handout was particularly useful and most of the techniques I use come directly from it.

TODO
  • read BNF grammar from file
  • add usage with BNF reader to README
  • add indirect left recursion removal to normalization
  • add escape characters to grammar (optional)
  • docstrings where appropriate

About

A compiler-compiler built to learn more about compilers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages