problem with using enums as optional elements [message #760200] |
Thu, 01 December 2011 10:26  |
Eclipse User |
|
|
|
Hi,
I have a problem with the use of enums and processing the grammar. I'm not using XTend, I'm using java directly.
My dsl is like this
...
ItemVisualization:
'item' id=ID
'type' dbType=DBTYPE
('caption' caption=STRING)?
('align' align=ALIGNTYPE)?
...
;
enum ALIGNTYPE :
H2 = 'h2' |
B2 = 'b2' |
K1 = 'k1'
...
While processing the DSL I can use the question ...getCaption()!=null ... to test whether the optional element caption is used or not.
In the case of align this did'nt work, getAlign() is not null and getAlign().getLiteral() deliver the first value of the enum ('h2').
How can I check wether th optional align was used or not?
Thanks
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04299 seconds