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

Bug 326653

Summary: There is a major bug in the tutorial
Product: [Modeling] TMF Reporter: Philip May <eniak.info>
Component: XtextAssignee: Jan Koehnlein <jan>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eniak.info, jan, sebastian.zarnekow, tmf.xtext-inbox
Version: unspecifiedFlags: sebastian.zarnekow: indigo+
Target Milestone: M3   
Hardware: All   
OS: All   
Whiteboard:

Description Philip May CLA 2010-09-30 05:42:36 EDT
Build Identifier: M20100909-0800

The first grammar in the tutorial has a bug:
http://www.eclipse.org/Xtext/documentation/1_0_0/xtext.html

Fere is the complete grammar (with the bug):
grammar org.eclipse.xtext.example.Domainmodel 
  with org.eclipse.xtext.common.Terminals
  
generate domainmodel "http://www.eclipse.org/xtext/example/Domainmodel"  

DomainModel :
  (elements+=Entity)*;
  
Type:
  DataType | Entity;
  
DataType:
  'datatype' name=ID;
 
Entity:
  'entity' name=ID ('extends' superType=[Entity])? '{'
    (features+=Feature)*
  '}';
 
Feature:
  name=ID ':' type=TypeRef;
  
TypeRef:
  referenced=[Type] (multi?='*')?;

This whould be axchanged:

DomainModel :
  (elements+=Entity)*;

with this:

DomainModel:
  (elements+=AbstractElement)*;

AbstractElement :
  Entity | DataType;

This bug should be fixed soon cause it's very frustrating for new users who
want to try out Xtext.

Reproducible: Always

Steps to Reproduce:
Just follow the tutorial and you will see...
Comment 1 Philip May CLA 2010-10-07 04:05:47 EDT
There is a more simple solution.
Just replace this:

DomainModel :
  (elements+=Entity)*;

with this:

DomainModel:
  (elements+=Type)*;
Comment 2 Jan Koehnlein CLA 2010-10-07 10:20:04 EDT
Fixed in HEAD
Comment 3 Karsten Thoms CLA 2017-09-19 16:59:27 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 17:10:57 EDT
Closing all bugs that were set to RESOLVED before Neon.0