This PR works on adding changes for using the new model created with #123
List of changes:
Changed the generator code to use DatModelNode and AbstractDataType for setting up data model based on constraints
Added few new utility methods to model module
Added changes to templates to use the new data model
Templates uses FullyQualifiedTypeReference instead for the entire model for references and uses a type store to get the actual data model node
Separated out import statements for classes
Classes template now uses recursion to print nested types instead of the prior nested_type template which had duplicate statements
Currently removes Rust support until the templates for rust are modified to use the new code gen model.
Generated code in Java:
Note: Rust templates are not yet changed based on the new model hence the support for Rust is put under a TODO for now.
Overall the generated code still remains same(Except that it uses fully qualified names now) but the way template engine renders it has changed.
Issue #, if available:
Description of changes:
This PR works on adding changes for using the new model created with #123
List of changes:
DatModelNode
andAbstractDataType
for setting up data model based on constraintsmodel
moduleFullyQualifiedTypeReference
instead for the entire model for references and uses a type store to get the actual data model nodenested_type
template which had duplicate statementsGenerated code in Java:
Note: Rust templates are not yet changed based on the new model hence the support for Rust is put under a TODO for now. Overall the generated code still remains same(Except that it uses fully qualified names now) but the way template engine renders it has changed.
Generated Java code can be found here.
Tests:
Modified the current tests to use fully qualified names instead of relative names in Java.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.