maestro icon indicating copy to clipboard operation
maestro copied to clipboard

Introduce Builder throughout - removing specification-available expansion plugins?

Open CThuleHansen opened this issue 4 years ago • 2 comments

Currently the MablTemplateGenerator creates a specification containing expansions. This means, that this can be picked up later on and processed to generate the desired spec.

If the MablTemplateGenerator creates a MablApiBuilder that has to be passed on to the expansion plugins, then it violates the possibility of having a specification with expansions that are yet to be expanded. Thus, the idea of expansion plugins still live, but having expansions within a specification does not.

Shall we drop this entirely? And just perform code-generation basically?

  • How should we invoke expansion plugins when using a builder?
  • How should we pass builder data to expansion plugins when using a builder?

CThuleHansen avatar Feb 09 '21 12:02 CThuleHansen

Proposal: Currently the plugins receive the following:

public List<PStm> expand(AFunctionDeclaration declaredFunction, List<PExp> formalArguments, IPluginConfiguration config,
            ISimulationEnvironment envIn, IErrorReporter errorReporter)

How about changing the ISimulationEnvironment to also include a builder? So I becomes simulationContext, which in turn includes the simulationenvironment. How's this @lausdahl ?

CThuleHansen avatar Feb 12 '21 14:02 CThuleHansen

Create an additional interface method:

public void expand(AFunctionDeclaration declaredFunction, ContextObj, IPluginConfiguration, DoubleVariable, DoubleVariable, IntVariable, List<Fmi2Components> components)
  • [ ] Can we automatically map a MaBL lex identifier to DoubleVariable?

CThuleHansen avatar Feb 12 '21 14:02 CThuleHansen