Interface GeneratorRuntime

  • All Known Subinterfaces:
    TemplateModule
    All Known Implementing Classes:
    TemplateModuleBase, TemplateModuleInterpreted2

    public interface GeneratorRuntime
    Runtime counterpart for Generator module, much like LanguageRuntime for Language. Might need revision once better idea about: (a) LanguageRuntime and accompanying classes - what do they mean and how do they relate to the rest of API (e.g. SModule) (b) idea module structure (e.g. generator-engine split to api and impl; or kernel split to keep LanguageRuntime separate) (c) what messages outer world may want to send to generator runtime
    • Method Detail

      • getSourceLanguage

        @NotNull
        LanguageRuntime getSourceLanguage()
        IMPLEMENTATION NOTE: Now GeneratorRuntime is instantiated with appropriate runtime instance of its language, which is natural given the way generators are declared. However, another approach seems more general and is worth considering: (a) GeneratorRuntime could answer SLanguage/set{SLanguage} itself (GR instantiated using no-arg default constructor) (b) GR doesn't tell its source language, instead, this information is recorded externally e.g. in module descriptor/manifest Though (b) is most flexible, (a) seems to be aligned with the rest of MPS and more convenient provided we need to go from GR to LR and back. (c) LanguageRuntime of source language is kept internally by GeneratorRuntime, and it registers/unregisters itself with API of attach/detach (to hide implementation details, although LR is hardly an implementation detail to hide)
        Returns:
        language this generator is associated with