|Re: eContainer nulls attribute despite containment [message #1842572 is a reply to message #1842557]
||Thu, 24 June 2021 07:08
| Frä Fröhlich
Registered: June 2021
@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 07:50]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.03702 seconds