Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » ENUM DATA TYPE
ENUM DATA TYPE [message #1043230] Wed, 17 April 2013 12:53 Go to next message
junior developer is currently offline junior developerFriend
Messages: 354
Registered: January 2013
Senior Member
Hi All,

I define A enum rule in my grammar this rule is below , EXT is optional but PNG is shows in the ecore by default.I want to dont show PNG(First index).How can I provide shows empty value for EXT.(EXT dont receive First value ) I load Screenshot about ecore property
.....
File returns File:
'File' name=ID (
('location' '=' location=STRING )?
&('date' '=' date=STRING )?
&('ext' '=' ext = EXT )?
) ';'
;
enum EXT :
PNG|TXT |JPG |JAVA | C | BAT |BMP |EXE |COM |DOC |PDF|DOCX|XLS|XLSX
;
.....

Best Regards
Re: ENUM DATA TYPE [message #1043241 is a reply to message #1043230] Wed, 17 April 2013 13:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
http://www.eclipse.org/forums/index.php/t/263086/

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: ENUM DATA TYPE [message #1043276 is a reply to message #1043241] Wed, 17 April 2013 13:53 Go to previous messageGo to next message
junior developer is currently offline junior developerFriend
Messages: 354
Registered: January 2013
Senior Member
Hi Christian,

Thank you for shared.

Best Regards
Re: ENUM DATA TYPE [message #1043846 is a reply to message #1043241] Thu, 18 April 2013 07:27 Go to previous messageGo to next message
Claudio Heeg is currently offline Claudio HeegFriend
Messages: 75
Registered: April 2013
Member
Christian Dietrich wrote on Wed, 17 April 2013 15:09
http://www.eclipse.org/forums/index.php/t/263086/


Regarding this, I was wondering whether this is a specific design choice (for default values, specifically, but lacking documentation) or is just like this because the workaround is that easy?
Maybe someone with deeper insight could enlighten me.

[Updated on: Thu, 18 April 2013 07:28]

Report message to a moderator

Re: ENUM DATA TYPE [message #1043976 is a reply to message #1043846] Thu, 18 April 2013 10:38 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
From the docs

Quote:

When generating the EPackage (src) from your grammar this will be the first literal you define. As a workaround you could introduce a dedicated none-value or order the enums accordingly.



Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:JDT dependencies in Xtext 2.4?
Next Topic:Runtime exceptions thrown from the model inferrer
Goto Forum:
  


Current Time: Tue Apr 23 06:33:52 GMT 2024

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

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

Back to the top