Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-10-25 20:06:00 +0000
committerEd Willink2016-10-30 11:38:55 +0000
commitd0476b42c725da7c0571b03a137993b6dd0efdf4 (patch)
tree0947587d5fb0f6befb2e1d6910e73be4ee9dbf82
parenta0df6f39f412658c038f7fc0b52f8a4880f4d993 (diff)
downloadorg.eclipse.qvtd-d0476b42c725da7c0571b03a137993b6dd0efdf4.tar.gz
org.eclipse.qvtd-d0476b42c725da7c0571b03a137993b6dd0efdf4.tar.xz
org.eclipse.qvtd-d0476b42c725da7c0571b03a137993b6dd0efdf4.zip
[500962] Use element rather than collection type for connections
-rw-r--r--plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/java/QVTiCG2JavaVisitor.java9
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/BasicNodeConnection.java17
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/CyclicScheduledRegion2Mapping.java4
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/RootRegion2Mapping.java14
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl6
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEvaluationVisitor.java5
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeHelper.java7
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/AbstractConnection.java6
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/AbstractInvocation.java6
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/Interval.java6
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/SimpleConnection.java4
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/SimpleIncrementalConnection.java4
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/StrictConnection.java4
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/StrictIncrementalConnection.java4
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractConnectionInternal.java6
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractIncrementalConnectionInternal.java8
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractIntervalInternal.java10
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractTransformerInternal.java2
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/IncrementalConnectionInternal.java4
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/StrictConnectionInternal.java4
-rw-r--r--plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/StrictIncrementalConnectionInternal.java4
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPostOrderVisitor.java12
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/KiamaRewrite/KiamaRewrite.qvti41
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Tree2TallTree/Tree2TallTreeInstall.qvti4
24 files changed, 92 insertions, 99 deletions
diff --git a/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/java/QVTiCG2JavaVisitor.java b/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/java/QVTiCG2JavaVisitor.java
index 63b6641b1..7c95484c3 100644
--- a/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/java/QVTiCG2JavaVisitor.java
+++ b/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/java/QVTiCG2JavaVisitor.java
@@ -1380,13 +1380,8 @@ public class QVTiCG2JavaVisitor extends CG2JavaVisitor<@NonNull QVTiCodeGenerato
return false;
}
final String iteratorName = getSymbolName(null, "iterator");
- // CollectionTypeId abstractCollectionTypeId = (CollectionTypeId)initValue.getASTypeId();
- // assert abstractCollectionTypeId != null;
- // TypeId abstractElementTypeId = abstractCollectionTypeId.getElementTypeId();
- // BoxedDescriptor abstractBoxedDescriptor = context.getBoxedDescriptor(abstractElementTypeId);
- CollectionTypeId concreteCollectionTypeId = (CollectionTypeId)cgConnectionAssignment.getConnectionVariable().getASTypeId();
- assert concreteCollectionTypeId != null;
- TypeId concreteElementTypeId = concreteCollectionTypeId.getElementTypeId();
+ TypeId concreteElementTypeId = cgConnectionAssignment.getConnectionVariable().getASTypeId();
+ assert concreteElementTypeId != null;
BoxedDescriptor concreteBoxedDescriptor = context.getBoxedDescriptor(concreteElementTypeId);
BoxedDescriptor abstractBoxedDescriptor = concreteBoxedDescriptor;
if (!(initValue.getASTypeId() instanceof CollectionTypeId)) {
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/BasicNodeConnection.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/BasicNodeConnection.java
index f2211de73..f9ab1e8de 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/BasicNodeConnection.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/BasicNodeConnection.java
@@ -17,7 +17,6 @@ import java.util.Set;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.ocl.pivot.CollectionType;
-import org.eclipse.ocl.pivot.CompleteEnvironment;
import org.eclipse.ocl.pivot.Type;
import org.eclipse.ocl.pivot.ids.IdResolver;
import org.eclipse.qvtd.compiler.internal.utilities.SymbolNameBuilder;
@@ -126,11 +125,15 @@ public class BasicNodeConnection extends AbstractConnection<@NonNull Node> imple
Type commonType = null;
for (@NonNull Node node : getSources()) {
Type nodeType = node.getCompleteClass().getPrimaryClass();
- // System.out.println(" nodeType " + nodeType);
- CompleteEnvironment environment = idResolver.getEnvironment();
- if (!(nodeType instanceof CollectionType)) { // RealizedVariable accumulated on Connection
- nodeType = isOrdered() ? environment.getOrderedSetType(nodeType, true, null, null) : environment.getSetType(nodeType, true, null, null);
+ if (nodeType instanceof CollectionType) {
+ nodeType = ((CollectionType)nodeType).getElementType(); // FIXME needed for composed source nodes
+ assert nodeType != null;
}
+ // System.out.println(" nodeType " + nodeType);
+ // CompleteEnvironment environment = idResolver.getEnvironment();
+ // if (!(nodeType instanceof CollectionType)) { // RealizedVariable accumulated on Connection
+ // nodeType = isOrdered() ? environment.getOrderedSetType(nodeType, true, null, null) : environment.getSetType(nodeType, true, null, null);
+ // }
if (commonType == null) {
commonType = nodeType;
}
@@ -180,7 +183,7 @@ public class BasicNodeConnection extends AbstractConnection<@NonNull Node> imple
/**
* Return true if this connections should be ordered since its source could be ordered.
- */
+ *
private boolean isOrdered() {
boolean isOrdered = false;
for (@NonNull Node sourceNode1 : getSources()) {
@@ -195,7 +198,7 @@ public class BasicNodeConnection extends AbstractConnection<@NonNull Node> imple
}
}
return isOrdered;
- }
+ } */
/* @Override
public boolean isOutput() {
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/CyclicScheduledRegion2Mapping.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/CyclicScheduledRegion2Mapping.java
index ea2d5c462..b1627d4bf 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/CyclicScheduledRegion2Mapping.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/CyclicScheduledRegion2Mapping.java
@@ -121,13 +121,13 @@ public class CyclicScheduledRegion2Mapping extends AbstractScheduledRegion2Mappi
// incoming2outgoing.put(incomingConnection, internallyPassedConnection);
Type asType = getConnectionSourcesType(incomingConnection);
String localName = getSafeName("«local" + (index > 0 ? Integer.toString(index) : "") + "»");
- localVariable = helper.createBufferStatement(localName, asType, true, null);
+ localVariable = helper.createBufferStatement(localName, true, asType, true, null);
mapping.getOwnedStatements().add(localVariable);
connection2variable.put(outgoingConnection, localVariable);
//
if ((asType instanceof CollectionType) && ((CollectionType)asType).isUnique()) {
String newName = getSafeName("«new" + (index > 0 ? Integer.toString(index) : "") + "»");
- BufferStatement newVariable2 = newVariable = helper.createBufferStatement(newName, asType, true, null);
+ BufferStatement newVariable2 = newVariable = helper.createBufferStatement(newName, true, asType, true, null);
mapping.getOwnedStatements().add(newVariable2);
connection2variable.put(outgoingConnection, newVariable2);
}
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/RootRegion2Mapping.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/RootRegion2Mapping.java
index 5296de421..cfd33221c 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/RootRegion2Mapping.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/RootRegion2Mapping.java
@@ -123,10 +123,10 @@ public class RootRegion2Mapping extends AbstractScheduledRegion2Mapping
return helper.createVariableExp(allInstancesVariable);
}
- private @NonNull ConnectionVariable createRootConnectionVariable(@NonNull String name, @NonNull Type type, @Nullable OCLExpression initExpression) {
+ private @NonNull ConnectionVariable createRootConnectionVariable(@NonNull String name, boolean isStrict, @NonNull Type type, @Nullable OCLExpression initExpression) {
// Type variableType = visitor.getEnvironmentFactory().getCompleteEnvironment().getSetType(node.getCompleteClass().getPrimaryClass(), true, null, null);
// assert variableType != null;
- BufferStatement variable = helper.createBufferStatement(getSafeName(name), type, true, initExpression);
+ BufferStatement variable = helper.createBufferStatement(getSafeName(name), isStrict, type, true, initExpression);
mapping.getOwnedStatements().add(variable);
// Variable oldVariable = node2variable.put(node, variable);
// assert oldVariable == null;
@@ -134,7 +134,7 @@ public class RootRegion2Mapping extends AbstractScheduledRegion2Mapping
}
private void createRootConnectionVariables() {
- List<@NonNull NodeConnection> rootConnections = new ArrayList<@NonNull NodeConnection>(region.getRootConnections());
+ List<@NonNull NodeConnection> rootConnections = new ArrayList<>(region.getRootConnections());
Collections.sort(rootConnections, NameUtil.NAMEABLE_COMPARATOR);
for (@NonNull NodeConnection rootConnection : rootConnections) {
Type commonType = getConnectionSourcesType(rootConnection);
@@ -149,14 +149,10 @@ public class RootRegion2Mapping extends AbstractScheduledRegion2Mapping
case 1: initExpression = getFilteredExpression(initExpression, (NavigableEdge) incomingEdges.get(0)); break;
default: assert false;
}
- connection2variable.put(rootConnection, createRootConnectionVariable(name, commonType, initExpression));
- }
- else if (commonType instanceof CollectionType) {
- connection2variable.put(rootConnection, createRootConnectionVariable(name, commonType, null));
+ connection2variable.put(rootConnection, createRootConnectionVariable(name, false, commonType, initExpression));
}
else {
- CollectionType setType = visitor.getEnvironmentFactory().getCompleteEnvironment().getSetType(commonType, true, null, null);
- connection2variable.put(rootConnection, createRootConnectionVariable(name, setType, null));
+ connection2variable.put(rootConnection, createRootConnectionVariable(name, false, commonType, null));
}
}
}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl
index e3d7cb5e7..3ae699d0f 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl
@@ -63,9 +63,9 @@ inv NoRealizedVariableNavigations: ownedExpression->closure(oclContents())->sele
-- if mapping.isToMiddle then area = mapping else area.oclAsType(CoreDomain).isEnforceable endif
context GuardParameterBinding
-inv CheckedTypeIsNotConformant: isCheck implies let elementType = value.type.oclAsType(ocl::CollectionType).elementType in not elementType.conformsTo(boundVariable.type)
-inv UncheckedTypeIsConformant: not isCheck implies let elementType = value.type.oclAsType(ocl::CollectionType).elementType in elementType.conformsTo(boundVariable.type)
-inv CompatibleBinding: let elementType = value.type.oclAsType(ocl::CollectionType).elementType in elementType.conformsTo(boundVariable.type) or boundVariable.type.conformsTo(elementType)
+inv CheckedTypeIsNotConformant: isCheck implies not value.type.conformsTo(boundVariable.type)
+inv UncheckedTypeIsConformant: not isCheck implies value.type.conformsTo(boundVariable.type)
+inv CompatibleBinding: let elementType = value.type in elementType.conformsTo(boundVariable.type) or boundVariable.type.conformsTo(elementType)
context SimpleParameterBinding
inv CheckedTypeIsNotConformant: isCheck implies not value.type.conformsTo(boundVariable.type)
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEvaluationVisitor.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEvaluationVisitor.java
index 691a5fe23..109b542b4 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEvaluationVisitor.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEvaluationVisitor.java
@@ -91,6 +91,7 @@ public class QVTiEvaluationVisitor extends BasicEvaluationVisitor implements IQV
Object targetValue = ClassUtil.nonNullState(executor.getValueOf(targetVariable));
Connection connectionCollection = (Connection) targetValue;
Object values = valueExpression.accept(undecoratedVisitor);
+ assert values != null;
// if (values instanceof Iterable<?>) {
// CollectionValue valuesCollection = ValueUtil.asCollectionValue(values);
// for (Object value : valuesCollection) {
@@ -298,7 +299,7 @@ public class QVTiEvaluationVisitor extends BasicEvaluationVisitor implements IQV
assert name != null;
if (ownedExpression != null) {
Object initValue = ownedExpression.accept(undecoratedVisitor);
- connection = interval.createConnection(name, (CollectionTypeId) ownedExpression.getTypeId(), object.isIsStrict());
+ connection = interval.createConnection(name, ownedExpression.getTypeId(), object.isIsStrict());
if (initValue != null) {
for (Object value : (Iterable<?>)initValue) {
assert value != null;
@@ -307,7 +308,7 @@ public class QVTiEvaluationVisitor extends BasicEvaluationVisitor implements IQV
}
}
else {
- connection = interval.createConnection(name, (CollectionTypeId) object.getTypeId(), object.isIsStrict());
+ connection = interval.createConnection(name, object.getTypeId(), object.isIsStrict());
}
executor.replace(object, connection, false);
return true;
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeHelper.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeHelper.java
index 9bc3175e3..0c78126ff 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeHelper.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeHelper.java
@@ -12,7 +12,6 @@ package org.eclipse.qvtd.pivot.qvtimperative.utilities;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.CollectionType;
import org.eclipse.ocl.pivot.OCLExpression;
import org.eclipse.ocl.pivot.Type;
import org.eclipse.ocl.pivot.utilities.ClassUtil;
@@ -65,11 +64,12 @@ public class QVTimperativeHelper extends QVTbaseHelper
return mappingParameterBinding;
}
- public @NonNull BufferStatement createBufferStatement(@NonNull String name, @NonNull Type asType, boolean isRequired, @Nullable OCLExpression initExpression) {
+ public @NonNull BufferStatement createBufferStatement(@NonNull String name, boolean isStrict, @NonNull Type asType, boolean isRequired, @Nullable OCLExpression initExpression) {
BufferStatement asVariable = QVTimperativeFactory.eINSTANCE.createBufferStatement();
asVariable.setName(name);
asVariable.setType(asType);
asVariable.setIsRequired(isRequired);
+ asVariable.setIsStrict(isStrict);
asVariable.setOwnedExpression(initExpression);
return asVariable;
}
@@ -103,8 +103,7 @@ public class QVTimperativeHelper extends QVTbaseHelper
GuardParameterBinding mappingParameterBinding = QVTimperativeFactory.eINSTANCE.createGuardParameterBinding();
mappingParameterBinding.setBoundVariable(variable);
mappingParameterBinding.setValue(value);
- CollectionType collectionType = (CollectionType) value.getType();
- Type elementType = collectionType.getElementType();
+ Type elementType = value.getType();
Type guardType = ClassUtil.nonNullState(variable.getType());
mappingParameterBinding.setIsCheck(!elementType.conformsTo(standardLibrary, guardType));
return mappingParameterBinding;
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/AbstractConnection.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/AbstractConnection.java
index 0a7fce165..cd190bc70 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/AbstractConnection.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/AbstractConnection.java
@@ -15,14 +15,14 @@ import java.util.List;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
+import org.eclipse.ocl.pivot.ids.TypeId;
public abstract class AbstractConnection implements Connection
{
protected final boolean debugAppends = AbstractTransformer.APPENDS.isActive();
protected final @NonNull Interval interval;
protected final @NonNull String name;
- protected final @NonNull CollectionTypeId typeId;
+ protected final @NonNull TypeId typeId;
/**
* The consumers of each appended value.
@@ -39,7 +39,7 @@ public abstract class AbstractConnection implements Connection
*/
private boolean isQueued = false;
- protected AbstractConnection(@NonNull Interval interval, @NonNull String name, @NonNull CollectionTypeId typeId) {
+ protected AbstractConnection(@NonNull Interval interval, @NonNull String name, @NonNull TypeId typeId) {
this.interval = interval;
this.name = name;
this.typeId = typeId;
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/AbstractInvocation.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/AbstractInvocation.java
index 411abc355..e391c45a5 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/AbstractInvocation.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/AbstractInvocation.java
@@ -16,7 +16,7 @@ import java.util.List;
import java.util.Set;
import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
+import org.eclipse.ocl.pivot.ids.TypeId;
import org.eclipse.qvtd.runtime.internal.evaluation.AbstractInvocationInternal;
/**
@@ -68,11 +68,11 @@ public abstract class AbstractInvocation extends AbstractInvocationInternal
writeSlot.addSourceInternal(this);
}
- protected @NonNull Connection createConnection(@NonNull String name, @NonNull CollectionTypeId typeId, boolean isStrict) {
+ protected @NonNull Connection createConnection(@NonNull String name, @NonNull TypeId typeId, boolean isStrict) {
return constructor.getInterval().createConnection(name, typeId, isStrict);
}
- protected Connection.@NonNull Incremental createIncrementalConnection(@NonNull String name, @NonNull CollectionTypeId typeId, boolean isStrict) {
+ protected Connection.@NonNull Incremental createIncrementalConnection(@NonNull String name, @NonNull TypeId typeId, boolean isStrict) {
return constructor.getInterval().createIncrementalConnection(name, typeId, isStrict);
}
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/Interval.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/Interval.java
index 7792f5407..57b96cc18 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/Interval.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/Interval.java
@@ -11,7 +11,7 @@
package org.eclipse.qvtd.runtime.evaluation;
import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
+import org.eclipse.ocl.pivot.ids.TypeId;
import org.eclipse.ocl.pivot.utilities.Nameable;
/**
@@ -22,9 +22,9 @@ import org.eclipse.ocl.pivot.utilities.Nameable;
*/
public interface Interval extends ExecutionVisitable, Nameable
{
- @NonNull Connection createConnection(@NonNull String name, @NonNull CollectionTypeId typeId, boolean isStrict);
+ @NonNull Connection createConnection(@NonNull String name, @NonNull TypeId typeId, boolean isStrict);
- Connection.@NonNull Incremental createIncrementalConnection(@NonNull String name, @NonNull CollectionTypeId typeId, boolean isStrict);
+ Connection.@NonNull Incremental createIncrementalConnection(@NonNull String name, @NonNull TypeId typeId, boolean isStrict);
boolean flush();
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/SimpleConnection.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/SimpleConnection.java
index 962e54793..b53c7744b 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/SimpleConnection.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/SimpleConnection.java
@@ -11,7 +11,7 @@
package org.eclipse.qvtd.runtime.evaluation;
import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
+import org.eclipse.ocl.pivot.ids.TypeId;
import org.eclipse.qvtd.runtime.internal.evaluation.AbstractConnectionInternal;
/**
@@ -25,7 +25,7 @@ import org.eclipse.qvtd.runtime.internal.evaluation.AbstractConnectionInternal;
*/
public class SimpleConnection extends AbstractConnectionInternal
{
- public SimpleConnection(@NonNull Interval interval, @NonNull String name, @NonNull CollectionTypeId typeId) {
+ public SimpleConnection(@NonNull Interval interval, @NonNull String name, @NonNull TypeId typeId) {
super(interval, name, typeId);
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/SimpleIncrementalConnection.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/SimpleIncrementalConnection.java
index aa9196da9..c9bfb20d8 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/SimpleIncrementalConnection.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/SimpleIncrementalConnection.java
@@ -11,7 +11,7 @@
package org.eclipse.qvtd.runtime.evaluation;
import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
+import org.eclipse.ocl.pivot.ids.TypeId;
import org.eclipse.qvtd.runtime.internal.evaluation.IncrementalConnectionInternal;
/**
@@ -25,7 +25,7 @@ import org.eclipse.qvtd.runtime.internal.evaluation.IncrementalConnectionInterna
*/
public class SimpleIncrementalConnection extends IncrementalConnectionInternal
{
- public SimpleIncrementalConnection(@NonNull Interval interval, @NonNull String name, @NonNull CollectionTypeId typeId) {
+ public SimpleIncrementalConnection(@NonNull Interval interval, @NonNull String name, @NonNull TypeId typeId) {
super(interval, name, typeId);
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/StrictConnection.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/StrictConnection.java
index 0b1de4cc4..1a86ae7f0 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/StrictConnection.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/StrictConnection.java
@@ -11,7 +11,7 @@
package org.eclipse.qvtd.runtime.evaluation;
import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
+import org.eclipse.ocl.pivot.ids.TypeId;
import org.eclipse.qvtd.runtime.internal.evaluation.StrictConnectionInternal;
/**
@@ -23,7 +23,7 @@ import org.eclipse.qvtd.runtime.internal.evaluation.StrictConnectionInternal;
*/
public class StrictConnection extends StrictConnectionInternal
{
- public StrictConnection(@NonNull Interval interval, @NonNull String name, @NonNull CollectionTypeId typeId) {
+ public StrictConnection(@NonNull Interval interval, @NonNull String name, @NonNull TypeId typeId) {
super(interval, name, typeId);
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/StrictIncrementalConnection.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/StrictIncrementalConnection.java
index 971b1678e..9b2eafd17 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/StrictIncrementalConnection.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/evaluation/StrictIncrementalConnection.java
@@ -11,7 +11,7 @@
package org.eclipse.qvtd.runtime.evaluation;
import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
+import org.eclipse.ocl.pivot.ids.TypeId;
import org.eclipse.qvtd.runtime.internal.evaluation.StrictIncrementalConnectionInternal;
/**
@@ -25,7 +25,7 @@ import org.eclipse.qvtd.runtime.internal.evaluation.StrictIncrementalConnectionI
*/
public class StrictIncrementalConnection extends StrictIncrementalConnectionInternal
{
- public StrictIncrementalConnection(@NonNull Interval interval, @NonNull String name, @NonNull CollectionTypeId typeId) {
+ public StrictIncrementalConnection(@NonNull Interval interval, @NonNull String name, @NonNull TypeId typeId) {
super(interval, name, typeId);
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractConnectionInternal.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractConnectionInternal.java
index 407e14342..ac67c953c 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractConnectionInternal.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractConnectionInternal.java
@@ -14,7 +14,7 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
+import org.eclipse.ocl.pivot.ids.TypeId;
import org.eclipse.ocl.pivot.utilities.LabelUtil;
import org.eclipse.qvtd.runtime.evaluation.AbstractConnection;
import org.eclipse.qvtd.runtime.evaluation.AbstractTransformer;
@@ -33,11 +33,11 @@ import org.eclipse.qvtd.runtime.evaluation.InvocationConstructor;
public abstract class AbstractConnectionInternal extends AbstractConnection
{
/**
- * THe values passed by the coonnection..
+ * The values passed by the connection..
*/
protected final @NonNull List<@NonNull Object> values = new ArrayList<>();
- protected AbstractConnectionInternal(@NonNull Interval interval, @NonNull String name, @NonNull CollectionTypeId typeId) {
+ protected AbstractConnectionInternal(@NonNull Interval interval, @NonNull String name, @NonNull TypeId typeId) {
super(interval, name, typeId);
}
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractIncrementalConnectionInternal.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractIncrementalConnectionInternal.java
index 0afe7171b..f034b519b 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractIncrementalConnectionInternal.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractIncrementalConnectionInternal.java
@@ -17,7 +17,7 @@ import java.util.NoSuchElementException;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
+import org.eclipse.ocl.pivot.ids.TypeId;
import org.eclipse.ocl.pivot.utilities.LabelUtil;
import org.eclipse.qvtd.runtime.evaluation.AbstractConnection;
import org.eclipse.qvtd.runtime.evaluation.AbstractTransformer;
@@ -55,7 +55,9 @@ public abstract class AbstractIncrementalConnectionInternal extends AbstractConn
throw new NoSuchElementException();
}
cursor = next(cursor+1);
- return (T) valueAndConsumingInvocations.get(VALUE_INDEX);
+ @SuppressWarnings("unchecked")
+ T castValue = (T) valueAndConsumingInvocations.get(VALUE_INDEX);
+ return castValue;
}
private int next(int i) {
@@ -91,7 +93,7 @@ public abstract class AbstractIncrementalConnectionInternal extends AbstractConn
*/
protected final @NonNull List<@Nullable List<@NonNull Object>> listOfValueAndConsumingInvocations = new ArrayList<>();
- protected AbstractIncrementalConnectionInternal(@NonNull Interval interval, @NonNull String name, @NonNull CollectionTypeId typeId) {
+ protected AbstractIncrementalConnectionInternal(@NonNull Interval interval, @NonNull String name, @NonNull TypeId typeId) {
super(interval, name, typeId);
}
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractIntervalInternal.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractIntervalInternal.java
index 34f3e18ec..b5d3fa760 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractIntervalInternal.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractIntervalInternal.java
@@ -15,20 +15,20 @@ import java.util.List;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
+import org.eclipse.ocl.pivot.ids.TypeId;
import org.eclipse.qvtd.runtime.evaluation.AbstractConnection;
import org.eclipse.qvtd.runtime.evaluation.AbstractTransformer;
import org.eclipse.qvtd.runtime.evaluation.Connection;
-import org.eclipse.qvtd.runtime.evaluation.StrictIncrementalConnection;
import org.eclipse.qvtd.runtime.evaluation.ExecutionVisitor;
import org.eclipse.qvtd.runtime.evaluation.Interval;
import org.eclipse.qvtd.runtime.evaluation.Invocation;
import org.eclipse.qvtd.runtime.evaluation.InvocationFailedException;
import org.eclipse.qvtd.runtime.evaluation.InvocationManager;
import org.eclipse.qvtd.runtime.evaluation.SimpleConnection;
+import org.eclipse.qvtd.runtime.evaluation.SimpleIncrementalConnection;
import org.eclipse.qvtd.runtime.evaluation.SlotState;
import org.eclipse.qvtd.runtime.evaluation.StrictConnection;
-import org.eclipse.qvtd.runtime.evaluation.SimpleIncrementalConnection;
+import org.eclipse.qvtd.runtime.evaluation.StrictIncrementalConnection;
/**
* AbstractIntervalInternal provides the shared implementation of the intrusive blocked/waiting linked list functionality.
@@ -100,7 +100,7 @@ public abstract class AbstractIntervalInternal implements Interval
}
@Override
- public @NonNull Connection createConnection(@NonNull String name, @NonNull CollectionTypeId typeId, boolean isStrict) {
+ public @NonNull Connection createConnection(@NonNull String name, @NonNull TypeId typeId, boolean isStrict) {
Connection connection;
if (isStrict) {
connection = new StrictConnection(this, name, typeId);
@@ -113,7 +113,7 @@ public abstract class AbstractIntervalInternal implements Interval
}
@Override
- public Connection.@NonNull Incremental createIncrementalConnection(@NonNull String name, @NonNull CollectionTypeId typeId, boolean isStrict) {
+ public Connection.@NonNull Incremental createIncrementalConnection(@NonNull String name, @NonNull TypeId typeId, boolean isStrict) {
Connection.Incremental connection;
if (isStrict) {
connection = new StrictIncrementalConnection(this, name, typeId);
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractTransformerInternal.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractTransformerInternal.java
index ba8d99690..775347860 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractTransformerInternal.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/AbstractTransformerInternal.java
@@ -528,7 +528,7 @@ public abstract class AbstractTransformerInternal extends AbstractModelManager i
models[modelIndex].addRootObjects(eRootObjects);
}
- protected @NonNull Connection createConnection(@NonNull String name, @NonNull CollectionTypeId typeId, boolean isStrict) {
+ protected @NonNull Connection createConnection(@NonNull String name, @NonNull TypeId typeId, boolean isStrict) {
return invocationManager.getRootInterval().createConnection(name, typeId, isStrict);
}
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/IncrementalConnectionInternal.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/IncrementalConnectionInternal.java
index 4a0544b1a..b847fd50f 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/IncrementalConnectionInternal.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/IncrementalConnectionInternal.java
@@ -14,7 +14,7 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
+import org.eclipse.ocl.pivot.ids.TypeId;
import org.eclipse.ocl.pivot.utilities.LabelUtil;
import org.eclipse.qvtd.runtime.evaluation.AbstractInvocation;
import org.eclipse.qvtd.runtime.evaluation.AbstractTransformer;
@@ -32,7 +32,7 @@ import org.eclipse.qvtd.runtime.evaluation.Invocation;
*/
public class IncrementalConnectionInternal extends AbstractIncrementalConnectionInternal
{
- protected IncrementalConnectionInternal(@NonNull Interval interval, @NonNull String name, @NonNull CollectionTypeId typeId) {
+ protected IncrementalConnectionInternal(@NonNull Interval interval, @NonNull String name, @NonNull TypeId typeId) {
super(interval, name, typeId);
}
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/StrictConnectionInternal.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/StrictConnectionInternal.java
index 31e9fca17..131889241 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/StrictConnectionInternal.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/StrictConnectionInternal.java
@@ -14,7 +14,7 @@ import java.util.HashSet;
import java.util.Set;
import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
+import org.eclipse.ocl.pivot.ids.TypeId;
import org.eclipse.ocl.pivot.utilities.LabelUtil;
import org.eclipse.qvtd.runtime.evaluation.AbstractTransformer;
import org.eclipse.qvtd.runtime.evaluation.Interval;
@@ -33,7 +33,7 @@ public abstract class StrictConnectionInternal extends AbstractConnectionInterna
*/
private /*@LazyNonNull*/ Set<@NonNull Object> uniqueValues = null;
- protected StrictConnectionInternal(@NonNull Interval interval, @NonNull String name, @NonNull CollectionTypeId typeId) {
+ protected StrictConnectionInternal(@NonNull Interval interval, @NonNull String name, @NonNull TypeId typeId) {
super(interval, name, typeId);
}
diff --git a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/StrictIncrementalConnectionInternal.java b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/StrictIncrementalConnectionInternal.java
index c46d387ea..9eb2eef62 100644
--- a/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/StrictIncrementalConnectionInternal.java
+++ b/plugins/org.eclipse.qvtd.runtime/src/org/eclipse/qvtd/runtime/internal/evaluation/StrictIncrementalConnectionInternal.java
@@ -16,7 +16,7 @@ import java.util.List;
import java.util.Map;
import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.ocl.pivot.ids.CollectionTypeId;
+import org.eclipse.ocl.pivot.ids.TypeId;
import org.eclipse.ocl.pivot.utilities.LabelUtil;
import org.eclipse.qvtd.runtime.evaluation.AbstractInvocation;
import org.eclipse.qvtd.runtime.evaluation.AbstractTransformer;
@@ -37,7 +37,7 @@ public abstract class StrictIncrementalConnectionInternal extends AbstractIncrem
*/
private final @NonNull Map<@NonNull Object, @NonNull List<@NonNull Object>> uniqueValues2valueAndConsumingInvocations = new HashMap<>();
- protected StrictIncrementalConnectionInternal(@NonNull Interval interval, @NonNull String name, @NonNull CollectionTypeId typeId) {
+ protected StrictIncrementalConnectionInternal(@NonNull Interval interval, @NonNull String name, @NonNull TypeId typeId) {
super(interval, name, typeId);
}
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPostOrderVisitor.java b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPostOrderVisitor.java
index 7a8e37c43..9d0cbf25e 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPostOrderVisitor.java
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPostOrderVisitor.java
@@ -131,7 +131,17 @@ public class QVTimperativeCSPostOrderVisitor extends AbstractQVTimperativeCSPost
OCLExpression target = context.visitLeft2Right(OCLExpression.class, expression);
asOutStatement.setOwnedExpression(target);
if ((csElement.getOwnedType() == null) && (target != null)) {
- context.setType(asOutStatement, target.getType(), target.isIsRequired(), target.getTypeValue());
+ Type targetType = target.getType();
+ boolean isRequired = target.isIsRequired();
+ if (targetType instanceof CollectionType) {
+ CollectionType collectionType = (CollectionType)targetType;
+ targetType = collectionType.getElementType();
+ isRequired = collectionType.isIsNullFree();
+ }
+ // FIXME else => error
+ // FIXME !isRequired => error
+ // FIXME isStrict
+ context.setType(asOutStatement, targetType, isRequired, target.getTypeValue());
}
}
}
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/KiamaRewrite/KiamaRewrite.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/KiamaRewrite/KiamaRewrite.qvti
index 5f33d2710..aea399553 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/KiamaRewrite/KiamaRewrite.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/KiamaRewrite/KiamaRewrite.qvti
@@ -11,10 +11,9 @@ map __root__ in KiamaRewrite_qvtp_qvtcas
{
var roots : Set(ocl::OclElement) := leftCS.rootObjects();
var _'«child-NumCS»' : Set(kiamacs::NumCS) := roots->selectByKind(kiamacs::NumCS);
- buffer ji_NumCS1 : Set(kiamacs::NumCS) := _'«child-NumCS»';
+ buffer ji_NumCS1 : kiamacs::NumCS := _'«child-NumCS»';
var _'«child-PlusCS»' : Set(kiamacs::PlusCS) := roots->selectByKind(kiamacs::PlusCS);
- buffer ji_PlusCS1 : Set(kiamacs::PlusCS) := _'«child-PlusCS»';
- buffer ji_PlusCS_31 : Set(kiamacs::PlusCS) := _'«child-PlusCS»';
+ buffer ji_PlusCS1 : kiamacs::PlusCS := _'«child-PlusCS»';
var _'«child-TopCS»' : Set(kiamacs::TopCS) := roots->selectByKind(kiamacs::TopCS);
var ji_TopCS1 : Set(kiamacs::TopCS) := _'«child-TopCS»';
for loop0 : kiamacs::TopCS in ji_TopCS1 {
@@ -26,11 +25,10 @@ map __root__ in KiamaRewrite_qvtp_qvtcas
call r_TopCS_node {
ji_NumCS appendsTo ji_NumCS1;
ji_PlusCS appendsTo ji_PlusCS1;
- ji_PlusCS_3 appendsTo ji_PlusCS_31;
_'«parent»' iterates loop0;
}
}
- for loop0 : kiamacs::PlusCS in ji_PlusCS_31 {
+ for loop0 : kiamacs::PlusCS in ji_PlusCS1 {
call r__PlusCS {
ji_NumCS appendsTo ji_NumCS1;
ji_PlusCS appendsTo ji_PlusCS1;
@@ -192,8 +190,8 @@ map m_TopCS_ast_node in KiamaRewrite_qvtp_qvtcas
map r_PlusCS_left in KiamaRewrite_qvtp_qvtcas
{
- append ji_PlusCS : Set(kiamacs::PlusCS);
- append ji_NumCS : Set(kiamacs::NumCS);
+ append ji_PlusCS : kiamacs::PlusCS;
+ append ji_NumCS : kiamacs::NumCS;
in:leftCS _'«parent»' : PlusCS;
var allChildren : Set(kiamacs::NodeCS) := _'«parent»'.left.oclAsSet();
var _'«child-PlusCS»' : Set(kiamacs::PlusCS) := allChildren->selectByKind(kiamacs::PlusCS);
@@ -211,8 +209,8 @@ map r_PlusCS_left in KiamaRewrite_qvtp_qvtcas
map r_PlusCS_right in KiamaRewrite_qvtp_qvtcas
{
- append ji_PlusCS : Set(kiamacs::PlusCS);
- append ji_NumCS : Set(kiamacs::NumCS);
+ append ji_PlusCS : kiamacs::PlusCS;
+ append ji_NumCS : kiamacs::NumCS;
in:leftCS _'«parent»' : PlusCS;
var allChildren : Set(kiamacs::NodeCS) := _'«parent»'.right.oclAsSet();
var _'«child-PlusCS»' : Set(kiamacs::PlusCS) := allChildren->selectByKind(kiamacs::PlusCS);
@@ -230,9 +228,9 @@ map r_PlusCS_right in KiamaRewrite_qvtp_qvtcas
map r_TopCS_node in KiamaRewrite_qvtp_qvtcas
{
- append ji_PlusCS : Set(kiamacs::PlusCS);
- append ji_PlusCS_3 : Set(kiamacs::PlusCS);
- append ji_NumCS : Set(kiamacs::NumCS);
+ append ji_PlusCS : kiamacs::PlusCS;
+ append ji_PlusCS_3 : kiamacs::PlusCS;
+ append ji_NumCS : kiamacs::NumCS;
guard:leftCS _'«parent»' : TopCS;
var allChildren : Set(kiamacs::NodeCS) := _'«parent»'.node.oclAsSet();
var _'«child-PlusCS»' : Set(kiamacs::PlusCS) := allChildren->selectByKind(kiamacs::PlusCS);
@@ -244,28 +242,17 @@ map r_TopCS_node in KiamaRewrite_qvtp_qvtcas
strict map r__PlusCS in KiamaRewrite_qvtp_qvtcas
{
- append ji_PlusCS : Set(kiamacs::PlusCS);
- append ji_NumCS : Set(kiamacs::NumCS);
+ append ji_PlusCS : kiamacs::PlusCS;
+ append ji_NumCS : kiamacs::NumCS;
guard:leftCS _'«head»' : PlusCS;
- buffer _'«local»' : Set(kiamacs::PlusCS);
- buffer _'«new»' : Set(kiamacs::PlusCS);
call r_PlusCS_left {
ji_NumCS appendsTo ji_NumCS;
- ji_PlusCS appendsTo _'«local»';
+ ji_PlusCS appendsTo ji_PlusCS;
_'«parent»' uses _'«head»';
}
call r_PlusCS_right {
ji_NumCS appendsTo ji_NumCS;
- ji_PlusCS appendsTo _'«local»';
+ ji_PlusCS appendsTo ji_PlusCS;
_'«parent»' uses _'«head»';
}
- add _'«new»' += _'«local»'->excludingAll(ji_PlusCS);
- add ji_PlusCS += _'«new»';
- for loop0 : kiamacs::PlusCS in _'«new»' {
- call r__PlusCS {
- ji_NumCS appendsTo ji_NumCS;
- ji_PlusCS appendsTo ji_PlusCS;
- _'«head»' iterates loop0;
- }
- }
} \ No newline at end of file
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Tree2TallTree/Tree2TallTreeInstall.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Tree2TallTree/Tree2TallTreeInstall.qvti
index f4e53f6de..e20da977a 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Tree2TallTree/Tree2TallTreeInstall.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Tree2TallTree/Tree2TallTreeInstall.qvti
@@ -10,7 +10,7 @@ transformation Tree2TallTreeInstall {
map __root__ in Tree2TallTreeInstall {
buffer nodes := tree.objectsOfKind(Node)->sortedBy(name);
- buffer node2tallNodes : Sequence(tree2talltree::Node2TallNode);
+ buffer node2tallNodes : tree2talltree::Node2TallNode;
install Node2MiddleNode {
node consumes nodes;
node2tallNodes appendsTo node2tallNodes;
@@ -25,7 +25,7 @@ map __root__ in Tree2TallTreeInstall {
map Node2MiddleNode in Tree2TallTreeInstall {
guard:tree node : Node;
- append node2tallNodes : Sequence(tree2talltree::Node2TallNode);
+ append node2tallNodes : tree2talltree::Node2TallNode;
new:tree2talltree node2tallNode : Node2TallNode;
set node2tallNode.node := node;
set node2tallNode.name := node.name;

Back to the top