[Acceleo3] using ecore in query [message #666374] |
Wed, 20 April 2011 04:24  |
Eclipse User |
|
|
|
Hi,
I created a meta model and am experimenting with code generation.
In this, I have a PG_Return meta class that either might occur inside a PG_Calc or a PG_GetCalc object. The generated code depends on the context PG_Return is used in. Therefore, I created a query that checks whether the context of the PG_Return instance is within PG_GetCalc.
[query public inGetCalcContext(s: PG_Statement) : Boolean =
let container: EObject = s.eContainer()
in
if (container <> null) and (container.oclIsTypeOf(PG_GetCalc))
then
true
else
if (container = null)
then
false
else
inGetCalcContext(container)
endif
endif
/]
However, Acceleo complains that it doesn't know EObject? Is it not possible to use ecore concepts like above?
Greetings,
Wilbert
|
|
|
|
Re: [Acceleo3] using ecore in query [message #666673 is a reply to message #666667] |
Thu, 21 April 2011 10:08  |
Eclipse User |
|
|
|
Hi Stephane ,
Again your answer was right to the spot for which I thank you.
However, in the documentation I stumbled across the 'Acceleo non standard operations reference'. The thing I wanted to achieve can also be solved using the 'ancestors' operation. Let's use as much as possible the provided operations.
Thanks,
Wilbert.
|
|
|
Powered by
FUDForum. Page generated in 0.03962 seconds