此演示中使用什么语言?
我刚刚阅读了 eclipse xtext 的文档,发现它使用的语言与java类似,但是带有一个一些差异:
http://www.eclipse.org/Xtext/documentation/2_0_0/040-first-code-generator.php
例如,它有这样一个代码片段:
def compile(Entity e) '''
package «e.eContainer.fullyQualifiedName»;
public class «e.name» {
}
'''
What's the language?
I just read the document of eclipse xtext, and found the language it uses is similar to java, but with a few differences:
http://www.eclipse.org/Xtext/documentation/2_0_0/040-first-code-generator.php
For example, it has such a code snippet:
def compile(Entity e) '''
package «e.eContainer.fullyQualifiedName»;
public class «e.name» {
}
'''
What's the language?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看起来像 Scala + 一些带有所谓合并代码的模板。
http://www.scala-lang.org/
Looks like Scala + some template with so called merge codes.
http://www.scala-lang.org/
您所指的语言称为Xtend2,是一种类似Java 的编程语言,专为代码生成而定制。它具有一些非常有用的概念,例如闭包、动态调度、类型推断以及您已经见过的丰富字符串。 Xtend2 代码可以由 JVM 执行,因为每次点击保存时它都会被转换为人类可读的 Java 代码。 Sven Efftinge 在博客中介绍了 Xtend2 的核心思想一段时间前。 Xtext 网站上有一个教程(您在问题中提到的页面)也是如此。
此外,Xtend2 分享了 Xbase 的大部分想法,Xbase 是编程语言的可重用基础使用 Xtext 构建。
The language you are referring to is called Xtend2 and is a Java-like programming language that has been tailored for code generation. It features some very useful concepts such as closures, dynamic dispatch, type inference and the rich strings you've already seen. Xtend2 code can be executed by the JVM since it's been translated to human-readable Java code each time you hit save. Sven Efftinge blogged about Xtend2's core ideas a while ago. There's a tutorial on the Xtext website (the page you mentioned in your question), too.
Also, Xtend2 shares most ideas of Xbase, a reusable foundation for programming languages built with Xtext.
它似乎是某种代码生成符号(当然可以通过阅读页面标题来推测)。另一个“duhh!”:他们似乎将整个包称为 Xtext。然而,我没有找到任何东西来命名他们用于语法、语义等的 2-3 种不同语言。
It appears to be some sort of a notation for code generation (which of course one could surmise by reading the page title). And another "duhh!": They appear to call the overall package Xtext. However, I've not found anything that names the 2-3 different languages they use for grammar, semantics, etc.