|alternate between assignment and terminal [message #948796]
||Thu, 18 October 2012 07:36
| Dominik Hirt
Registered: October 2012
I want to define as part of a grammar, the possibility to define the length of a given parameter with these xtext parser rule:|
((min=INT)? ('..')? max=INT) | '#'
Such a rule is syntactically correct and makes the following terms possible:
I want to express, that for the case '#' the length isn't defined and set min=max=-1. How can I achieve that ? This is not only important for the unit test which can't check min and max values because they are not defined:
val de = model.segments.head.datenElemente.head as DE
assertEquals("0", de.length.min) <-- NullPointerException
How can I mix the assignments of min and max and this special case with terminal '#' ?
Powered by FUDForum
. Page generated in 0.01607 seconds