Interface SLanguage


  • public interface SLanguage
    Reference to a deployed/run-time language. If the specified language is missing in the current MPS instance, only qualified name is guaranteed to return meaningful value. Besides, getLanguageVersion() might be sensible as well, depending on source SLanguage instance comes from (e.g. if it's an used/imported language of a model, then version value indicates actual value at the time import was added/updated).

    At the moment, equality of instances this class doesn't respect version. This might get changed.

    • Method Detail

      • getQualifiedName

        @NotNull
        String getQualifiedName()
        The namespace of the language.
      • getConcepts

        Iterable<SAbstractConcept> getConcepts()
        All concepts defined in the language, empty if the language is invalid (missing).
      • getDatatypes

        @NotNull
        Iterable<SDataType> getDatatypes()
        All datatypes defined in the language, empty if the language is invalid (missing).
      • isValid

        boolean isValid()
        Returns true if this language is fully-functional. Typically, user code should not care about this Can return false, for example, if the language is absent
      • getLanguageRuntimes

        @Deprecated(forRemoval=true,
                    since="2021.2")
        Iterable<SModuleReference> getLanguageRuntimes()
        Deprecated, for removal: This API element is subject to removal in a future version.
        SLanguage is an identity object, use LanguageRuntime#getRuntimeModules() instead
        All the runtime dependencies that a language needs after generation to run the generated code. These will be resolved from the user repository. Empty sequence in case language is invalid/missing.
      • getSourceModule

        @Nullable
        SModule getSourceModule()
        The optional reference to a module containing the sources for the language. This is useful, for example, when showing the definition of a concept for a used language element. It may be null.
      • getSourceModuleReference

        @NotNull
        SModuleReference getSourceModuleReference()
        Reference to a module containing the sources for the language. This is useful, for example, when showing the definition of a concept for a used language element.
      • getLanguageVersion

        @Deprecated
        int getLanguageVersion()
        Deprecated.
        Version of the referenced language. Version is an integer indicating state of a language. It is changed when the structure of this language changes. Typically this means that if some module uses an older version of a language, it should be updated before the user will be able to work with it. E.g. generator can fail on generation of such a model. In MPS 3.2, version is changed only by adding language migrations.
        Returns:
        non-negative version of the language, or -1 the version could not be deduced.