开发者

What's the language used in this demo?

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开发者_StackOverflow中文版 class «e.name» {
    }
'''

What's the language?


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.


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.


Looks like Scala + some template with so called merge codes.

http://www.scala-lang.org/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜