Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext Vs. Antlr(In what instances should I choose Xtext over Antlr)
Xtext Vs. Antlr [message #1801263] Wed, 16 January 2019 02:31 Go to next message
P J is currently offline P JFriend
Messages: 64
Registered: October 2018
Member
Hi,

Can you please let me know in which instances is is best to choose Xtext to generate a DSL instead of ANTLR?
I have worked with a project that involves generating a .jar file from Xtext, and I know that ANTLR does not support generating binaries as such.
How do I explain it technically? What are the other advantages of using Xtext over ANTLR?

Regards!
Re: Xtext Vs. Antlr [message #1801275 is a reply to message #1801263] Wed, 16 January 2019 05:59 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
I don't understand

Antlr gives you a parser

Xtext gives you semantic validation, generator, ide


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext Vs. Antlr [message #1801288 is a reply to message #1801263] Wed, 16 January 2019 08:32 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

As Christian said, ANTLR "only" provides a parser for you. Nothing what you can and have to do *with* the parser. Xtext adds a complete sophisticated infrastructure on top of that and *uses* ANTLR for parsing under the hood. There are some cases where you could leverage ANTLR features which Xtext does not reveal, and Xtext uses ANTLR 3.

In general, Xtext is the way to go unless you have some very specific language requirements that you cannot solve with Xtext easily (and with ANTLR neither). Then you should rethink your language's design or decide to go the hard way and implement everything on top on your own (editor support, build infrastructure etc.). You should consider that Xtext is developing since more than 10 years on that.
Re: Xtext Vs. Antlr [message #1801297 is a reply to message #1801288] Wed, 16 January 2019 09:44 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

As well as magic things like an almost free IDE, Xtext also provides powerful EMF integration that is very useful internally and may also enables the grammar to be for other modelling purposes.

Regards

Ed Willink
Re: Xtext Vs. Antlr [message #1801332 is a reply to message #1801297] Thu, 17 January 2019 03:22 Go to previous message
P J is currently offline P JFriend
Messages: 64
Registered: October 2018
Member
Thank You Christian, Karsten, and Ed for the answers; they were very useful to me.

Regards!
Previous Topic:Error in building shadowJar in command prompt
Next Topic:XtextRunner and Parser class issue
Goto Forum:
  


Current Time: Fri Mar 29 13:09:01 GMT 2024

Powered by FUDForum. Page generated in 0.03994 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top