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

Bug 337860

Summary: Errors in generated grammar for UIElements ecore model
Product: [Modeling] TMF Reporter: Jesse <jessev>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: karsten.thoms, sebastian.zarnekow
Version: 2.0.0Keywords: triaged
Target Milestone: ---Flags: sebastian.zarnekow: indigo+
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
The UIElements ecore model
none
Sample Project none

Description Jesse CLA 2011-02-22 11:49:33 EST
*My mistake if these have already been reported*

1. Some of the import statements at the top of the .xtext file are duplicates, and are missing the required "#//____" portions. 

eg. 

generated: 
import "platform:/resource/org.eclipse.e4.ui.model.workbench/model/UIElements.ecore" as commands

fix:
import "platform:/resource/org.eclipse.e4.ui.model.workbench/model/UIElements.ecore#//commands" as commands

2.

The type UIElements was not auto-generated in the grammar, but the some of the "children" attributes for types (specified by the auto-generated grammar) require UIElements. However, we should probably use types that are a little further down the tree. ie. Menu_Impl's children for the auto-generated grammar says it requires UIElements, but should probably be using MenuElements.

eg. 

generated:
('children' '{' children+=UIElement ( "," children+=UIElement)* '}' )?

possible fix:
('children' '{' children+=MenuElement ( children+=MenuElement)* '}')? //MenuElement

*though this won't actually work until you've included MenuElement in the grammar... and takes me to the next point*

3. Entire hierarchy of UIElements doesn't get generated. Some stuff needed to be added/changed in order to get most of the UIElements hierarchy.

Again... I noticed the same stuff in 1.01, so I apologize if this has already been reported. 

Thanks!

- Jesse
Comment 1 Sebastian Zarnekow CLA 2011-02-22 12:03:27 EST
Hi Jesse,

thanks for the bugreport.
Could you please attach a (minimal ;-) ecore model that allows to reproduce these issues.

Thanks in advance,
Sebastian
Comment 2 Jesse CLA 2011-02-22 13:31:03 EST
Created attachment 189524 [details]
The UIElements ecore model
Comment 3 Jesse CLA 2011-02-22 13:32:20 EST
(In reply to comment #1)
> Hi Jesse,
> 
> thanks for the bugreport.
> Could you please attach a (minimal ;-) ecore model that allows to reproduce
> these issues.
> 
> Thanks in advance,
> Sebastian

Ah, yes. I probably should have noted that I was using the latest ecore model found in the following cvs repo:

 :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse 

go to:

 e4 -> org.eclipse.e4.ui -> bundles -> org.eclipse.e4.ui.model.workbench -> model -> UIElements.ecore

Anyway, here's *that* ecore model attached.

- Jesse
Comment 4 Karsten Thoms CLA 2016-09-20 08:14:43 EDT
Created attachment 264281 [details]
Sample Project

Contains org.eclipse.e4.ui.model.workbench and an Xtext project derived from UIElements.ecore