Can I inherit from other langauges?

I would like to create a new language by extending another language (for

example, let's say I want to extend the base-language with a construct

called "property" that would generate a field, a get and a set-method).

How would I go about doing that? It would be convenient to just be able

to choose a language to inherit from when I do a "New Language". I would

then inherit the whole structure and all editors, and be able to add new

structure and editor nodes for my extra constructs.

-Karl

3 comments
Comment actions Permalink

Karl Avedal wrote:

I would like to create a new language by extending another language (for

example, let's say I want to extend the base-language with a construct

called "property" that would generate a field, a get and a set-method).

How would I go about doing that? It would be convenient to just be able

to choose a language to inherit from when I do a "New Language". I would

then inherit the whole structure and all editors, and be able to add new

structure and editor nodes for my extra constructs.

-Karl

You can extends concepts from another language. And everything will work

correctly. But in models you have to add both languages in language dialog.

For example in MPS jetbrains.mps.bootstrap.editorLanguage uses concepts

from jetbrains.mps.baseLanguage. Collection language extends baseLanguage.

0
Comment actions Permalink

Konstantin Solomatov wrote:

You can extends concepts from another language. And everything will work

correctly. But in models you have to add both languages in language dialog.

For example in MPS jetbrains.mps.bootstrap.editorLanguage uses concepts

from jetbrains.mps.baseLanguage. Collection language extends baseLanguage.

Thanks for the fast reply! I see how it works.

-Karl

0
Comment actions Permalink

hi, you will find inheritance in the "agreement" demo where agreementLanguage inherits (includes, extends ?) from formulaLanguge.

0

Please sign in to leave a comment.