|
|
|
|
Re: eContainer nulls attribute despite containment [message #1842572 is a reply to message #1842557] |
Thu, 24 June 2021 03:08   |
Eclipse User |
|
|
|
@Ed Willink I added the code to the ImplImpl + ConditionImpl and the asserts did not get called.
I am not too sure, but I don't think the condition gets assigned elsewhere, so child stealing might not be the issue (But the paper explained it very nicely :) ).
@Ed Merks From what I understand: When I have an eClassifiers X with the eStructuralFeatures Y in Ecore with containment=true, than Y will appear in the eContainer of X. Maybe that is complete nonsense, but it is what I understood from the docs.
What I am trying to do is quite simple. I parse objects (AbstractStatements, which are implemented differently), which all have a pre- and postcondition.
Now, on a new Object, I want to 1) check if the pre- and post condition fits to the "parent" pre- and postcondition (and iterate upwards towards the root element).
For that, I compare current.pre with current.econtainer.pre and same with post. This worked, when I had my Condition set as EString. But now, that I am using the newly created Expression for that the condition of the eContainer is always null.
I don't think this is a problem of the Xtext parser, because the current precondition (In Screenshot AbstractStatementImpl) is set and neither empty nor null. But it might be a problem of my ecore model?!
I might as well skip the condition and work with an expression right away as @Eike Stepper suggested, but I had some problems in Xtext while trying that. However, that should not be the root of the problem. (I enforce object creation of a condition in Xtext already)
If You want to look at the whole project, here is the ecore:https://github.com/Babwenbiber/CorC/blob/feature/jdl/de.tu-bs.cs.isf.cbc.model/model/cbcmodel.ecore
And this are the Xtext rules: https://github.com/Babwenbiber/CorC/blob/feature/jdl/de.tu_bs.cs.isf.cbc.textual.tool/src/de/tu_bs/cs/isf/cbc/textual/tool/Dsl.xtext
[Updated on: Thu, 24 June 2021 03:50] by Moderator
|
|
|
|
Re: eContainer nulls attribute despite containment [message #1842583 is a reply to message #1842580] |
Thu, 24 June 2021 07:32  |
Eclipse User |
|
|
|
Hi
My earlier answer suggested ways in which a valid containment can be lost. From your response it seems that no valid containment ever got assigned.
Without a repro it is hard to help. My guess, since you are using Xtext, is that your grammar and/or metamodel inhibit the containment; Xtext does not assign non-containment references but these days it diagnoses this, so perhaps you are using a very old Xtext, perhaps you have an inconsistent build state, perhaps ... Need a repro. Should be easy to debug if we could see the grammar.
Regards
Ed Willink
|
|
|
Powered by
FUDForum. Page generated in 0.03984 seconds