uhmanoa-transpiler-project / shaka-scheme

The official repository for the UH Manoa Transpiler Project's Scheme interpreter, Shaka Scheme.
32 stars 24 forks source link

Created MacroContext, basic scope tracking algorithm #44

Closed CinchBlue closed 6 years ago

CinchBlue commented 6 years ago

I've created MacroContext and SyntaxRulesMacro as classes to encapsulate the macro-expansion-time lexical information tracking and syntax-rules macro implementation, respectively.

Many of the actual functions used lies in macro_engine.hpp, though, so be aware.

The two classes and many of the functions have been manually tested, but not turned into unit tests.

I have tested the following:

let-syntax and define-syntax forms are to be filled in once the SyntaxRulesMacro class and functionality is filled out in the future.

Note: the (define (foo x y) ...) form appears to be working correctly -- I have implemented some basic re-writing functionality for it, provided that define is put into the HeapVirtualMachine's environment as PrimitiveFormMarker("define"). This is new functionality.

Please check to see that the functions provided are robust for correctly assembling the correct identifier bindings with their sets of scopes.

Please check that the only unit test case given is working correctly. You may want to uncomment the many std::cout statements if you want to see debugging output.