0

In my current work, I have written code generator using String Template without thinking about Parser ( I am instantiating Template files using direct Java Object). and code generator generator generates nice Java code.

Now, I have started to write Parser. B'coz of some nice editor features of xText, I am thinking to write parser in Xtext.

My question is "Is it possible to use code generator ( written using StringTemplate ) and Parse (written in Xtext) in same project?

4

1 回答 1

2

是的,这是可能的。Xtext 为解析的文件提供了一个类型化的 AST,您可以轻松地将它们传递给您的代码生成器(直接,如果它们满足相同的合同/接口,或者通过将它们转换为预期的结构来间接传递)。Xtext 不会对您希望如何使用解析的信息施加任何限制。

于 2012-06-05T07:55:58.790 回答