Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Books on Xtext(Looking to see if anyone knows of any books focused on xtext development)
Books on Xtext [message #903514] Fri, 24 August 2012 04:59 Go to next message
Duncan Krebs is currently offline Duncan KrebsFriend
Messages: 31
Registered: June 2011
Location: Bay Area / Mexico
Member

Its been hard to find a single source of information. I tried amazon, no luck anyone know of any concrete books that give a good overview of how to use xtext to create DSL's? - Duncan

[Updated on: Fri, 24 August 2012 05:00]

Report message to a moderator

Re: Books on Xtext [message #903633 is a reply to message #903514] Fri, 24 August 2012 15:21 Go to previous messageGo to next message
Frank Tagne is currently offline Frank TagneFriend
Messages: 7
Registered: August 2012
Junior Member
Hi Ducan,

Have you seen this pdf|html online book :
- http://www.eclipse.org/Xtext/documentation/2.3.0/Documentation.pdf



Best regards,

F.
Re: Books on Xtext [message #903636 is a reply to message #903633] Fri, 24 August 2012 15:40 Go to previous messageGo to next message
Peter Radisch is currently offline Peter RadischFriend
Messages: 1
Registered: August 2012
Junior Member
Hi Duncan,
sorry there are no books covering xtext. Only the documentation posted by Frank...
Unfortunately this documentation will not help you to learn xtext, at least it didn't help me because ist is rather incomplete and the explanations are not suitable for a beginner.
I can only give you the hint to search the web for blogposts wher someone explains the xtext concepts on a more user-centered level...
These two blogs helped me alot:

dslmeinte.wordpress.com
christiandietrich.wordpress.com

If such posts are not enough you only have the possibility to ask on the forum or hope for a miraculous increase of the xtext docs ^^

Regards
Peter

[Updated on: Fri, 24 August 2012 15:42]

Report message to a moderator

Re: Books on Xtext [message #903640 is a reply to message #903636] Fri, 24 August 2012 15:54 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
If you are new to the area of languages/parsers/lexers, the ANTLR book
is pretty good in explaining parsing/lexing and various issues - much of
that is applicable to Xtext.

- henrik

On 2012-24-08 17:40, Peter Radisch wrote:
> Hi Duncan,
> sorry there are no books covering xtext. Only the documentation posted
> by Frank...
> Unfortunately this documentation will not help you learning xtext, at
> least it didn't help me because ist is rather incomplete and the
> explanations are not suitable for a beginner.
> I can only give you the hint to search the web for blogposts wher
> someone explains a the xtext concepts on a more usercentered level...
> These two blogs helped me alot:
>
> dslmeinte.wordpress.com
> christiandietrich.wordpress.com
>
> If they are not enough you only have the possibility to ask on the forum
> or hope for a miracolous increase of the xtext docs ^^
>
> Regards
> Peter
>
Re: Books on Xtext [message #903669 is a reply to message #903640] Fri, 24 August 2012 20:03 Go to previous messageGo to next message
Duncan Krebs is currently offline Duncan KrebsFriend
Messages: 31
Registered: June 2011
Location: Bay Area / Mexico
Member

Hey guys, thanks for the replies. EMF is a technology I know well, its just figuring out how to put together a grammer with simple if/then logic and then building a runtime component to execute it. Am I correct that if something like if (x = y) then add 1 to y would be modeled as emf objects like having an "And" model object as well as a "Then" model object in my generated ecore or is it a lot easier than that? Also things like creating functions and pretty much building my own scripting language is what I'm wanting to learn more about. Do you think the books mentioned cover this kind of material? - Duncan
Re: Books on Xtext [message #903671 is a reply to message #903633] Fri, 24 August 2012 20:08 Go to previous messageGo to next message
Duncan Krebs is currently offline Duncan KrebsFriend
Messages: 31
Registered: June 2011
Location: Bay Area / Mexico
Member

Frank Tagne wrote on Fri, 24 August 2012 11:21
Hi Ducan,

Have you seen this pdf|html online book :
- http://www.eclipse.org/Xtext/documentation/2.3.0/Documentation.pdf



Best regards,

F.



Thanks Frank, took a quick look at it today look forward to reading it tonight once I'm done with the work that actually generates income! - Duncan
Re: Books on Xtext [message #903692 is a reply to message #903669] Fri, 24 August 2012 23:16 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-24-08 22:03, Duncan Krebs wrote:
> Hey guys, thanks for the replies. EMF is a technology I know well, its
> just figuring out how to put together a grammer with simple if/then
> logic and then building a runtime component to execute it. Am I correct
> that if something like if (x = y) then add 1 to y would be modeled as
> emf objects like having an "And" model object as well as a "Then" model
> object in my generated ecore or is it a lot easier than that? Also
> things like creating functions and pretty much building my own scripting
> language is what I'm wanting to learn more about. Do you think the books
> mentioned cover this kind of material? - Duncan

The easiest way to get started is to start with a small example. Since
you want to build a scripting language, you probably need expressions.
So start with an expression example - a calculator or something.

Then look at implementations of some more complex languages. Xbase,
Xtend etc. If you want to do something like C, C++, Ruby, or JavaScript
you have a rougher ride ahead as there are some difficult problems to
overcome inherit in parsing those languages. I take that back, some of
them is not so much a ride as a free fall, or in the case of Java
Script, a riot at the asylum ;-)

Then ask for pointers and guidance along the way. The books, although
they are good as introduction very quickly gets complicated, and are
perhaps more useful when you want to learn about something specific.

If you have not done any language design, parsers, etc. read some
introductory chapters to get a feel for the issues.

OTOH, if you need a competent scripting language, there is always Xtend :)

And, you are naturally correct that expressions are modeled using EMF.
An expression such as '1 + 2' (typically) becomes an Add instance with a
left containment reference to an instance of LiteralInt with an int
feature value = 1, and a right containment reference to an instance of
LiteralInt with value = 2.

You can also do this as a BinaryOp instance and have a String op = '+'
feature. It is common to divide them by precedence, So you may have an
abstract BinaryOp, with AdditiveOp, MultiplicativeOp being derived from
BinaryOp. Or indeed be explicit and have a class per binary and unary
operator.

Your choices have effect on flexibility of the model, what is reflected
in the grammar/model itself, and what you need to handle in validation
of the model.

Good advice is to make the grammar as lenient as possible to avoid harsh
"syntax error" and unrecognized parts in what is parsed. The more that
the parser can understand and construct a model for, the more help can
be provided in the editor. So don't go overboard with specifying every
itty bitty detail in the grammar itself. In fact, build it to withstand
typical anticipated user errors. Again a balancing act, as the more
flexible you allow the grammar to be, the less help do you get with the
generated tooling/out-of-the-box features.

oh - welcome to the club - working with Xtext (and languages) is fun
stuff :)

Regards
- henrik
Re: Books on Xtext [message #903905 is a reply to message #903514] Mon, 27 August 2012 08:20 Go to previous message
Tobias Mayer is currently offline Tobias MayerFriend
Messages: 8
Registered: August 2012
Junior Member
Hi Duncan,

I think that the following blog post of Simon Gerlach is very helpfull, too:

xtexterience.wordpress.com/2011/05/17/xtext-based-lua-editor

(Sorry for the incomplete link. The forum doesn't allow to set a link outsite of eclipse.org as long as I have less than 25 messages. Just add a http:// in front of the link.)

He implements the LUA language in the grammar language of xtext.

Best Regards,

Tobias


[Updated on: Mon, 27 August 2012 08:21]

Report message to a moderator

Previous Topic:How to generate a field with a generic type
Next Topic:first-order logic / predicate logic grammar in xtext
Goto Forum:
  


Current Time: Tue Apr 23 14:15:30 GMT 2024

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

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

Back to the top