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

Bug 339023

Summary: simple grammar produces an parser that is inable to resolve references
Product: [Modeling] TMF Reporter: Olaf Bigalk <bib.odo>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: clay
Version: 1.0.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Olaf Bigalk CLA 2011-03-05 19:39:44 EST
Build Identifier: 

The following grammar produces a parser that is not able to resolve references to objects of C

A: (a+=B)+
    "cr" c=[C];	
B: "b" name=ID "(" (b+=C)* ")";
C: name=ID;


Reproducible: Always

Steps to Reproduce:
1. Create an Xtext project.
2. Enter the above grammar
3. Generate the model and the editor
4. Open the editor and enter some objects "b b1 (c1 c2 c3) b b2 (c4 c5) cr  "
5. Try to enter a reference to C
Comment 1 Michael Clay CLA 2011-03-06 04:42:02 EST
the following should do the 'trick'  (from http://www.eclipse.org/Xtext/documentation/1_0_1/xtext.html 'Adding a Namespace Concept') pls. reopen if i have missed the point.


A:
	(a+=B)+
	"cr" c=[C|QualifiedName];

B:
	"b" name=ID "(" (b+=C)* ")";

C:
	name=ID;
	

QualifiedName:
	ID ('.' ID)*;