Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Validation of non-null enum rule
Validation of non-null enum rule [message #1706866] Mon, 31 August 2015 10:19 Go to next message
Eclipse UserFriend
Hi,
I have a Grammar which includes an enum zero-based value, which i want to validate for non-null.

Lets say my grammar has rules like:

Parent:
'parent' name=ID '{'
'period-age' period=Period
'age' age=INT
'}'

enum Period:
FIRST='1Part' | SECOND='2Part' | LAST='3Part';

I Want to validate if i don't receive the enum-value (Period), which means it is null.
How can i do it?

Note: This is important because I also have rules which the enum-based value is optional (and will then pass the parser but i will want to check them in the validation step)
Re: Validation of non-null enum rule [message #1706875 is a reply to message #1706866] Mon, 31 August 2015 10:41 Go to previous message
Eclipse UserFriend
by default this will never happen, since the enum value will always be set (to the first value)
maybe you can play around with unsettable (eIsSet)
Previous Topic:Xtext for Extended C language with Graphiti Editor
Next Topic:How can I get the referencing objects for a certain object
Goto Forum:
  


Current Time: Thu Jul 03 15:19:26 EDT 2025

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

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

Back to the top