开发者

What is practical use of IDEA MPS and Eclipse Xtext

开发者 https://www.devze.com 2023-01-09 12:01 出处:网络
Both of those frameworks deal with meta-model: XText (Eclipse) MPS (JetBrain) Do you have example of practical applications based on meta-model开发者_开发知识库 transformation with those tools?We

Both of those frameworks deal with meta-model:

  • XText (Eclipse)
  • MPS (JetBrain)

Do you have example of practical applications based on meta-model开发者_开发知识库 transformation with those tools?


We created whole bug tracker using MPS. Code generation is not the goal but mean to get some executable code. The goal is to give a tool to developer that allows creating DSLs with minimum effort.

Cool thing about MPS is that it also provides you with an IDE for your language. And different DSLs you create are compatible, i.e. you can create DSL that extends Java with closures and another DSL that enables external methods, and these extensions will work together.


They are different in term of document storing the metamodel.

Regarding XText, this article illustrates one usage, when it comes to y create your own programming languages and domain-specific languages (DSLs).

Once you have a language, you want to process it and this means usually to transform your model into another representation.
The facility responsible for this transformation is called generator and consists of a bunch of transformation templates (e.G. XPand) and some code executing them. On some event, the model is read in and the transformations are applied to produce code.

Example of such a model transformation:

dot3zest, which comes with a DOT to Zest interpreter (which now uses the Xtext switch API generated for the DOT grammar) is support for ad-hoc DOT edge definitions.

What is practical use of IDEA MPS and Eclipse Xtext


Regarding MPS, you have here a serie of practical examples,
like this code generation to GPL such as Java, C#, C++ or XML:

What is practical use of IDEA MPS and Eclipse Xtext


(source: googlecode.com)


I think the main usage of XText is firstly to create a DSL from the grammer you defined and an eclipse workbench auto-generated for you. Secondly, it can transform the scrpit written in your DSL into java. The built-in expressions from XText2 is a plus. The framework gives you a free IDE to support your writing DSL you created. And the DSL is the ulimate product to provide. It can be used to abstract the rules and logics from the real world. For example, in our project, the product config rule. Only specialist knows them, so they write some in the DSL you create.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号