[Xtext] Ecore Metamodel Question [message #62540] |
Wed, 22 July 2009 09:02  |
Eclipse User |
|
|
|
Originally posted by: oba.informatik.uni-kiel.de
Hi all,
both of the following grammars yield to the same Ecore Metamodel:
======================================
GRAMMAR 1
======================================
Model :
(elements+=DataType)+
;
DataType:
'datatype' name=ID ';'?
;
======================================
GRAMMAR 2
======================================
Model :
(elements+=DataType)*
;
DataType:
'datatype' name=ID ';'?
;
======================================
But I would expect that in the first one, the lower bound of the
reference "elements" would be set to 1. This is not the case, can some
one tell me, what I am overseeing/misunderstanding?
Thanks a lot!
mN
|
|
|
|
|
Re: [Xtext] Ecore Metamodel Question [message #62683 is a reply to message #62540] |
Wed, 22 July 2009 09:22   |
Eclipse User |
|
|
|
Hi mN,
its intentional. We didn't want to introduce to many constraints in the
metamodel. However, there is an open issue and you may want to comment
it: https://bugs.eclipse.org/bugs/show_bug.cgi?id=266830
If you want strict constraints in your metamodel, you can use a post
processing step. Have a look at the docs to learn about it.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 22.07.2009 15:02 Uhr, schrieb myName:
> Hi all,
>
> both of the following grammars yield to the same Ecore Metamodel:
> ======================================
> GRAMMAR 1
> ======================================
> Model :
> (elements+=DataType)+
> ;
> DataType:
> 'datatype' name=ID ';'?
> ;
> ======================================
> GRAMMAR 2
> ======================================
> Model :
> (elements+=DataType)*
> ;
> DataType:
> 'datatype' name=ID ';'?
> ;
> ======================================
>
> But I would expect that in the first one, the lower bound of the
> reference "elements" would be set to 1. This is not the case, can some
> one tell me, what I am overseeing/misunderstanding?
>
> Thanks a lot!
>
> mN
|
|
|
Re: [Xtext] Ecore Metamodel Question [message #62707 is a reply to message #62683] |
Wed, 22 July 2009 09:27  |
Eclipse User |
|
|
|
Originally posted by: oba.informatik.uni-kiel.de
Sebastian Zarnekow wrote:
> Hi mN,
>
> its intentional. We didn't want to introduce to many constraints in the
> metamodel. However, there is an open issue and you may want to comment
> it: https://bugs.eclipse.org/bugs/show_bug.cgi?id=266830
>
> If you want strict constraints in your metamodel, you can use a post
> processing step. Have a look at the docs to learn about it.
>
> Regards,
> Sebastian
>
oh, I see. Thanks Sebastian.
|
|
|
Powered by
FUDForum. Page generated in 0.03534 seconds