Call external method from solution model with generated parameter

Hi,

I am working on a DSL for using side-by-side with production code. The user can define an instance of concept A, which gets translated into variable a with type A'. This variable a must be used in user's code.

So my problem is: How may I let the user define a function from it's personal code base (dependencies are fine), so that i can set the function's actual parameters in the generator?

A' is only known to the generator (due to different target platforms), so there should be no dependencies for A' in other modules. The User's production code is obviously totally unknown to the DSL.

Example:

 

WindowedWordCount.createPipeline(null); // -> should be generated into 
WindowedWordCount.createPipeline(sampleSource);
0
3 comments

If I understand correctly, you need to insert an instance of a concept that represents a reference to "sourceList" into the indicated position within the "pipeline".

During generation this reference must be reduced into a reference to the variable that gets created from the "sourceList", which most likely will require using mapping labels.

0

Is there a concept to let the dsl-user reference a function without parameters, so i can fill them? Or do i have to manipulate the given Function ("createPipeline") so that i can replace "null" with some variables via a mapping label?

I thought the best way was to let the user define something like this (Function without parameters, which gets filled by the generator):

from: FunctionCall
parameters: sampleSource, new ProductionCodeObject(), otherSource

So i could generate something like this:

FunctionCall(generatedSampleSource, new ProductionCodeObject(), generatedOtherSource);
0

I might no be getting your question in full, but for sure the example mentioned in your latest comment is easily doable. There is no ready-to-use concept for this. You will have to create your own reference to the function without parameters, also perhaps concepts to represent the parameters on the second like ("sampleSource", "otherSource") and then reuse the existing Expression subconcepts (GenericNewExpression).

Vaclav

0

Please sign in to leave a comment.