Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the relationshiop between Xtext and 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?

like image 957
oddin Avatar asked Dec 29 '11 18:12

oddin


People also ask

Does ANTLR use Ebnf?

A language is specified using a context-free grammar expressed using Extended Backus–Naur Form (EBNF). ANTLR can generate lexers, parsers, tree parsers, and combined lexer-parsers. Parsers can automatically generate parse trees or abstract syntax trees, which can be further processed with tree parsers.

Who created ANTLR?

Guido van Rossum, Inventor of Python Our grammars are clean and concise, and the generated code is efficient and stable. The book is our go-to reference for ANTLR v4 -- engaging writing, clear descriptions and practical examples all in one place.

What is ANTLR used for?

ANTLR (ANother Tool for Language Recognition) is a tool for processing structured text. It does this by giving us access to language processing primitives like lexers, grammars, and parsers as well as the runtime to process text against them. It's often used to build tools and frameworks.

Is ANTLR used in industry?

ANTLR is widely used, with over 1000 registered industrial and academic users in 37 countries. It has been ported to many popular systems such as the PC, Macintosh, and a variety of UNIX platforms; a commercial C++ front-end has been developed as a result of one of our industrial collaborations.


1 Answers

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.

like image 146
Sebastian Zarnekow Avatar answered Sep 22 '22 19:09

Sebastian Zarnekow