Hello, i'm trying to use the plaintext generator and i simply want to know how to go on from here. I'm still at the beginning and i just want to know how to move on from here. So my root node is the concept Contract like this

it has contents as you can see. the IContractContent concept is a interface simply like this

I implement this interface to all concepts that i want to be "contents".
So a simple Contract would look something like this
the LockedFunds Contract is of the concept contract and the contents for this example is a concept participant for the User.

I want to know how i could use these contents in the plaintextgen. i implemented something like this already:

It generates a .sol file where i put a property macro for being the name of the contract and in the file itself i added stuff that looks like solidity code. I now want to know how to go on from here. How should i implement the stuff for the contents being different concepts? When i try to use node.contents i don't have much to work with i can't even get the names from them since in the interface i have not added INamedConcept or anything. So should i create a plaintextgen for every concept i have or is there another way to go on about it?


This is not specific to plaintextgen, the MPS generator in general works by copying nodes over from an input model into an output model. At the same time, it looks for an applicable reduction rule, and if it finds one, it uses the rule to transform ("reduce") the input node before copying it over. If it doesn't find any rule, it copies the node unchanged.

So the basic approach is to write a template for the parent node, and put $COPY_SRC$ or $COPY_SRCL$ macros where you want the child nodes to be placed. Then you write a reduction rule for each concrete child concept.

The <attributed cell not found> in your last screenshot probably means that you have applied the <TF TF> macro over some invalid node. Try deleting the content node first, put some valid content in here (e.g. Line or another appropriate concept from plaintextgen), then create the template fragment around it.


Please sign in to leave a comment.