Xtext 和 ANTLR 有什么关系? [英] What's the relationshiop between Xtext and ANTLR?

查看:31
本文介绍了Xtext 和 ANTLR 有什么关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说 Xtext 最终使用的是 ANTLR,但是它们的语法规范文件的格式有些不同.那么两者之间是什么关系呢?

I heard that Xtext ultimately uses ANTLR but their grammar specification files have somewhat different formats. So what's the relationship between the two?

推荐答案

Xtext 依赖 Antlr 解析器生成器来解析输入文件.除此之外,该框架还提供了许多附加值,例如强类型 AST、链接和静态分析的抽象以及 Eclipse 的 IDE 集成.

Xtext relies on the Antlr parser generator for the parsing of input files. On top of that the framework provides lot's of added value such as strongly typed ASTs, abstractions for linking and static analysis as well as IDE integration for Eclipse.

为此,Xtext 生成了两个 Antlr 语法.一个用于生成实际 AST 的生产解析,第二个语法用于使用事件来计算 Eclipse 编辑器的内容建议.

For that purpose, Xtext generates two Antlr grammars. One for the production parsing where the actual AST is produced, and a second grammar that is used to consume events to compute the content proposals for the Eclipse editor.

这篇关于Xtext 和 ANTLR 有什么关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆