Reference to a Field

I have a setup where a choose a class constructor from a given list from a java class and choose also the parameters. With ref_Stack I want a reference to this constructor, but I want to have instead an VariableReference, so to an instance of the Stack class so I can call the methods. I don't know if this is even possible.

setup: Stack with 5   
test ref_Stack

At ref_Stack I can choose the previous defined Stack in setup as Expression, but since it's an constructor I have only the possibility for Stack.<static_staff> things. Is there a way to reference to the Instantiation of Stack to access its methods?

Thanks in advance.



0
1 comment
Avatar
Permanently deleted user
am not able to fully grasp what you've mentioned but let me try to rephrase what you would like to have .

If we were to try in java context , i would say [#may not be java-wise correct but just an example]

Integer a = new Integer (2);

and then say a  method call to :

a.add(3)

And now we would like a new projectional transformation for the same operation in our MPS editor to look like this :

setup Integer 2

test add 3

and you want the above to have the projectional benifits of actions/transforms etc , right?

I can try visualizing to build this by first analyzing the node graph via node-explorer by writing the precise java statements in one editor and then re-implementing it with a mix of concept extension with specializations and constructor behaviour.Am not very experienced with MPS,am learning too, but just trying to help.
0

Please sign in to leave a comment.