How to compare two concept variables


Is there any way to compare to variables of type concept<>? I want to find out if one is a subconcept of the other one. As far as I see the isSubConceptOf method only allows concept declarations as parameter and no variables of type concept<>.

Many thanks
Comment actions Permalink
Perhaps I should clarify what I'm trying to do:
I want to reuse several baselanguage expressions in my language. So I try to write a util method for can be ancestor constraints that checks if an expression is supported.
It would be nice to specify two arrays/collections, one with included expressions and one with excluded. So I can use all BinaryOperations but not the NPEEqualsExpression.
Of course I can use a statement like expression.isInstantOf(BinaryOperation) &&!(expression.isInstantOf(NPEEqualsExpression)). But since there are several expressions this statement will get long. A loop will be much nicer. Perhaps there is a total different way to deal with this issue.
Comment actions Permalink
When you look at what isSubConceptOf generates, then I think the following should work:
concept<> c = concept/IntegerConstant/; 
concept<> c2 = concept/IntegerLiteral/; 
if (SConceptOperations.isSubConceptOf(c, c2.getFqName())) {
Comment actions Permalink
Thanks, this hack works! But this should bei possible in smodel language, too.

Please sign in to leave a comment.