Get instance from GenericNewExpression

Hello.

I have a concept that contains one child of type Expression. The idea is to be able to define java.awt.Color instance as a child. It works fine but Expression can also be like "new Color(230, 230, 250)". This expression is of concept "GenericNewExpression" with a creator of concept "ClassCreator".

My question: how to use GenericNewExpression to get an instance of "new Color(230, 230, 250)"? The behavior method "getCompileTimeConstantValue" returns null for this expression (but returns instance if it will be some constant like Color.RED).

0
1 comment

Are you asking how to interpret arbitrary Java expressions in MPS? There's no built-in functionality for that in MPS, you'd have to write your own.

0

Please sign in to leave a comment.