OCL concrete to abstract syntax question



Date view Thread view Subject view Author view Attachment view

From: SainTiss (saintiss@arklinux.org)
Date: Wed 14 Jan 2004 - 17:29:34 GMT


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm not sure if this is the right mailing list for questions about the OCL 2.0 
submission, but if not, please be so kind to point me to the right one...

I'm currently examining the OCL metamodel, and I'm wondering about how the OCL 
concrete syntax maps to the abstract syntax of the metamodel.
For example, how is the set->collect (expr) "stored" in the metamodel? Looking 
at the diagram of the expressions package in the submission doc, I noticed 
that there's no such thing as a "collect expression", but only "IterateExp", 
so I guess collect needs to be "translated" in terms of iterate... That might 
look like this:
set->iterate(e; acc : Bag=Bag{} | acc->including(expr))
(Am I right in thinking there is no need to specify the type of elements in a 
Bag in the Bag's declaration?)
In abstract syntax, there'd be an IterateExp, with "source: set", "body: 
acc->including(expr)" and "result: acc: Bag = Bag{}".

But then I'm stuck. "source" is no problem, but "body" is an OclExpression 
itself, and "result" is a VariableDeclaration. So I guess "including" needs 
to be translated in terms of iterate as well. But I don't have a clue what 
that would look like... It seems to me an atomic operation which "adds" an 
element to a collection is needed here, but I can't find it...

Second problem, "result" is a VariableDeclaration. so "acc" is the varName, 
"Bag" is the type, and "Bag{}" is the initExpression. How is "Bag{}" an 
expression? Is that a CollectionLiteral then?

Many thanks in advance,

Hans Schippers

- -- 
Ark Linux - Linux for the Masses (http://arklinux.org)

Capitalism: 
You don't have any cows. The bank will not lend you money to buy cows, 
because you don't have any cows to put up as collateral.

Representative Democracy:
You have two cows. Your neighbors pick someone to tell you who gets the milk. 

In a world without walls and fences, who needs windows and gates?

Hans Schippers
2LIC INF
UA 2003-2004
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFABXyBXlnUYIbmLOQRAtrQAJwJYrxP95HZH3+m5zl50SuhqqP3dwCeLDzD
q1vP0fevbecRFKOF+bT0EYs=
=9ZRx
-----END PGP SIGNATURE-----

Date view Thread view Subject view Author view Attachment view