I'm building a DSL in MPS for my bachelor thesis and need your help. I just started with MPS and got a lot of insight with the online documentation and also the two reference books on the jetbrains website. But I can't figure something out how to do it. To give you some insight, I want to build a language to support the JUnit framework in Java and generate testcode it in a simple manner.
It should look like this
<method> with parameters <x> = <choose_input>, ... where result.size() >= 5
I'm now there were I select the java class, select the method according to this class and also the parameters, using typesystem, constrains. The tricky part where I'm stuck is the "where" part. What I want to do is to have the result of the method, or staticfields of the class and use it within a DotExpression or some other Expression.
My approach is that I have a "Field" concept where I use a reference to BaseMethodDeclaration and in the editor I can access the returnType. I also have a child Expression where I want to use my Type to use a comparison operator, or if it's a class a dot operator. I used constrains to have the right returnType of that particular method, but how can I manipulate this that in the editor stands: 'result' and I can make Expression on that? I'm just clueless, I couldn't find anything in the examples or anywhere online. Maybe you can give me some hint how to go about this. I appreciate any help you can give me.