Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326653 - There is a major bug in the tutorial
Summary: There is a major bug in the tutorial
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: M3   Edit
Assignee: Jan Koehnlein CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-30 05:42 EDT by Philip May CLA
Modified: 2017-09-19 17:10 EDT (History)
4 users (show)

See Also:
sebastian.zarnekow: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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