I am thinking to move to Jetbrains MPS, so i can edit my files with custom defined language more easily.
I have started to create the files a while ago and there are a lot of files already. Is there any way to convert those files automatically to my language in MPS, than just copy pasting parts of code?
Sure: there are several ways. The first one is to define a custom persistence mechanism for MPS. It means that you will be able to open, edit and save the files in MPS keeping the current format. However if you do this you will lose some of the flexibility of MPS because when you will extend the language or combine your language with others you will have to revise the persistence mechanism. I suggest instead to simply parse your files, build an Abstract Syntax Tree and create corresponding nodes in MPS. Here there is a tutorial showing how to use an ANTLR parser to import files in MPS: http://tomassetti.me/antlr-and-jetbrains-mps-parsing-files-and-display-the-ast-usign-the-tree-notation/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With