IDEA MPS和Eclipse Xtext的实际用途是什么

发布于 2024-09-11 10:55:05 字数 270 浏览 3 评论 0 原文

这两个框架都处理元模型:

  • XText (Eclipse)
  • < strong>MPS (JetBrain)

你有基于元模型的实际应用示例吗用那些工具进行改造?

Both of those frameworks deal with meta-model:

Do you have example of practical applications based on meta-model transformation with those tools?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

夜光 2024-09-18 10:55:05

我们使用 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.

梦幻的心爱 2024-09-18 10:55:05

它们在存储元模型的文档方面有所不同

关于XTextXText techjava.de/topics/2010/06/extending-xtext-build-participants/" rel="nofollow noreferrer">这篇文章说明了一种用法,当涉及到创建您自己的编程语言和特定领域时语言(DSL)。

一旦你有了一种语言,你想要处理它,这通常意味着将你的模型转换成另一种表示形式。
负责此转换的工具称为生成器,由一堆转换模板(例如 XPand)和一些执行它们的代码组成。在某些情况下,会读入模型并应用转换来生成代码。

此类模型转换的示例

dot3zest,它带有一个 DOT 到 Zest 解释器(现在使用为 DOT 语法生成的 Xtext 开关 API)支持临时 DOT 边缘定义。

alt text


关于 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).

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.

alt text


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

alt text
(source: googlecode.com)

别把无礼当个性 2024-09-18 10:55:05

我认为 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文