Class ModelTranslator

  • All Implemented Interfaces:
    IMessageReceiver

    public class ModelTranslator
    extends AbstractModelTranslator<Script,​de.uni_hildesheim.sse.vilBuildLanguage.LanguageUnit>
    Implements the translation from the DSL to the build model in the instantiator core.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • ModelTranslator

        public ModelTranslator()
        Creates a model translator.
    • Method Detail

      • createModel

        public java.util.List<Script> createModel​(de.uni_hildesheim.sse.vilBuildLanguage.ImplementationUnit unit,
                                                  java.net.URI uri,
                                                  boolean registerSuccessful,
                                                  ImportResolver<Script> impResolver)
        Creates a build model from a given implementation unit. This is the top-level entry method.
        Parameters:
        unit - the language unit to be translated
        uri - the URI of the project to resolve (in order to find the closest project, may be null)
        registerSuccessful - successfully created models shall be registered
        Returns:
        the corresponding build model
      • createScript

        protected Script createScript​(java.lang.String name,
                                      ModelImport<Script> parent,
                                      Script.ScriptDescriptor<Script> descriptor,
                                      TypeRegistry registry)
        Creates a script instance.
        Specified by:
        createScript in class AbstractModelTranslator<Script,​de.uni_hildesheim.sse.vilBuildLanguage.LanguageUnit>
        Parameters:
        name - Name of the project.
        parent - the super script to inherit from (as a script import, may be null, shall be member of imports or also null)
        descriptor - the descriptor carrying parameters, advices and imports (may be null)
        registry - the responsible type registry