Obtain enumerations of a language.

It's easy to reflectively get a hold of all concepts in a language('s structure): SLanguage.getConcepts(). However, I also would need the enumerations and SLanguage.getEnumerations() doesn't exist.

Is there another way of achieving that?

3 comments
Comment actions Permalink

I would think that this is either a deliberate API-decision or a hole in the API (something only a MPS dev can really answer).

This is, btw. true for all DataTypeDeclaration_s, not just Enums. Again, it might be worthwhile to add a feature request to youtrack if you have a use case where this API is needed (personally, I think it should just be there for consistency reasons).

0
Comment actions Permalink

I found another way to get a hold of the enumerations: I can harvest node<EnumerationDataTypeDeclaration> instances from the properties of all concepts, so that solves my immediate concern.

I'll open a YouTrack ticket to suggest broadening the API.

2
Comment actions Permalink

Good stuff, thanks for sharing this workaround.

0

Please sign in to leave a comment.