Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [SOLVED] Grammar editor does not handle well imported model with class hierarchies(Class hierarchies in imported models)
icon7.gif  [SOLVED] Grammar editor does not handle well imported model with class hierarchies [message #658365] Tue, 08 March 2011 08:28 Go to next message
Uri Shani is currently offline Uri ShaniFriend
Messages: 18
Registered: July 2009
Junior Member
I have a model where B and C extend A. A defines a name property which B and C inherit.
In the grammar, I import this model and define these rules:

A: B | C
B: 'B' name=STRING;
C: 'C' name=STRING;

Both rules for B and C are marked in error since 'name' is not defined for them in the imported model (although it is defined in their supertype).

In the manual, it says that if using generated models, these rules will generate a model that is exactly as my imported model.

So, is this a bug?

Thanks,
- Uri
Follow up:
I tried the above again and it works. I mean, I generated the model and than imported it. Need to see what is wrong with my REAL case that this did not work.

Follow up 2:
Turns out that once property type was changed to EString instead of
EChar - issues were resolved in the editor.

[Updated on: Tue, 08 March 2011 10:24]

Report message to a moderator

Re: Grammar editor does not handle well imported model with class hierarchies [message #658388 is a reply to message #658365] Tue, 08 March 2011 09:27 Go to previous message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
I guess there's something wrong with the import section of your grammar.
Could you post the complete grammar?

Is 'name' an EAttribute of A with type EString with upperBound=1?

Am 08.03.11 09:28, schrieb Uri Shani:
> I have a model where B and C extend A. A defines a name property which B
> and C inherit.
> In the grammar, I import this model and define these rules:
>
> A: B | C
> B: 'B' name=STRING;
> C: 'C' name=STRING;
>
> Both rules for B and C are marked in error since 'name' is not defined
> for them in the imported model (although it is defined in their supertype).
>
> In the manual, it says that if using generated models, these rules will
> generate a model that is exactly as my imported model.
>
> So, is this a bug?
>
> Thanks,
> - Uri


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Previous Topic:Integration of Xtext with Graphiti
Next Topic:problem with cross references to other model files in LazyLinkingResource
Goto Forum:
  


Current Time: Sat Apr 27 04:15:04 GMT 2024

Powered by FUDForum. Page generated in 0.02821 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top