Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Syntax Highlight of disconnected rules
Syntax Highlight of disconnected rules [message #988452] Thu, 29 November 2012 22:41 Go to next message
Barrie Treloar is currently offline Barrie TreloarFriend
Messages: 55
Registered: July 2009
Member
I was wondering why the editor is showing some of my rules in grey.

And I solved that problem when my parser couldn't parse that rule when I was sure I wrote it correctly.

I think the grey is indicating that the rule is not connected to another rule so wont be called. As soon as I included this rule in another rule it turned black.

Is being "grey" a standard eclipse thing?
I was kind of hoping for a warning marker, or perhaps the hover text could indicate a warning.

Should I file an enhancement request?
Re: Syntax Highlight of disconnected rules [message #988478 is a reply to message #988452] Fri, 30 November 2012 07:11 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

the "grey" syntax highlighting is specific to the Xtext grammar editor. It indeed indicates that the rule is not "reachable" from the root rule. My guess is that an enhancement request will be ignored (wontfix), as you may introduce such rules for the purpose of influencing the meta model inference.

Supertype: Type1|Type2;

is an example. You may want Type1 and Type2 to have a common supertype without actually having a place in your language where you want those to types to be allowed in the same location.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Syntax Highlight of disconnected rules [message #990743 is a reply to message #988478] Fri, 14 December 2012 03:21 Go to previous messageGo to next message
Barrie Treloar is currently offline Barrie TreloarFriend
Messages: 55
Registered: July 2009
Member
It would be nice to document what the grey text means.
And perhaps also include in the hover text a "reminder" that indicates the rule is unreachable would be useful.

I had to guess at the meaning, and the colors are clearly trying to tell me something, its just there is no way to know that information.
Re: Syntax Highlight of disconnected rules [message #1760306 is a reply to message #990743] Tue, 25 April 2017 16:25 Go to previous message
joe fridik is currently offline joe fridikFriend
Messages: 15
Registered: April 2017
Junior Member
thanks for your response now
I'll never forget to do the assignment Smile
Previous Topic:EObject 'nature' of domain classes no longer available?
Next Topic:Alternative Rules
Goto Forum:
  


Current Time: Sun Nov 10 08:40:32 GMT 2024

Powered by FUDForum. Page generated in 0.02556 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top