This PR implements a rearchitected approach to code generation, and includes specific documentation on the prioritized requirements of a software like jtd-codegen.
In the end, there's considerable complexity involved in generating good names for classes/structs/types, when dealing with the possibility of naming collisions and other issues.
I believe this code is a push in the right direction, but I am beginning to suspect that a better architecture may be to have a centralized code generation "planner", and then have each target support a common interface for emitting certain sub-structures (like a single struct or enum, or a list of a given type). I believe adding support for a few more languages and variants, like Gson for Java, Golang, and C# would help here.
This PR implements a rearchitected approach to code generation, and includes specific documentation on the prioritized requirements of a software like
jtd-codegen
.In the end, there's considerable complexity involved in generating good names for classes/structs/types, when dealing with the possibility of naming collisions and other issues.
I believe this code is a push in the right direction, but I am beginning to suspect that a better architecture may be to have a centralized code generation "planner", and then have each target support a common interface for emitting certain sub-structures (like a single struct or enum, or a list of a given type). I believe adding support for a few more languages and variants, like Gson for Java, Golang, and C# would help here.