Xtext : indicate when optional attribute not entered

47 Views Asked by At

I'm using the following grammar to read input from CXML file:

the input from CXML is as follow:

<WINDOW id="0" name="BUTTON"  width="2560" height="1024" x="0" y="0"/>
<WINDOW id="1" name="CONSOLE" width="768"  height="1024" />

The rules in grammar are:

terminal INTEGER returns ecore::ELong: '"' ( ( ('-')?('0'..'9')+ ) | ( (('0x')|('0X'))(('0'..'9')|('A'..'F')|('a'..'f'))+ ) ) '"';

WindowConfigXtext:
    '<WINDOW' 'id='windowID=INTEGER 'name='windowName=ID 'width='width=INTEGER 'height='height=INTEGER ('x='x=INTEGER)? ('y='y=INTEGER)?'/>'; 

My problem is that I need to defined the records where x and y where not exists in the cxml file.

It is assigned the value 0 not NULL. is there a way to indicate that?

0

There are 0 best solutions below