Created by: eak24
This PR attempts to demonstrate the power, flexibility and maintainability of creating generated code using an AST parser instead of mustache templates. With a very readable 10 lines of code and no mustache templates, I was able to convert a collection of CodeGenModel
s into valid Java classes with fields and getters and setters, with proper indentation and everything. This method completely outsources the burden of string manipulation, linting and a lot of the frustrating parts of maintaining and thinking about the code structure to the JavaParser package (for Java). I'd argue that reading and thinking about this code is far easier than trying to reason about the combination of Mustache templates and String wrangling that the generators currently use. A downside is that you have to use a different AST generator for each language. But on the other side, that allows for each generator to be written in the language of the generated code itself. This isn't really meant to replace the current generators at all, but rather demonstrate the power of working with the AST directly.