Class Language

    • Field Detail

      • LANGUAGE_MODELS

        public static final String LANGUAGE_MODELS
        Default, although not mandatory location we save our models to. Made public just for the sake of tests.
        See Also:
        Constant Field Values
      • LEGACY_LANGUAGE_MODELS

        @Deprecated
        public static final String LEGACY_LANGUAGE_MODELS
        Deprecated.
        Use of default value to detect aspect source root or to check module existence is wrong.
        See Also:
        Constant Field Values
    • Method Detail

      • getAllExtendedLanguages

        @NotNull
        public Set<Language> getAllExtendedLanguages()
        All the language modules extended by this one within the same repository this module is attached to. For detached module, the set returned is empty. To access 'raw' information about extended languages, one could use getExtendedLanguageRefs(). This method requires model read access as it resolves modules. IMPORTANT: if any extended language is missing from the repository of the module, it's simply ignored and not included into outcome (nor the closure of its extended languages). NOTE, implementation hides cyclic dependencies between languages, e.g if "A extends B extends A", you'd get "A extends B" for A and "B extends A" for B.
      • validateExtends

        public void validateExtends()
      • getLanguageVersion

        public int getLanguageVersion()
      • setLanguageVersion

        public void setLanguageVersion​(int version)
      • getGenerators

        public Collection<Generator> getGenerators()
        Returns:
        all generators that treat this language as their source one.
      • getOwnedGenerators

        public Collection<Generator> getOwnedGenerators()
        PROVISIONAL API, DON'T USE UNLESS YOU'RE 100% SURE WHAT IS THE REASON FOR THAT, AND WHAT'S THE (UPCOMING) DIFFERENCE WITH getGenerators() NOTE: BE CAREFUL WHEN INVOKED FROM A CODE THAT REACTS TO MODULE DESCRIPTOR CHANGES if invoked with a changed MD, gives state according to MD contents, and not the one exposed in the repository (think about scenario when a repo-registered, language-owned generator has been removed from MD. This method would give empty set despite the fact generator module is there)
        Returns:
        generators declared and controlled by this language module.
      • getConceptDeclarations

        @Deprecated
        public List<SNode> getConceptDeclarations()
        Deprecated.
        method is not bad per se (Language module could tell SNode with concept declaration. However, it silently excludes Interface concepts, and likely its uses need attention and switch to SConcept. Then, we could decide whether we truly need access to language's concept nodes this way, or shall use LanguageAspects instead.
      • getUtilModels

        public List<SModel> getUtilModels()
      • getStructureModelDescriptor

        public SModel getStructureModelDescriptor()
      • save

        public void save()
        fixme why generator saves language?? generator is contained in language it must be the other way around!
        Specified by:
        save in interface EditableSModule
        Overrides:
        save in class AbstractModule
      • getAccessoryModels

        public List<SModel> getAccessoryModels()
      • isAccessoryModel

        public boolean isAccessoryModel​(SModelReference modelReference)
      • removeAccessoryModel

        public void removeAccessoryModel​(SModel sm)
      • getLanguageForLanguageAspect

        public static Language getLanguageForLanguageAspect​(SModel modelDescriptor)
      • isLanguageOwnedAccessoryModel

        public static boolean isLanguageOwnedAccessoryModel​(SModel sm)
      • getLanguageFor

        public static Language getLanguageFor​(SModel sm)
      • collectMandatoryFacetTypes

        protected void collectMandatoryFacetTypes​(Set<String> types)
        Description copied from class: AbstractModule
        For the time being, MPS enforces certain facets for modules (e.g. Java facet is essential for classloading mechanism). As we move forward with facets story, we likely respect actual facets for the module (e.g. would force Java facet on module creation only) Need to ensure classloading could deal with modules without Java facet, then can drop these mandatory facets altogether
        Overrides:
        collectMandatoryFacetTypes in class AbstractModule