Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338354 - [Terminal Rules] Warn if terminal rule shadows another terminal rule
Summary: [Terminal Rules] Warn if terminal rule shadows another terminal rule
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 1.0.1   Edit
Hardware: PC Windows XP
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-27 15:20 EST by Olaf Bigalk CLA
Modified: 2011-02-27 15:34 EST (History)
1 user (show)

See Also:


Attachments

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