FURCAS-dev / FURCAS

A Eclipse Language Workbench for view-based textual modelling based on EMF
http://www.furcas.org
11 stars 2 forks source link

Semantically-predicated instantiation (#74) #87

Open StephanErb opened 13 years ago

StephanErb commented 13 years ago

1) Attribute vs. Association End: Das duerfte ein klassischer Fall von semantischen Praedikaten sein, wie wir es schon in der Vergangenheit oefters besprochen haben. Daher auch Patrick auf Cc. Fuer Attribute habe ich derzeit folgende Regel:

operatorTemplate AttributeCallExp(operators=dotOp, source='source', disambiguateV3="identifier ~LPAREN") : referredAttribute{as=identifierOrKeyword,

query="OCL:self.source.type.allSupertypes()->append(self.source.type).

            contents->select(a | 

a.oclIsKindOf(Attribute))",

   filter="->select(a|a.name=?)"}
  {{ name=lookIn("OCL:self.referredAttribute.name"),
     type=lookIn("OCL:self.referredAttribute.type") }}
;

Durch die Disambiguation wird das mit ausreichend Lookahead von Operation Calls unterschieden. Syntaktisch ist allerdings nicht zu erkennen, ob es nicht vielleicht doch eher eine Reference oder nur ein AssociationEnd war, das nicht einmal ueber eine Reference exponiert war. Das Ergebnis des Look-Ups muesste also eigentlich entscheiden, welcher Typ instanziiert werden muss (AttributeCallExp oder AssociationEndCallExp). Wie ist heute Patricks Stand an dieser Stelle und bis wann ist damit zu rechnen, dass wir so etwas ausdruecken koennen?

Message Date: 2009-10-15 09:11 Sender: Axel Uhl

We now have the foreach property init but that doesn't cut it for the case described here. We would need to express the feature to be filled together with a primitive template for a token to be matched plus the query plus a when/as combination.