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

Add support for writing SExpression in code generation

Open desaikd opened this issue 1 year ago • 0 comments

Issue #105:

Description of changes:

This PR works on adding support for writing SExpression in code generation.

Generates Code:

  • Generated code for given ISL test files in Java can be found here
  • Generated code for given ISL test files in Rust can be found here

List of changes:

  • Adds changes to support sequence types with type constraint
    • Modifies AbstractDataType::Sequence to store sequence type (sexp or list) and element type
    • Adds element_type() and sequence_type() methods on AbstractDataType to get element type and sequence type details
    • Renames verify_abstract_data_type_consistency to verify_and_update_abstract_data_type
    • verify_and_update_abstract_data_type modified to check for special cases when type and element cosntraints occur together
    • JavaLanguage and RustLanguage updated target_type to return generic type for List and SExp
    • Adds wrapper_class in JavaLanguage to be sued within ArrayList
  • Adds result template to generate SerdeResult in Rust
    • Adds template to generate SerdeResult in Rust
    • Changes current tests to use SerdeResult
    • Changes generator to render SerdeReuslt in output module
  • Adds template file changes for SExp support
  • Adds new test files for SExp support
    • Adds new fields that uses SExpression in Ion files
    • Adds bad Ion files to verify SExpression and List are properly serialized-deserialized
    • Adds ISL files with Sexpression field changes
    • Adds changes to Java setter tests

Tests

Modifies roundtrip tests for given ISL files and input Ion values to verify SExpression support.


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

desaikd avatar May 02 '24 21:05 desaikd