Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext grammar repository?
Xtext grammar repository? [message #1036418] Mon, 08 April 2013 10:56 Go to next message
Steve Jones is currently offline Steve Jones
Messages: 95
Registered: July 2009
Member
Hi,

The ANTLR grammar list is a great resource, it immediately conveys the range and complexity of projects that have undertaken with ANTLR. Grammars exist for many mainstream languages.

http://www.antlr3.org/grammar/list.html

As XText has been around for a while now I'd have expected to see an Xtext equivalent but all I can find are trivial examples.

Does a similar list exist for XText or is its scope more limited?

Cheers, Steve
Re: Xtext grammar repository? [message #1036419 is a reply to message #1036418] Mon, 08 April 2013 10:59 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6307
Registered: July 2009
Senior Member
No,

but there is http://www.eclipse.org/Xtext/community.html

~Christian
Re: Xtext grammar repository? [message #1036437 is a reply to message #1036419] Mon, 08 April 2013 11:36 Go to previous messageGo to next message
Steve Jones is currently offline Steve Jones
Messages: 95
Registered: July 2009
Member
Hi Christian,

Thanks for the link.

I did look at a few of the projects in that list. The problem is you have to download each project and then drill in to extract the grammar which is tedious to say the least. The projects are "domain specific" (as you might expect) so it's difficult to quickly assimilate scope and complexity.

Also most of the projects don't build under Juno which is disheartening.

I was hoping to see a grammar for at least one mainstream language.

Cheers, Steve
Re: Xtext grammar repository? [message #1036466 is a reply to message #1036437] Mon, 08 April 2013 12:29 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander Nittka
Messages: 1156
Registered: July 2009
Senior Member
Hi,

what is it you *really* want to know? Do you want to see examples of complex Xtext grammars? Do you want to know, how certain aspects of an actual language you are interested can be solved?

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Xtext grammar repository? [message #1036511 is a reply to message #1036466] Mon, 08 April 2013 13:27 Go to previous messageGo to next message
Steve Jones is currently offline Steve Jones
Messages: 95
Registered: July 2009
Member
Hi Alex,

XText offers a lot and I'd like to use it. I've run through the Arithmetics example, it works. With all the eclipse integration features the decision to use XText looks like a no brainer.

The script-language I have in mind is a domain specific "basic" with minimalistic OO support. A typical project would be < 10,000 lines of script that compiles down to byte-code.

Would this be a doodle for XText?

Would it emit byte-code in milliseconds or tens of seconds?

I've had out-of-memory errors even with the Arithmetics example. I had to set -XX:MaxPermSize=256m. Is XText a memory beast under the hood?

If somebody said "I've implemented a Java source analysis package using XText, it's fast and was easy to implement" then I'd sign up today.

Cheers, Steve



Re: Xtext grammar repository? [message #1037214 is a reply to message #1036511] Tue, 09 April 2013 09:49 Go to previous message
Alexander Nittka is currently offline Alexander Nittka
Messages: 1156
Registered: July 2009
Senior Member
Hi,

there are several concerns that are hard to answer in general. Here are some brief thoughts.

1. Xtext would not transform your files to byte code out of the box. You have to implement that. It sounds like the language already exists, so you might already have a compiler. In this case, you would use Xtext to build a user friendly IDE for the language and you would make your existing compiler a builder participant (i.e. you have a component that is informed if a file is changed and that component would simply call the existing compiler).

2. The costs of creating the IDE for an existing language are hard to estimate. They depend heavily on the complexity of the grammar and the kind of features you expect to work. The more your needs deviate from Xtext's defaults, the more you have to do yourself and it does not hurt to understand the underlying concepts.

3. As to memory. When a model file is parsed, a semantic model is created in memory as well as a internal representation of the file content (offsets and much more). These internal representations are very general. An optimised custom implementation would use less space of course. A further point is the "index". In order to make cross referencing work properly (with all its features like find references, rename refactoring etc), all models found need to be instantiated, linked, indexed etc. This process needs memory.

4. My suggestion would be. Don't start with the full language. Write a prototype for a very restricted sub-language to get a feeling for Xtext at all. Then pick features that would be blockers if they did not work. Try to make them work.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Previous Topic:Get and modify elements marked in outline
Next Topic:XText output language types
Goto Forum:
  


Current Time: Sat Sep 20 12:01:07 GMT 2014

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

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