ion-cli icon indicating copy to clipboard operation
ion-cli copied to clipboard

Adds changes for sequence data type

Open desaikd opened this issue 1 year ago • 0 comments

Issue #, if available:

Description of changes:

This PR works on adding new model changes following up on #135. This Pr only contains changes for Sequence. This PR disables Rust support until the entire functionality for the new model change is supported and uses feature branch new-model-changes as target.

List of changes:

  • Generator changes:

    • Adds build_wrapped_sequence_from_constraints which is used for constructing named sequence data type as data model.
    • Adds build_sequence_from_constraints which is used for constructing nested sequence data type as data model. (Doesn't have a name)
    • Adds is_nested flag in convert_isl_type_def_to_data_model_node which can be used to either call wrapped sequence or sequence ADT construction.
    • Modified sequence construction to move the common logic at the beginning of the method.
  • Model changes:

    • Changes Sequence and WrappedSequence ADT to represent the underlying sequence type with base_type and its name with name field.
    • Adds doc comment changes for the same
  • Adds templates changes for java/sequence.templ

Generated code:

The generated code still stays the same only the template changes to use the new model. (Only added sequence files for checking this change, other files remain same)

Generated Java code can be found here.

Tests:

  • Adds tests for ISL to model conversion.
  • Modifies roundtrip code gen tests for sequence test cases.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

desaikd avatar Sep 18 '24 20:09 desaikd