Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [qvtd-dev] QVTc MappingCall support

Hi

Try selecting clipboard as the patch source. That's how I generated it.

If you have changed files, commit them to a new branch just in case, then revertt to your old patch.

If you know the changes are unwanted just use the GIT Staging View to see them and replace the changed files by HEAD, avoiding selecting new files which you may want to delete.

If you have an auto-builder as EMF has you need to disable Build Automatically before replacing with HEAD otherwise you just get new changed files as fast as you replace them.

    Regards

        Ed

On 13/02/2013 15:34, Horacio Hoyos Rodriguez wrote:
Hi Ed,

I tried to make a patch file from the text in the message but when I try
to apply it Eclipse complains about it not being a patch file.

For some reason the QVT editor generated files where changed on my machine

and when I tried to merge with M5 the editors stopped working. I think it
is l solved now.

Regards,

Horacio Hoyos Rodríguez
EngD Student
University of York


-----Original Message-----
From: qvtd-dev-bounces@xxxxxxxxxxx [mailto:qvtd-dev-bounces@xxxxxxxxxxx]
On Behalf Of Ed Willink
Sent: 13 February 2013 15:21
To: QVTD developers mailing list
Subject: [qvtd-dev] QVTc MappingCall support

Ho Horacio

I've just pushed the QVTc editor support for MappingCall's to master.
The ICMT paper examples are now JUnit tests (there was a missing "|" in
one of the guard patterns.)

A built distribution is available at
https://hudson.eclipse.org/hudson/job/buckminster-mmt-qvtd-kepler/lastSucc

essfulBuild/artifact/.
An N-build will be on the download page tomorrow.

With two kinds of nested mapping Mapping now extends NestedMapping, to
allow an alternate MappingCall. Mapping.local is therefore a
NestedMapping.

The patch below fixes up QVTcoreEvaluationVisitorImpl, leaving you with
the job of implementing visitMappingCall etc.

---

You same to have made very heavy weather of the M5 merge. If there's a
problem it needs sorting out, since it should be easy.

      Regards

          Ed

### Eclipse Workspace Patch 1.0
#P uk.ac.york.qvtd.pivot.qvtcore
diff --git
src/org/eclipse/qvtd/pivot/qvtcore/evaluation/QVTcoreEvaluationVisitorImpl

.java
src/org/eclipse/qvtd/pivot/qvtcore/evaluation/QVTcoreEvaluationVisitorImpl

.java
index ebf276a..e167afb 100644
---
src/org/eclipse/qvtd/pivot/qvtcore/evaluation/QVTcoreEvaluationVisitorImpl

.java
+++
src/org/eclipse/qvtd/pivot/qvtcore/evaluation/QVTcoreEvaluationVisitorImpl

.java
@@ -46,6 +46,9 @@
   import org.eclipse.qvtd.pivot.qvtcore.EnforcementOperation;
   import org.eclipse.qvtd.pivot.qvtcore.GuardPattern;
   import org.eclipse.qvtd.pivot.qvtcore.Mapping;
+import org.eclipse.qvtd.pivot.qvtcore.MappingCall;
+import org.eclipse.qvtd.pivot.qvtcore.MappingCallBinding;
+import org.eclipse.qvtd.pivot.qvtcore.NestedMapping;
   import org.eclipse.qvtd.pivot.qvtcore.PropertyAssignment;
   import org.eclipse.qvtd.pivot.qvtcore.RealizedVariable;
   import org.eclipse.qvtd.pivot.qvtcore.VariableAssignment;
@@ -318,14 +321,14 @@
               // The transformation only has one mapping, the root
mapping. Call
               // nested mappings in correct order, i.e. call all LtoM
first then
               // all MtoR
-            for (Mapping m : ((Mapping) rule).getLocal()) {
+            for (NestedMapping m : ((Mapping) rule).getLocal()) {
                   if (isLtoMMapping(m)) {
                       m.accept(this);
                   }
               }
               // Remove all bindings to evaluate MtoR
               getEvaluationEnvironment().clear();
-            for (Mapping m : ((Mapping) rule).getLocal()) {
+            for (NestedMapping m : ((Mapping) rule).getLocal()) {
                   if (isMtoRMapping(m)) {
                       m.accept(this);
                   }
@@ -405,6 +408,22 @@
           }
           return true;
       }
+
+    @Override
+    @Nullable
+    public Object visitMappingCall(@NonNull MappingCall object) {
+        // TODO Add visit function or decide if it should never be
implemented
+        throw new UnsupportedOperationException(
+                "Visit method not implemented yet");
+    }
+
+    @Override
+    @Nullable
+    public Object visitMappingCallBinding(@NonNull MappingCallBinding
object) {
+        // TODO Add visit function or decide if it should never be
implemented
+        throw new UnsupportedOperationException(
+                "Visit method not implemented yet");
+    }

       /**
        * Visit left to middle mapping. Mapping's domains define the loop
variables @@ -433,7 +452,7 @@
                               mapping.getBottomPattern().accept(this);
                           //}
                           // Nested mappings
-                        for (Mapping localMapping : mapping.getLocal()) {
+                        for (NestedMapping localMapping :
mapping.getLocal()) {
                               localMapping.accept(this);
                           }
                       }
@@ -470,7 +489,7 @@
                       for (Domain domain : mapping.getDomain()) {
                           ((CoreDomain) domain).accept(this);
                       }
-                    for (Mapping localMapping : mapping.getLocal()) {
+                    for (NestedMapping localMapping :
+ mapping.getLocal()) {
                           localMapping.accept(this);
                       }
                   }
@@ -488,7 +507,14 @@
        * @param mapping the mapping
        * @return true, if is mto r mapping
        */
-    private boolean isMtoRMapping(Mapping mapping) {
+    private boolean isMtoRMapping(NestedMapping nestedMapping) {
+        Mapping mapping;
+        if (nestedMapping instanceof MappingCall) {
+            mapping = ((MappingCall)nestedMapping).getReferredMapping();
+        }
+        else {
+            mapping = (Mapping)nestedMapping;
+        }
           if (mapping.getDomain().size() == 0) {
               return false;
           }
@@ -507,7 +533,14 @@
        * @param mapping the mapping
        * @return true, if is lto m mapping
        */
-    private boolean isLtoMMapping(Mapping mapping) {
+    private boolean isLtoMMapping(NestedMapping nestedMapping) {
+        Mapping mapping;
+        if (nestedMapping instanceof MappingCall) {
+            mapping = ((MappingCall)nestedMapping).getReferredMapping();
+        }
+        else {
+            mapping = (Mapping)nestedMapping;
+        }
           if (mapping.getDomain().size() == 0) {
               return false;
           }

_______________________________________________
qvtd-dev mailing list
qvtd-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/qvtd-dev
_______________________________________________
qvtd-dev mailing list
qvtd-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/qvtd-dev


-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.2899 / Virus Database: 2639/6100 - Release Date: 02/12/13






Back to the top