Create in-application

Hello -

Is it possible to use MPS to include an interpreter of your DSL in another application? I'm working on an application that would benefit from having in-application interpretation of a language for the app.

Thoughts?

  • EDIT *

Thinking more about my question, I think I need to provide some more information.

I would like to allow the user of my application to enter code in a DSL for the application. They code they enter would be digested within the application and appropriate action taken. Is that something that's possible with MPS?

Thanks again.
4 comments
Hi, Chris.
Though it's theoretically possible, I think, using MPS is an overkill in this case. If your language doesn't need to be extendable, maybe it would be faster to generate a lexer and a parser using one of the variety instruments for that purpose.
If you choose MPS, you'll need to perform quite a lot of work for setting up the environment needed for the editor (if I understood you right, you want just the editor to be inserted somewhere in your application).

Regards,
Mihail.
0
Another option is to move whole application into MPS platform (it's possible to create reduced platform distribution without language development feature). In this case you can benefit from other features of MPS (IntelliJ) platform.
0
Hmm. Thank you both for your replies, but I dont think I asked the question clearly enough.

Let me see if I can clear it up a bit:

I have an application that would benefit from having it's own - simple - programming language be available to the user. In researching ways to do this, I read up on flex and bison and, being a user of some of the other JetBrains products, I was intrigued by the MPS product.

The language would not need to be extendable by the user. I just need to be able to tokenize and parse the commands they enter in the language I develop. I did not know enough about MPS at the time of my first question - and still dont - which is why I asked here.

Thanks. Hopefully that clarifies things a bit.

Chris
0
MPS generates "projectional editor" for your DSL. This means, the program is stored in some proprietary format (XML) by the tool, loaded and represented as instances of some Java classes (AST) and can be edited "like a text" by MPS-generated projectional editors.

It should be possible to describe your language within an MPS, generate projectional editor for it and then let your customers edit programs written on this programming language, so the tool will interpret it using Java API of MPS (AST representation of the program).
0

Please sign in to leave a comment.