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

Bug 338354

Summary: [Terminal Rules] Warn if terminal rule shadows another terminal rule
Product: [Modeling] TMF Reporter: Olaf Bigalk <bib.odo>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P5 CC: sven.efftinge
Version: 1.0.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Olaf Bigalk CLA 2011-02-27 15:20:36 EST
Build Identifier: M20100909-0800

The following grammar generates an editor that can not do code completion:


Rule1: (rules+=Rule2)* ;
Rule2 :	name=ID namespace=NAMESPACE ;
terminal NAMESPACE : ('a'..'z'|'A'..'Z'|'_')* ; 

The reason is that the terminal NAMESPACE is similar to the rule ID this causes the rule ID not matching anymore. The genreated parser matches NAMESPACE befor ID.

It would be nice if the grammar editor issues a warning in such a case.

Reproducible: Always

Steps to Reproduce:
1. Create the following grammar:
Rule1: (rules+=Rule2)* ;
Rule2 :	name=ID namespace=NAMESPACE ;
terminal NAMESPACE : ('a'..'z'|'A'..'Z'|'_')* ; 

2. generate the editor
3. create a modelfile for this grammar
4. try to code complete the empty model file
Comment 1 Sven Efftinge CLA 2011-02-27 15:34:59 EST
I'ld only want to have a warning for this if we can suppress that warning again.