Skip to content

A Python Parser which can Parse and PrettyPrint/Auto Format Scheme Code.

Notifications You must be signed in to change notification settings

reuelrds/PrettyPrinter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scheme Pretty Printer

By Xinyue Yu and Reuel D'silva for CSC 4101 Programming Languages Course.

The Scheme Pretty Printer takes in a scheme expression and pretty-prints it back to the console.


 

Project Specific details

We have left factored the grammar by introducing a new non-terminal rest' after converting it into BNF form.

The pretty printing for each of the tokens and special form objects is implemented into their respective print method. We followed Dr Baumgartner's suggestion to use the indendation parameter to recognize when the pretty printer needs to print a newline (i.e. when the indendation is negative, the program does not print a newline, and when it is positive, it prints a new line).

The tests.scm file in the project root contains a set of test cases that we used to test our implementation. The outputs of these test cases matches the output of the reference implementation.

To run the Program

python3 SPP.py

About

A Python Parser which can Parse and PrettyPrint/Auto Format Scheme Code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published