2 years ago

#21403

test-img

jgshurts

JetBrains MPS editor with polymorphic list?

I'm working with MPS for the first time, and hitting some interesting problems. One has stumped me.

I'm trying to create a simple DSL for music notation. I have a concept called TemporalUnit (something that occupies time), with sub-concepts of Note and Rest.

I'd like my Measure editor to allow a mixture of Notes and Rests. I declared it as having a list of TemporalUnits, but that seems to treat TemporalUnit as a concrete class, and Note and Rest are ignored. Is there a way I can have the editor allow a "heterogeneous" mix of subtypes of a common ancestor concept?

dsl

mps

0 Answers

Your Answer

Accepted video resources