How to migrate existing data into MPS?

Hi everyone,

I am learning MPS and would like to use it in my project.

I want to use MPS to create a IDL to describe protocol msgs. The created IDL would be very like google protobuf, e.g. define msgs, msg fields could be primitive types or existing msgs. Eventually I will generate c++ and python code.

The question I have right now is that, there are some existing XML files, each of them has thousands of lines to define one protocol. How could I import this kind of XML to MPS? Also the vendors keep releasing new version of XML files, I need to figure out a easy way to import it into MPS.

I could write python code to convert XML to the IDL file(plan text) if no way to import XML directly, but how to import plain text IDL file into MPS as a new model?

Thanks.

2 comments
Comment actions Permalink

You would need to write a parser for your XML files inside of MPS which then creates the model from that XML. The importer can then take care of merging this with existing instance of the imported file in MPS etc. 

Alternatively you could write a custom persistence that can load the XML files directly into MPS similar to what the java stubs are doing. 

0
Comment actions Permalink

Hi Kolja,

Thank you so much for your help, your comments mean a lot to me.

Now I could fully dive into the MPS since it really can satisfy all my needs and have much better user experience than other solutions.

0

Please sign in to leave a comment.