Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 225214

Summary: Tutorial: Build your own DSL with Tools from the Eclipse Modeling Project
Product: Community Reporter: Peter Friese <peter>
Component: ArticlesAssignee: community.articles-inbox <community.articles-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bernhard.merkle, Ed.Merks, jan, nboldt, richard.gronback, sven.efftinge, wayne.beaton
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
URL: http://www.eclipse.org/articles/article.php?file=Article-BuildYourOwnDSL/index.html
Whiteboard:
Attachments:
Description Flags
Article (built with DocBook) as a zip
none
Updated article
none
mylyn/context/zip
none
Corrected copyright strings.
none
mylyn/context/zip
none
Make article Ganymede ready
none
Additional images
none
mylyn/context/zip none

Description Peter Friese CLA 2008-04-01 17:52:40 EDT
We (Sven Efftinge and I) would like to contribute a tutorial-style article on how to build textual DSLs with tools from the Eclipse Modeling Project.

An old version of the tutorial is available here: http://www.eclipse.org/gmt/oaw/doc/4.2/html/contents/xtext_tutorial.html.

However, we would overhaul the entire article, making sure it is streamlined and up-to-date.

The article will cover the following topics:
- What is a DSL and why would you need one in the first place?
  - What's the difference between external and internal DSLs
  - What is a Grammar?
- Setting up the IDE
- Defining the grammar for your DSL
- Generating a Language Workbench for your DSL
- Creating a Code Generator for your DSL
- Brushing up the Language IDE
Comment 1 Wayne Beaton CLA 2008-04-23 07:58:20 EDT
Ed, can you comment on this proposal?
Comment 2 Ed Merks CLA 2008-04-23 08:28:18 EDT
Sounds cool to me!
Comment 3 Peter Friese CLA 2008-05-08 08:58:05 EDT
Created attachment 99268 [details]
Article (built with DocBook) as a zip

This is the article we proposed. As far as we are concerned, work is finished, so we would be happy to have it reviewed by someone (Ed? Rich?) and get feedback.
Comment 4 Peter Friese CLA 2008-05-08 08:59:28 EDT
Jan helped writing the article. CC'ing.
Comment 5 Richard Gronback CLA 2008-05-08 12:53:14 EDT
(In reply to comment #3)
> This is the article we proposed. As far as we are concerned, work is finished,
> so we would be happy to have it reviewed by someone (Ed? Rich?) and get
> feedback.

I'll try to review it by next week.
Comment 6 Richard Gronback CLA 2008-05-08 14:51:30 EDT
I gave the article a read, and I think it's a nice introduction to Xtext.  Very clear, and nice and short ;)

Just a few comments:

- No provided solution projects?
- No mention of the Textual Modeling Framework (TMF) project, where Xtext lives (or, will live)?  I expect you'll have to update the article when Xtext is from TMF and there is no oAW component in GMT?
- Perhaps use "textual DSL" in the title?
Comment 7 Peter Friese CLA 2008-05-08 15:44:07 EDT
(In reply to comment #6)
> I gave the article a read, and I think it's a nice introduction to Xtext.  Very
> clear, and nice and short ;)
Thanks for your feedback! Indeed we intended the article to be short, so readers could consume it easily. Quite on the contrary to the "From frontend to code" article which is not for the faint of heart :-)

> Just a few comments:
> 
> - No provided solution projects?
Good point. We will provide a solution project. Do you think it is worthwhile to provide the project in its various steps, or would it suffice to provide just the finished project?

> - No mention of the Textual Modeling Framework (TMF) project, where Xtext lives
> (or, will live)?  I expect you'll have to update the article when Xtext is from
> TMF and there is no oAW component in GMT?
Absolutely. The article is geared towards the current Xtext implementation which is a part of oAW. As soon as we have a working version of the TMF flavour of Xtext, we need to (and will) update the article. I'd like to avoid confusing readers by mentioning two different versions of Xtext.

> - Perhaps use "textual DSL" in the title?
Good point.

I will change the article accordingly and upload the updated version.
Comment 8 Peter Friese CLA 2008-05-08 16:28:36 EDT
Created attachment 99372 [details]
Updated article

I updated the article:
1) provide a sample project
2) change the title of the article to include "textual DSL"
Comment 9 Richard Gronback CLA 2008-05-11 21:01:57 EDT
(In reply to comment #7)
> Do you think it is worthwhile
> to provide the project in its various steps, or would it suffice to provide
> just the finished project?

I think the finished project is sufficient.

Comment 10 Peter Friese CLA 2008-05-13 03:29:29 EDT
 (In reply to comment #9)
> I think the finished project is sufficient.
https://bugs.eclipse.org/bugs/attachment.cgi?id=99372 contains the finished project, as suggested by Rich. 

Are there more comments? If not, can we publish the article? 
Comment 11 Wayne Beaton CLA 2008-05-14 16:26:35 EDT
I am starting my editorial pass and plan to put this live in the next day or so. If anybody has a problem with the article, speak up!
Comment 12 Wayne Beaton CLA 2008-05-15 11:33:07 EDT
Article can be viewed online here:

http://www.eclipse.org/articles/article.php?file=Article-BuildYourOwnDSL/index.html

I haven't added it to the database yet, so it's not listed on the /articles page yet.

Please verify that the project information at the top is correct.

The code is now in /articles CVS:

:pserver:anonymous@dev.eclipse.org:/cvsroot/org.eclipse
www/articles/Article-BuildYourOwnDSL

Please submit changes as patches to this project.

I've made some minor changes. FWIW, Eclipse 3.3 is not "aka Europa", but rather is part of the Europa Release train. Note also, that I've changed your build.xml file.

Do you think the article needs to have more explicit instructions for obtaining the prerequisite software? Or is it enough to just point the reader at the oAW update site (assuming that they're aware enough to include the Europa update site in the process)?
Comment 13 Wayne Beaton CLA 2008-05-15 11:34:52 EDT
Created attachment 100478 [details]
mylyn/context/zip
Comment 14 Peter Friese CLA 2008-05-15 13:00:50 EDT
(In reply to comment #12)
> Article can be viewed online here:
> 
> http://www.eclipse.org/articles/article.php?file=Article-BuildYourOwnDSL/index.html

Looks fine to me.

> Please verify that the project information at the top is correct.
+1

> Do you think the article needs to have more explicit instructions for obtaining
> the prerequisite software? Or is it enough to just point the reader at the oAW
> update site (assuming that they're aware enough to include the Europa update
> site in the process)?
Well, I am biased, so the others should have a say.

Comment 15 Jan Koehnlein CLA 2008-05-16 04:05:38 EDT
(In reply to comment #12)

> Please verify that the project information at the top is correct.

+1 

> I've made some minor changes. FWIW, Eclipse 3.3 is not "aka Europa", but rather
> is part of the Europa Release train. Note also, that I've changed your
> build.xml file.

Thanks a lot.

> The code is now in /articles CVS:
> 
> :pserver:anonymous@dev.eclipse.org:/cvsroot/org.eclipse
> www/articles/Article-BuildYourOwnDSL

Sorry, I cannot access this. What's in between "...org.eclipse" and "www/..."?

> Do you think the article needs to have more explicit instructions for obtaining
> the prerequisite software? Or is it enough to just point the reader at the oAW
> update site (assuming that they're aware enough to include the Europa update
> site in the process)?

AFAIK, the Europa update site is only needed if the Eclipse SDK does not contain EMF. Please correct me, if I am wrong. Is there any SDK distribution without EMF? 

Regards
Jan
Comment 16 Wayne Beaton CLA 2008-05-16 18:02:56 EDT
 (In reply to comment #15)
> > :pserver:anonymous@dev.eclipse.org:/cvsroot/org.eclipse
> > www/articles/Article-BuildYourOwnDSL

paste the first line in the CVS Repositories View. Then navigate to the second line HEAD > www > articles > ...
Comment 17 Peter Friese CLA 2008-05-28 05:14:47 EDT
I think we're good to go. 

Wayne, could you add the article to the database, so it appear on the /articles page?
Comment 18 Ed Merks CLA 2008-05-28 06:13:55 EDT
Nick,

It would be good to include a link to this page in the documentation section.  This one too:  http://www.eclipse.org/articles/article.php?file=Article-Integrating-EMF-GMF-Editors/index.html
Comment 19 Wayne Beaton CLA 2008-05-29 10:31:49 EDT
I made a minor change to the abstract.

The article has been posted on /articles, /resources, and on the home page.

Can the authors send me (wayne@eclipse.org) their coordinates so that I can send some appreciation swag? I'll need your shirt size, mailing address, and a contact phone number. If you can provide a single address, that would be best (i.e. we can save some money).
Comment 20 Peter Friese CLA 2008-06-09 07:37:58 EDT
Created attachment 104138 [details]
Corrected copyright strings.

Just a slight update. The copyright strings had to be changed, since "itemis labs Kiel" is not a legal entity.
Comment 21 Peter Friese CLA 2008-06-09 07:38:05 EDT
Created attachment 104139 [details]
mylyn/context/zip
Comment 22 Bernhard Merkle CLA 2008-06-10 01:49:50 EDT
a few improvements for this great article...

please add information _when_ to restart eclipse.
there is already one location (after building the plugins), however in the subsequent course of the article it is a bit unclear when I have to restart.

e.g.:

After "Refining the DSL" (adding function "completeDataType_name") I had to restart. Necessary ?

After "Defining constraints for your model" (adding constraint context Type ERROR) I had to restart. Necessary ?



Comment 23 Peter Friese CLA 2008-07-04 03:29:10 EDT
Wayne, we updated the copyright informtion in the article to match legl requiements (it has to read "itemis AG"). Could you update the article on the website during your next editorial run? 
Thanks!
Comment 24 Wayne Beaton CLA 2008-07-23 12:51:33 EDT
Company name has been changed on author entries and on copyright.

Do you intend to address comment 22? Or can we close this?
Comment 25 Jan Koehnlein CLA 2008-07-24 05:32:56 EDT
Created attachment 108318 [details]
Make article Ganymede ready

- Replaced deployment with start of new Eclipse Workbench which works since 3.4
- Use Ganymede instead of Europa
Comment 26 Wayne Beaton CLA 2008-08-05 22:25:10 EDT
Please be more explicit. 

Should I replace the current version with this one? 

Have all the other recent changes been folded in already?
Comment 27 Jan Koehnlein CLA 2008-08-11 04:24:41 EDT
All changes are provided as patches. It looks like all but the last patch https://bugs.eclipse.org/bugs/attachment.cgi?id=108318 
have been applied. 

Could you apply that patch and update the article? 

Thanks in advance.
Comment 28 Wayne Beaton CLA 2008-08-25 15:58:17 EDT
The new images didn't come across in the patch. Can you attach them separately?
Comment 29 Jan Koehnlein CLA 2008-09-19 03:38:27 EDT
Created attachment 112989 [details]
Additional images

Sorry for the very late reply. Here are the images.
Comment 30 Wayne Beaton CLA 2008-09-22 12:35:30 EDT
Committed in HEAD. Should be live now. Marking as FIXED.
Comment 31 Wayne Beaton CLA 2008-09-22 12:35:42 EDT
Created attachment 113157 [details]
mylyn/context/zip