Hi all,
Can you please point me to an apropriate library or documentation to traverse an OCL abstract tree and return the typedElements tied to each node.
Cheers.
The pivot OCL AS supports Visitors so you can just visit each node in
turn to determine whatever you want. (The classic OCL AS also supports
Visitors but only on the OCL nodes; not on the Ecore/UML metamodel nodes).
I'm not sure what you mean by TypedElements tied to each node. Some of
the nodes are TypedElement, so maybe you just want to do a generic tree
contents traversal with an instanceof.
Regards
Ed Willink
On 06/09/2013 08:52, Amine BEN wrote:
> Hi all,
> Can you please point me to an apropriate library or documentation to
> traverse an OCL abstract tree and return the typedElements tied to
> each node.
> Cheers.
>
I want to mark all the attributes that are involved in an OCL constraint (attributes' name are fine for me ). For instance, in the following invariant the involved attributes are isMarried : EBoolean and age : EInt
Context Person
inv canMarry : self.isMarried implies self.age >18
So do a tree search for all PropertyCallExp and gather the
referredProperty values.
Regards
Ed Willink
On 06/09/2013 11:39, Amine BEN wrote:
> I want to mark all the attributes that are involved in an OCL
> constraint (attributes' name are fine for me ). For instance, in the
> following invariant the involved attributes are isMarried : EBoolean
> and age : EInt Context Person
> inv canMarry : self.isMarried implies self.age >18
>
> N.B : I am working with the classical OCL