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.
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.
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.
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.
发布评论
评论(3)
我们使用 MPS 创建了整个错误跟踪器。代码生成不是目标,而是意味着获得一些可执行代码。目标是为开发人员提供一种工具,允许他们以最少的努力创建 DSL。
MPS 很酷的一点是,它还为您提供了适合您的语言的 IDE。并且您创建的不同 DSL 是兼容的,即您可以创建使用闭包扩展 Java 的 DSL 和另一个支持外部方法的 DSL,并且这些扩展将协同工作。
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.
它们在存储元模型的文档方面有所不同。
关于XText,XText techjava.de/topics/2010/06/extending-xtext-build-participants/" rel="nofollow noreferrer">这篇文章说明了一种用法,当涉及到创建您自己的编程语言和特定领域时语言(DSL)。
此类模型转换的示例:
关于 MPS,您有 这里有一系列实际示例,
像这样代码生成为 GPL,例如 Java、C#、C++ 或XML:
(来源:googlecode.com< /a>)
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).
Example of such a model transformation:
Regarding MPS, you have here a serie of practical examples,
like this code generation to GPL such as Java, C#, C++ or XML:
(source: googlecode.com)
我认为 XText 的主要用途是首先从您定义的语法创建一个 DSL,并为您自动生成一个 eclipse 工作台。其次,它可以将你用 DSL 编写的 scrpit 转换为 java。 XText2 的内置表达式是一个优点。
该框架为您提供了一个免费的 IDE 来支持您创建的编写 DSL。 DSL 是我们提供的最终产品。它可以用来从现实世界中抽象出规则和逻辑。例如,在我们的项目中,产品配置规则。只有专家知道它们,因此他们会在您创建的 DSL 中编写一些内容。
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.