|Xtext Grammar [message #1015528]
||Fri, 01 March 2013 06:12
| rohit ahuja
Registered: February 2013
I am new to Xtext and writing a DSL.
I have something like
'Case:' CaseName = ID
Now the variable CaseName can contain simple only Integer Values i.e any combination of 0-9, or only Alphabets i.e. any combination of the A-Z or a-z, or a mixed case.
If i keep it as above, xtext doesn't allow me to have a single int value,
say 'Case: 0'
I tried with the below method
'Case:' CaseName = ID|INT -- but it doesn't work for obvious reasons.
If i try to create another terminal like (0-9|a-z|A-Z)*, it starts interfering with other rules in the grammar.
I think there must be some other way, can anyone help me with this?
In general, can any variable be assigned to two types?
Powered by FUDForum
. Page generated in 0.01761 seconds