Hey, i tried around with plaintextgen and saw this article <a href='https://blog.jetbrains.com/mps/2017/06/plugin-spotlight-generate-python-or-ruby-with-mps-plaintextgen/#remark42'>on the blog</a> and...

This is an auto-generated question from the MPS Slack community: Hey, i tried around with plaintextgen and saw this article on the blog and thought i could try that. i have a root concept, which contains content. I added a interface for the content and implemented that interface to every concept that i want to be the content of the root concept. The root concept is called Contract as you can see in the first screenshot, which basically contains 0..n contents. the contents can be f.e. a participant, i have concepts for every 'content' being participant, action etc. I added a plaintext gen for the Contract concept where i add the file name based on the name of the contract from the concept etc. that worked fine, but now i want to add the content to my file that i generate. when i type node.contents for the content of the contract concept there is not much i can do since the contents are coming from an interface where i havent even implemented INamedConcept since i've done so for every concept that implements the interface. I then tried the method from the blogpost, where i create a template called reduce_NAME as seen on the blogpost for reduce_Entity. However when i try that for my participant concept i get the message 'attributed cell not found'. what am i missing and/or doing wrong here and how can i simply generate text for every concept i have and add that to the generated text from my root node?
0
6 comments
In your root template for the contract you loop over the node.contents with a loop-macro and a copy_src-macro: $LOOP$$COPY_SRC$ In the reduce_NAME templates you put ypour plain text in the template fragment and add property-macro's and loops if any properties and children/references are available for that implemented subconcept. Have you made reduction-rules for the sub-concepts in your main mapping?
0
Hey, i used the COPY_SCRL over node.contents and it should do the same as the stuff that you described? Also i have described the root template in my main mapping + the reduction rule for the participant concept but i cant edit the stuff inside of the template fragment for what ever reason. it's just saying 'attributed cell not found'
0
Although I couldn't replicate exactly the same error message ('attributed cell not found'), it might be due to this: when I make a Template Fragment with PlainTextGen I FIRST make a PlainTextGen cell (for instance with 'VerticalLines') and THEN surround that with a Template Fragment.
0
I used to do it by choosing TextGenText from the completion-menu, also before surrounding it with a Template Fragment, but then there was also a Filename-field generated (which is not used. I now use VerticalLines and paste my plain text in that.
0
Thank you, i just figured it out earlier that exactly this was the problem.
0
This is auto-generated question from the MPS Community Slack Workspace. If you want to comment on the question, do it from the Slack workspace
0

Post is closed for comments.