Generation of action script Follow
I'm trying out a little example to generate action script files. Currently I can only find examples generating java classes.
Do I have to specify action script as a language before I can generate into action script or is it possible to create general templates? When defining a language like actionscript, can I extend existing language components to create the language?
Please sign in to leave a comment.
There are two ways to do what you want.
First option is to generate plain text. We have jetbrains.mps.gtext language for this purpose.
Second option is to create a language corresponding to action script (you need to provide text generator for it or create a generator to gtext) and generate to it.
Thanks for the quick reply.
I guess the preferred way would be to create the action script language, as this allows to put constraints on the language and prevent errors which cannot be prevented when generating plain text.
If I choose to create the action script language, how can I translate my primary language into the action script language? Can you use the editors of the action script language in the generator of the primary language?
In order to generate code from your language to action script, you need to create a generator in your language and add actions script language to used languages section. After that, you can use action script inside of templates. If you add a language to used languages section, you will be able to use editors, constraints etc.