How to create an embedded DSL in MPS

I am new to MPS and have just started looking into some of the screencasts to build a external DSL with mps. I would like to create an embedded DSL i.e. a DSL that is embedded in the user input. User input consists of an XML request in between which I would like to provide the ability to add new DSL tags. For e.g.


In the above example the xml tags <Customer>, <Name> and <Transaction> are the user input tags. While I want to create a DSL that allows the user to specify a table field name inside certain tags using the notation {{field_name}} or {{$another_field}}.
I want to also allow the user to add certain custom DSL tags like in the above example the <forEach> tag that requires at least on child tag.

Are there examples that I can look into that could help me to create such a DSL with MPS?


Comment actions Permalink

Hi Amit,

this is a pretty easy task for MPS. I've hammered together a quick demo of what you described - check it out at

I recommend to go through the Fast Track Tutorial ( to get a feel for what is possible with MPS.



Comment actions Permalink

Thanks for a quick follow up. Highly appreciate your help in creating a quick demo. I will have a look the shared links and follow up with any questions.


Please sign in to leave a comment.