3 Question about the Generator aspect

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 :)


Comment actions Permalink

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?

Comment actions Permalink

Thanks, that helped a lot! I couldn't find this information anywhere :D

Comment actions Permalink


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. 


Please sign in to leave a comment.