how 'deep' does .children go for a concept?... Follow
This is an auto-generated question from the MPS Slack community: how 'deep' does .children go for a concept?
13 comments
Sort by
Date
Votes

Comment actions
Permalink
testing with

Comment actions
Permalink
suggests that .children does not recurse down in the ast, but the ancestor does?

Comment actions
Permalink
Yes, sounds like .anchestors is the operation you are looking for. The children operation return's the children of the node but not children of children etc.

Comment actions
Permalink
that's not nice :stuck_out_tongue:

Comment actions
Permalink
Would you like to have the same behaviour for ancestors and children? What would you like to archive?

Comment actions
Permalink
the level 2 children of a concept need to be updated by a listener

Comment actions
Permalink
the listener has to find these children and update their properties

Comment actions
Permalink
So something like . children<type>.select(it.children)

Comment actions
Permalink
yes, but that's only two levels deep

Comment actions
Permalink
There is .descendants

Comment actions
Permalink
my bad! I mixed up ancestors and descendants:man-facepalming:

Comment actions
Permalink
children = 1 level
descendants = all levels
I guess if you explicitly need children of the 2nd level, you have to implement a dedicated method or base language extension.

Comment actions
Permalink
This is auto-generated question from the MPS Community Slack Workspace. If you want to comment on the question, do it from the Slack workspace
Post is closed for comments.