3 Question about the Generator aspect Follow
Hey :)
I'm relativ new to MPS and wrote a language for generating Code (Java and XML).
Currently I'm working on the ".gui" files that should contain the XML. So far my project only consists of the Structure aspect where I define my Concepts and the Generator aspect where for each Concept is defined how to translate it to XML-Code
1) How can I generate the files? I found the preview for nodes of my solution, but I didn't figured out how to create the files
2) So far I used the XML-Language from MPS and created with it the root nodes. Now they're of courseXML-files, but my ending shouldn't be ".xml" instead it should be ".gui". How can I define that and what should I use instead of the XML-Root?
3) I need an Integer value that i can read and change from every point of the AST, while generating (so I need acces in every single Template to it). I read about the "session objekt" and thought that this would be maybe the right thing to use, but how can I use it? I couldn't really understand how it works.
I hope I can get some answer here and I'm grateful for any help and new perspectives. Thank you in advance :)
Please sign in to leave a comment.
Hi! Regrading the question 1. Generator output path is specified in Module properties - Common tab. To generate files - invoke Make/Rebuild on your model or module and check the folder specified in Generator output path. To open files you can switch a view in Project tool from Logical view to File System (or Project Files, this one is available starting from 2020.3). Does it help you? Or did you about another thing?
Thanks, that helped a lot! I couldn't find this information anywhere :D
Here is links on docs regarding your questions:
1.Generator output path: https://www.jetbrains.com/help/mps/2021.1/getting-the-dependencies-right.html#solution.
2.Make facet https://www.jetbrains.com/help/mps/2020.3/howto-integrating-into-the-mps-make-framework.html#buildinganexamplefacet). However it is a rather advanced topic. Also, the Voice menu sample uses it to rename .xml files to .html https://github.com/vaclav/voicemenu
3. Session objects https://www.jetbrains.com/help/mps/2020.3/generator-language.html
Hello,
I had lot's of others tasks at work so i just could answer now.
Thanks for the links, I will look into it more, espeacially for the 1. & 2. question.
Regarding the link for the 3. question: I found that one to, but I'm missing an example to really understand it, because I don't know where to use that code line and how.