What's the relationshiop between Xtext and ANTLR?
Asked Answered
J

2

8

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

Joiejoin answered 29/12, 2011 at 18:56 Comment(1)
XText's documentation doesn't tell you?Disorder
A
14

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.

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.

Atheling answered 18/1, 2012 at 19:9 Comment(0)
I
0

ANTLR grammar is generated from Xtext. You may find it in src-gen/org/example/dsl/parser/antlr/internal/InternalDsl.g.

Irreplaceable answered 29/12, 2011 at 23:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.