Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce technology-specific library types #63

Open
frademacher opened this issue Oct 7, 2022 · 0 comments
Open

Introduce technology-specific library types #63

frademacher opened this issue Oct 7, 2022 · 0 comments
Assignees
Labels
technology modeling Issue concerns technology modeling with LEMMA

Comments

@frademacher
Copy link
Collaborator

Currently, there is no modeling means to retrofit LEMMA with types from external libraries. Instead, model processors must always be adapted to support such types. For example, to support code generation for the type LocalDate from Java's Time API, it is required to extend the Java Base Generator class TypeMappings with an entry like

technology {
    ...
    "LocalDate" withImport "java.time.LocalDate"
}

and the have a technology model with

...
types {
    ...
    primitive type LocalDate;
}
...

However, it would be nice to support the specification of types originating from a library of a certain technology (e.g., the standard lib of the Java technology) directly within technology models, e.g., via a new type kind library and with additional library types (that in the case of Java result in additional imports) so that one could write:

...
types {
    ...
    library type LocalDate from library "java.time"
        with additional types "org.example.LibraryClass1", "org.example.LibraryClass2";
}
...

or in the form of "external types", e.g.,

...
types {
    ...
    external type LocalDate with fully-qualified name "java.time.LocalDate"
        requiring "org.example.LibraryClass1", "org.example.LibraryClass2";
}
...
@frademacher frademacher added the technology modeling Issue concerns technology modeling with LEMMA label Oct 7, 2022
@frademacher frademacher self-assigned this Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technology modeling Issue concerns technology modeling with LEMMA
Projects
None yet
Development

No branches or pull requests

1 participant