Closed leoqiao18 closed 1 year ago
Implement a Codegen
module to transform HOA to an internal program representation.
Implement an Imp
module to provide easy template for imperative code generation.
Implement Python and Javascript modules using Imp
.
This makes it simpler to generate code for different languages (see Python and JS module for reference). It also fixes the function/predicate application bug in #39.
Checked some outputs with online syntax validator. Correct for Python and JS.
I think this is ready to be used.
Fixing issue #39 . This is still unfinished, but I want to start this PR to track the progress and maybe have some discussions.
The problem is a lot more ingrained in the method of code generation. The best approach is to define some more datatypes and do transformations on these datatypes, instead of manipulating strings directly and in a hacky way.
I am still thinking about how to do this in the cleanest way possible, but most likely it will be a complete rewrite.