Custom validation in xtext [message #1424566] |
Tue, 16 September 2014 05:50 |
|
Hi all,
Part of my grammar looks something like this:
rule1:
"ruleName" name=ID
"{"
"enum1" e1=Enum1
"enum2" e2=Enum2
"}"
;
Enum1:
value=INT "=" name=ID
;
enum Enum2:
TRUE|FALSE
;
Language would look something like:
"ruleName" name1
{
"enum1" 2=enumName1
"enum2" TRUE
}
But one problem is that:
I can define Enum1 as,
"enum1" 2=TRUE or "enum1" 2=FALSE also, which will give me an xtext error automatically as TRUE/FALSE are part of enum.
But I want to put a CUSTOM VALIDATION ERROR here.
When I tried to read Enum1 in the background , it gives me a null value i.e. it gives "2=null".
How to solve this?
Thanks in advance
Arshad
|
|
|
|
Re: Custom validation in xtext [message #1424594 is a reply to message #1424568] |
Tue, 16 September 2014 06:42 |
|
Hi Uli,
Thanks for your reply.
Yes I have made use of this special ID.
But the solution you have proposed follows- prevent it before it is happened.
But what I want is, say that intentionally I have typed it wrong and I want get this data in the validator which is giving me currently null.
Any suggestions for this ?
Thanks ..
Greetings from Bangalore/INDIA
Arshad
[Updated on: Tue, 16 September 2014 06:43] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02836 seconds