Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-09-19 15:37:44 +0000
committerEd Willink2016-09-19 15:37:44 +0000
commita7a9612732d0e4be31aa10552ef2954b22196593 (patch)
treeff2d34fda39a95dac86f5964242e03809fa0a727 /plugins
parentbc3cdb7773caf5e70395810214cc546d55caa4b0 (diff)
downloadorg.eclipse.qvtd-a7a9612732d0e4be31aa10552ef2954b22196593.tar.gz
org.eclipse.qvtd-a7a9612732d0e4be31aa10552ef2954b22196593.tar.xz
org.eclipse.qvtd-a7a9612732d0e4be31aa10552ef2954b22196593.zip
[500369] Support MappingParameters
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java37
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/AbstractRegion2Mapping.java22
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicRegion2Mapping.java12
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/CyclicScheduledRegion2Mapping.java24
-rw-r--r--plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/stepper/QVTiStepperVisitor.java22
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/analysis/AbstractDomainUsageAnalysis.java21
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/GuardParameterAttribution.java (renamed from plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/GuardVariableAttribution.java)10
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/MappingAttribution.java3
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/MappingCallBindingAttribution.java3
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEvaluationVisitor.java26
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/scoping/QVTimperativePivotScoping.java4
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeHelper.java26
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativePrettyPrintVisitor.java52
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeToStringVisitor.java38
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/GuardParameter.gif (renamed from plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/GuardVariable.gif)bin209 -> 209 bytes
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/src/org/eclipse/qvtd/xtext/qvtimperative/ui/labeling/QVTimperativeLabelProvider.java8
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/src/org/eclipse/qvtd/xtext/qvtimperative/ui/outline/QVTimperativeOutlineTreeProvider.java10
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/as2cs/QVTimperativeDeclarationVisitor.java40
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSContainmentVisitor.java36
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPostOrderVisitor.java12
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPreOrderVisitor.java40
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/formatting/QVTimperativeFormatter.java16
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/utilities/QVTimperativeCSResource.java10
23 files changed, 242 insertions, 230 deletions
diff --git a/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java b/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java
index 48ca5efe2..e4bf8e29f 100644
--- a/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java
+++ b/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java
@@ -101,18 +101,19 @@ import org.eclipse.qvtd.pivot.qvtbase.TypedModel;
import org.eclipse.qvtd.pivot.qvtbase.analysis.DomainUsage;
import org.eclipse.qvtd.pivot.qvtbase.utilities.QVTbaseUtil;
import org.eclipse.qvtd.pivot.qvtimperative.AddStatement;
+import org.eclipse.qvtd.pivot.qvtimperative.AppendParameter;
import org.eclipse.qvtd.pivot.qvtimperative.CheckStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.GuardParameter;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeModel;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeTypedModel;
-import org.eclipse.qvtd.pivot.qvtimperative.InConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.LoopVariable;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCall;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCallBinding;
import org.eclipse.qvtd.pivot.qvtimperative.MappingLoop;
+import org.eclipse.qvtd.pivot.qvtimperative.MappingParameter;
import org.eclipse.qvtd.pivot.qvtimperative.MappingStatement;
import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ObservableStatement;
@@ -322,11 +323,8 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit
public void doBottoms() {
List<@NonNull CGGuardVariable> cgFreeVariables = new ArrayList<>();
- for (@NonNull GuardVariable pGuardVariable : ClassUtil.nullFree(asMapping.getOwnedGuardVariables())) {
- cgFreeVariables.add(getGuardVariable(pGuardVariable));
- }
- for (@NonNull InConnectionVariable pGuardVariable : ClassUtil.nullFree(asMapping.getInoutVariables())) {
- cgFreeVariables.add(getGuardVariable(pGuardVariable));
+ for (@NonNull MappingParameter pMappingParameter : ClassUtil.nullFree(asMapping.getOwnedParameters())) {
+ cgFreeVariables.add(getGuardVariable(pMappingParameter));
}
Collections.sort(cgFreeVariables, NameUtil.NAMEABLE_COMPARATOR);
cgMapping.getFreeVariables().addAll(cgFreeVariables);
@@ -536,8 +534,8 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit
}
protected @NonNull CGTypedModel getTypedModel(@NonNull VariableDeclaration pVariable) {
- if (pVariable instanceof GuardVariable) {
- TypedModel referredTypedModel = ClassUtil.nonNullState(((GuardVariable)pVariable).getReferredTypedModel());
+ if (pVariable instanceof GuardParameter) {
+ TypedModel referredTypedModel = ClassUtil.nonNullState(((GuardParameter)pVariable).getReferredTypedModel());
return ClassUtil.nonNullState(analyzer.getTypedModel(referredTypedModel));
}
Domain pDomain = QVTimperativeUtil.getContainingDomain(pVariable);
@@ -600,6 +598,13 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit
}
@Override
+ public @Nullable CGNamedElement visitAppendParameter(@NonNull AppendParameter object) {
+ return visiting(object); // Really should not be happening.
+ /* CGVariable cgVariable = getVariable(asConnectionVariable);
+ return cgVariable; */
+ }
+
+ @Override
public @Nullable CGNamedElement visitBaseModel(@NonNull BaseModel object) {
return visiting(object);
}
@@ -766,7 +771,7 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit
}
@Override
- public @Nullable CGNamedElement visitGuardVariable(@NonNull GuardVariable object) {
+ public @Nullable CGNamedElement visitGuardParameter(@NonNull GuardParameter object) {
return visiting(object);
// return getVariable(asVariable);
}
@@ -785,13 +790,6 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit
}
@Override
- public @Nullable CGNamedElement visitInConnectionVariable(@NonNull InConnectionVariable object) {
- return visiting(object); // Really should not be happening.
- /* CGVariable cgVariable = getVariable(asConnectionVariable);
- return cgVariable; */
- }
-
- @Override
public @Nullable CGNamedElement visitLoopVariable(@NonNull LoopVariable asVariable) {
return visiting(asVariable);
}
@@ -876,6 +874,11 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit
}
@Override
+ public CGNamedElement visitMappingParameter(@NonNull MappingParameter object) {
+ return visiting(object);
+ }
+
+ @Override
public CGNamedElement visitMappingStatement(@NonNull MappingStatement object) {
return visiting(object);
}
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/AbstractRegion2Mapping.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/AbstractRegion2Mapping.java
index 4c3fef17c..353eb8e46 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/AbstractRegion2Mapping.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/AbstractRegion2Mapping.java
@@ -47,8 +47,8 @@ import org.eclipse.qvtd.compiler.internal.qvtp2qvts.NodeConnection;
import org.eclipse.qvtd.compiler.internal.qvtp2qvts.Region;
import org.eclipse.qvtd.compiler.internal.qvtp2qvts.SchedulerConstants;
import org.eclipse.qvtd.pivot.qvtimperative.AddStatement;
+import org.eclipse.qvtd.pivot.qvtimperative.AppendParameter;
import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
-import org.eclipse.qvtd.pivot.qvtimperative.InConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCall;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCallBinding;
@@ -103,6 +103,13 @@ public abstract class AbstractRegion2Mapping
mapping.getOwnedStatements().add(addStatement);
}
+ protected @NonNull AppendParameter createAppendParameter(@NonNull NodeConnection connection) {
+ Type asType = getConnectionSourcesType(connection);
+ String name = connection.getName();
+ assert name != null;
+ return helper.createAppendParameter(getSafeName(name), asType, true);
+ }
+
protected @NonNull CallExp createCallExp(@NonNull OCLExpression asSource, @NonNull Property asProperty) {
if (asProperty.eContainer() == null) {
Type asType = asProperty.getType();
@@ -120,21 +127,14 @@ public abstract class AbstractRegion2Mapping
return PivotUtil.createNavigationCallExp(asSource, asProperty);
}
- protected @NonNull InConnectionVariable createInConnectionVariable(@NonNull NodeConnection connection) {
- Type asType = getConnectionSourcesType(connection);
- String name = connection.getName();
- assert name != null;
- return helper.createInConnectionVariable(getSafeName(name), asType, true);
- }
-
- protected void createConnectionGuardVariables() {
+ protected void createAppendParameters() {
List<@NonNull NodeConnection> intermediateConnections = region.getIntermediateConnections();
if (intermediateConnections.size() > 0) {
connection2variable = new HashMap<>();
for (@NonNull NodeConnection connection : intermediateConnections) {
- InConnectionVariable connectionVariable = createInConnectionVariable(connection);
+ AppendParameter connectionVariable = createAppendParameter(connection);
connection2variable.put(connection, connectionVariable);
- mapping.getInoutVariables().add(connectionVariable);
+ mapping.getOwnedParameters().add(connectionVariable);
}
}
}
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicRegion2Mapping.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicRegion2Mapping.java
index b5d7b0dd9..36bc0ff26 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicRegion2Mapping.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicRegion2Mapping.java
@@ -80,7 +80,7 @@ import org.eclipse.qvtd.pivot.qvtbase.utilities.QVTbaseUtil;
import org.eclipse.qvtd.pivot.qvtimperative.CheckStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.GuardParameter;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeTypedModel;
import org.eclipse.qvtd.pivot.qvtimperative.LoopVariable;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCallBinding;
@@ -780,12 +780,12 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
}
}
- private @NonNull GuardVariable createGuardVariable(@NonNull Node guardNode) {
+ private @NonNull GuardParameter createGuardParameter(@NonNull Node guardNode) {
ClassDatumAnalysis classDatumAnalysis = guardNode.getClassDatumAnalysis();
Type variableType = guardNode.getCompleteClass().getPrimaryClass();
ImperativeTypedModel iTypedModel = ClassUtil.nonNullState(visitor.getQVTiTypedModel(classDatumAnalysis.getTypedModel()));
- GuardVariable guardVariable = helper.createGuardVariable(getSafeName(guardNode), iTypedModel, variableType, true);
- mapping.getOwnedGuardVariables().add(guardVariable);
+ GuardParameter guardVariable = helper.createGuardParameter(getSafeName(guardNode), iTypedModel, variableType, true);
+ mapping.getOwnedParameters().add(guardVariable);
VariableDeclaration oldVariable = node2variable.put(guardNode, guardVariable);
assert oldVariable == null;
return guardVariable;
@@ -845,12 +845,12 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
}
Collections.sort(guardNodes, NameUtil.NAMEABLE_COMPARATOR);
for (@NonNull Node guardNode : guardNodes) {
- createGuardVariable(guardNode);
+ createGuardParameter(guardNode);
}
//
// Create any connectionVariable guards
//
- createConnectionGuardVariables();
+ createAppendParameters();
}
private void createMappingStatements(@NonNull Map<@NonNull Region, @NonNull Map<@NonNull Node, @NonNull Node>> calls) {
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 c22b60ec2..27d769cc1 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
@@ -35,8 +35,8 @@ import org.eclipse.qvtd.compiler.internal.qvtp2qvts.Node;
import org.eclipse.qvtd.compiler.internal.qvtp2qvts.NodeConnection;
import org.eclipse.qvtd.compiler.internal.qvtp2qvts.Region;
import org.eclipse.qvtd.pivot.qvtimperative.AddStatement;
+import org.eclipse.qvtd.pivot.qvtimperative.AppendParameter;
import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
-import org.eclipse.qvtd.pivot.qvtimperative.InConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCall;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCallBinding;
import org.eclipse.qvtd.pivot.qvtimperative.MappingStatement;
@@ -70,7 +70,7 @@ public class CyclicScheduledRegion2Mapping extends AbstractScheduledRegion2Mappi
/**
* The guard variable for the recursed type.
*/
- private final @NonNull InConnectionVariable guardVariable;
+ private final @NonNull AppendParameter guardVariable;
/**
* The local accumulation variable for the recursed type. Already processed values may be present.
@@ -85,7 +85,7 @@ public class CyclicScheduledRegion2Mapping extends AbstractScheduledRegion2Mappi
/**
* The accumulated output variable for the recursed type.
*/
- private InConnectionVariable accumulatedVariable;
+ private AppendParameter accumulatedVariable;
public RecursionContext(@NonNull Node headNode) {
this.classDatumAnalysis = headNode.getClassDatumAnalysis();
@@ -94,8 +94,8 @@ public class CyclicScheduledRegion2Mapping extends AbstractScheduledRegion2Mappi
// Create the domain guard variable.
//
org.eclipse.ocl.pivot.Class elementType = classDatumAnalysis.getCompleteClass().getPrimaryClass();
- guardVariable = helper.createInConnectionVariable(getSafeName(headNode), elementType, false);
- mapping.getInoutVariables().add(guardVariable);
+ guardVariable = helper.createAppendParameter(getSafeName(headNode), elementType, false);
+ mapping.getOwnedParameters().add(guardVariable);
Iterable<@NonNull NodeConnection> outgoingConnections = headNode.getOutgoingPassedConnections();
assert Iterables.size(outgoingConnections) == 1;
@@ -167,8 +167,8 @@ public class CyclicScheduledRegion2Mapping extends AbstractScheduledRegion2Mappi
// Select a/the outgoing recursive intermediate connection.
//
NodeConnection intermediateConnection = accumulatedConnection;
- InConnectionVariable accumulatedVariable2 = accumulatedVariable = createInConnectionVariable(intermediateConnection);
- mapping.getInoutVariables().add(accumulatedVariable2);
+ AppendParameter accumulatedVariable2 = accumulatedVariable = createAppendParameter(intermediateConnection);
+ mapping.getOwnedParameters().add(accumulatedVariable2);
connection2variable.put(intermediateConnection, accumulatedVariable2);
}
}
@@ -214,23 +214,23 @@ public class CyclicScheduledRegion2Mapping extends AbstractScheduledRegion2Mappi
//
// Create any non-recursion connectionVariable guards
//
- createConnectionGuardVariables();
+ createAppendParameters();
}
/**
* Create the guard variables for the intermediate connections that are not recursions.
*/
@Override
- protected void createConnectionGuardVariables() {
+ protected void createAppendParameters() {
List<@NonNull NodeConnection> intermediateConnections = region.getIntermediateConnections();
for (@NonNull NodeConnection intermediateConnection : intermediateConnections) {
- InConnectionVariable connectionVariable = (InConnectionVariable) connection2variable.get(intermediateConnection);
+ AppendParameter connectionVariable = (AppendParameter) connection2variable.get(intermediateConnection);
if (connectionVariable == null) {
String name = intermediateConnection.getName();
assert name != null;
- connectionVariable = helper.createInConnectionVariable(name, getConnectionSourcesType(intermediateConnection), true);
+ connectionVariable = helper.createAppendParameter(name, getConnectionSourcesType(intermediateConnection), true);
connection2variable.put(intermediateConnection, connectionVariable);
- mapping.getInoutVariables().add(connectionVariable);
+ mapping.getOwnedParameters().add(connectionVariable);
}
}
}
diff --git a/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/stepper/QVTiStepperVisitor.java b/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/stepper/QVTiStepperVisitor.java
index 76b078185..cd8c294bb 100644
--- a/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/stepper/QVTiStepperVisitor.java
+++ b/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/stepper/QVTiStepperVisitor.java
@@ -18,17 +18,18 @@ import org.eclipse.qvtd.pivot.qvtbase.Domain;
import org.eclipse.qvtd.pivot.qvtbase.Predicate;
import org.eclipse.qvtd.pivot.qvtbase.Transformation;
import org.eclipse.qvtd.pivot.qvtimperative.AddStatement;
+import org.eclipse.qvtd.pivot.qvtimperative.AppendParameter;
import org.eclipse.qvtd.pivot.qvtimperative.CheckStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.GuardParameter;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeTypedModel;
-import org.eclipse.qvtd.pivot.qvtimperative.InConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.LoopVariable;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCall;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCallBinding;
import org.eclipse.qvtd.pivot.qvtimperative.MappingLoop;
+import org.eclipse.qvtd.pivot.qvtimperative.MappingParameter;
import org.eclipse.qvtd.pivot.qvtimperative.MappingStatement;
import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ObservableStatement;
@@ -50,6 +51,11 @@ public class QVTiStepperVisitor extends AbstractQVTimperativeStepperVisitor
}
@Override
+ public @Nullable IStepper visitAppendParameter(@NonNull AppendParameter object) {
+ return NonStepper.INSTANCE;
+ }
+
+ @Override
public @Nullable IStepper visitCheckStatement(@NonNull CheckStatement object) {
return PreStepper.INSTANCE;
}
@@ -70,7 +76,7 @@ public class QVTiStepperVisitor extends AbstractQVTimperativeStepperVisitor
}
@Override
- public @Nullable IStepper visitGuardVariable(@NonNull GuardVariable asVariable) {
+ public @Nullable IStepper visitGuardParameter(@NonNull GuardParameter asVariable) {
return NonStepper.INSTANCE;
}
@@ -80,11 +86,6 @@ public class QVTiStepperVisitor extends AbstractQVTimperativeStepperVisitor
}
@Override
- public @Nullable IStepper visitInConnectionVariable(@NonNull InConnectionVariable object) {
- return PreStepper.INSTANCE;
- }
-
- @Override
public @Nullable IStepper visitLoopVariable(@NonNull LoopVariable asVariable) {
return NonStepper.INSTANCE;
}
@@ -110,6 +111,11 @@ public class QVTiStepperVisitor extends AbstractQVTimperativeStepperVisitor
}
@Override
+ public @Nullable IStepper visitMappingParameter(@NonNull MappingParameter object) {
+ return visiting(object);
+ }
+
+ @Override
public @Nullable IStepper visitMappingStatement(@NonNull MappingStatement object) {
return visiting(object);
}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/analysis/AbstractDomainUsageAnalysis.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/analysis/AbstractDomainUsageAnalysis.java
index a0a8fe738..4793e620e 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/analysis/AbstractDomainUsageAnalysis.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/analysis/AbstractDomainUsageAnalysis.java
@@ -78,10 +78,10 @@ import org.eclipse.qvtd.pivot.qvtbase.analysis.DomainUsage;
import org.eclipse.qvtd.pivot.qvtbase.analysis.DomainUsageAnalysis;
import org.eclipse.qvtd.pivot.qvtbase.utilities.QVTbaseUtil;
import org.eclipse.qvtd.pivot.qvtimperative.CheckStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.GuardParameter;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
+import org.eclipse.qvtd.pivot.qvtimperative.MappingParameter;
import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.Statement;
@@ -249,7 +249,7 @@ public abstract class AbstractDomainUsageAnalysis extends AbstractExtendingQVTim
for (Domain domain : rule.getDomain()) {
if (domain instanceof ImperativeDomain) {
DomainUsage usage = visit(domain.getTypedModel());
- for (GuardVariable variable : ((ImperativeDomain)domain).getOwnedGuardVariables()) {
+ for (GuardParameter variable : ((ImperativeDomain)domain).getOwnedGuardVariables()) {
if (variable != null) {
DomainUsage variableUsage = visit(variable.getType());
if (variableUsage != primitiveUsage) {
@@ -263,18 +263,7 @@ public abstract class AbstractDomainUsageAnalysis extends AbstractExtendingQVTim
} */
if (rule instanceof Mapping) {
DomainUsage middleUsage = getRootAnalysis().getMiddleUsage();
- for (GuardVariable variable : ((Mapping)rule).getOwnedGuardVariables()) {
- if (variable != null) {
- DomainUsage variableUsage = visit(variable.getType());
- // if (variableUsage != primitiveUsage) {
- if (!variableUsage.isInput() && !variableUsage.isOutput() && !variableUsage.isPrimitive()) {
- variableUsage = middleUsage;
- }
- assert variableUsage != null;
- setUsage(variable, variableUsage);
- }
- }
- for (ConnectionVariable variable : ((Mapping)rule).getInoutVariables()) {
+ for (MappingParameter variable : ((Mapping)rule).getOwnedParameters()) {
if (variable != null) {
DomainUsage variableUsage = visit(variable.getType());
// if (variableUsage != primitiveUsage) {
@@ -462,7 +451,7 @@ public abstract class AbstractDomainUsageAnalysis extends AbstractExtendingQVTim
}
@Override
- public @NonNull DomainUsage visitGuardVariable(@NonNull GuardVariable object) {
+ public @NonNull DomainUsage visitGuardParameter(@NonNull GuardParameter object) {
return visit(object.getReferredTypedModel());
}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/GuardVariableAttribution.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/GuardParameterAttribution.java
index 327c2ff9c..08572b8f8 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/GuardVariableAttribution.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/GuardParameterAttribution.java
@@ -17,18 +17,18 @@ import org.eclipse.ocl.pivot.internal.scoping.EmptyAttribution;
import org.eclipse.ocl.pivot.internal.scoping.EnvironmentView;
import org.eclipse.ocl.pivot.internal.scoping.ScopeView;
import org.eclipse.ocl.pivot.utilities.ClassUtil;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.GuardParameter;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeTypedModel;
-public class GuardVariableAttribution extends EmptyAttribution
+public class GuardParameterAttribution extends EmptyAttribution
{
- public static final GuardVariableAttribution INSTANCE = new GuardVariableAttribution();
+ public static final GuardParameterAttribution INSTANCE = new GuardParameterAttribution();
@Override
public ScopeView computeLookup(@NonNull EObject target, @NonNull EnvironmentView environmentView, @NonNull ScopeView scopeView) {
- GuardVariable asGuardVariable = (GuardVariable)target;
+ GuardParameter asGuardParameter = (GuardParameter)target;
if (environmentView.getRequiredType() == PivotPackage.Literals.TYPE) { // FIXME should be detecting ancestor
- ImperativeTypedModel asTypedModel = asGuardVariable.getReferredTypedModel();
+ ImperativeTypedModel asTypedModel = asGuardParameter.getReferredTypedModel();
for (org.eclipse.ocl.pivot.@NonNull Package asPackage : ClassUtil.nullFree(asTypedModel.getUsedPackage())) {
environmentView.addAllTypes(asPackage);
}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/MappingAttribution.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/MappingAttribution.java
index 4b79800f3..57b31e6f3 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/MappingAttribution.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/MappingAttribution.java
@@ -76,8 +76,7 @@ public class MappingAttribution extends AbstractAttribution
environmentView.addNamedElement(asStatement);
}
}
- environmentView.addNamedElements(mapping.getOwnedGuardVariables());
- environmentView.addNamedElements(mapping.getInoutVariables());
+ environmentView.addNamedElements(mapping.getOwnedParameters());
Transformation transformation = QVTimperativeUtil.getContainingTransformation(mapping);
if (transformation != null) {
for (TypedModel typedModel : transformation.getModelParameter()) {
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/MappingCallBindingAttribution.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/MappingCallBindingAttribution.java
index 9ca54bd94..82dce18b7 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/MappingCallBindingAttribution.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/MappingCallBindingAttribution.java
@@ -34,8 +34,7 @@ public class MappingCallBindingAttribution extends EmptyAttribution
if (targetReference.getEType() == PivotPackage.Literals.VARIABLE_DECLARATION) {
Mapping referredMapping = mappingCall.getReferredMapping();
if (referredMapping != null) {
- environmentView.addNamedElements(referredMapping.getOwnedGuardVariables());
- environmentView.addNamedElements(referredMapping.getInoutVariables());
+ environmentView.addNamedElements(referredMapping.getOwnedParameters());
}
}
}
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 5093c82e8..98f547178 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
@@ -40,18 +40,19 @@ import org.eclipse.qvtd.pivot.qvtbase.Rule;
import org.eclipse.qvtd.pivot.qvtbase.Transformation;
import org.eclipse.qvtd.pivot.qvtbase.TypedModel;
import org.eclipse.qvtd.pivot.qvtimperative.AddStatement;
+import org.eclipse.qvtd.pivot.qvtimperative.AppendParameter;
import org.eclipse.qvtd.pivot.qvtimperative.CheckStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.GuardParameter;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeModel;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeTypedModel;
-import org.eclipse.qvtd.pivot.qvtimperative.InConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.LoopVariable;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCall;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCallBinding;
import org.eclipse.qvtd.pivot.qvtimperative.MappingLoop;
+import org.eclipse.qvtd.pivot.qvtimperative.MappingParameter;
import org.eclipse.qvtd.pivot.qvtimperative.MappingStatement;
import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ObservableStatement;
@@ -113,6 +114,13 @@ public class QVTiEvaluationVisitor extends BasicEvaluationVisitor implements IQV
}
@Override
+ public Object visitAppendParameter(@NonNull AppendParameter object) {
+ CollectionValue.Accumulator accumulator = ValueUtil.createCollectionAccumulatorValue((CollectionTypeId) object.getTypeId());
+ executor.replace(object, accumulator, false);
+ return true;
+ }
+
+ @Override
public @Nullable Object visitBaseModel(@NonNull BaseModel object) {
return visiting(object);
}
@@ -169,7 +177,7 @@ public class QVTiEvaluationVisitor extends BasicEvaluationVisitor implements IQV
}
@Override
- public @Nullable Object visitGuardVariable(@NonNull GuardVariable object) {
+ public @Nullable Object visitGuardParameter(@NonNull GuardParameter object) {
return visiting(object);
}
@@ -192,13 +200,6 @@ public class QVTiEvaluationVisitor extends BasicEvaluationVisitor implements IQV
}
@Override
- public Object visitInConnectionVariable(@NonNull InConnectionVariable object) {
- CollectionValue.Accumulator accumulator = ValueUtil.createCollectionAccumulatorValue((CollectionTypeId) object.getTypeId());
- executor.replace(object, accumulator, false);
- return true;
- }
-
- @Override
public @Nullable Object visitLoopVariable(@NonNull LoopVariable object) {
return visiting(object);
}
@@ -280,6 +281,11 @@ public class QVTiEvaluationVisitor extends BasicEvaluationVisitor implements IQV
}
@Override
+ public @Nullable Object visitMappingParameter(@NonNull MappingParameter object) {
+ return visiting(object); // MappingParameter is abstract
+ }
+
+ @Override
public @Nullable Object visitMappingStatement(@NonNull MappingStatement object) {
return visitStatement(object); // MappingStatement is abstract
}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/scoping/QVTimperativePivotScoping.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/scoping/QVTimperativePivotScoping.java
index f16d4aa7a..080aa5606 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/scoping/QVTimperativePivotScoping.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/scoping/QVTimperativePivotScoping.java
@@ -15,7 +15,7 @@ import java.util.Map;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.ocl.pivot.internal.scoping.Attribution;
import org.eclipse.qvtd.pivot.qvtimperative.QVTimperativePackage;
-import org.eclipse.qvtd.pivot.qvtimperative.attributes.GuardVariableAttribution;
+import org.eclipse.qvtd.pivot.qvtimperative.attributes.GuardParameterAttribution;
import org.eclipse.qvtd.pivot.qvtimperative.attributes.MappingAttribution;
import org.eclipse.qvtd.pivot.qvtimperative.attributes.MappingCallBindingAttribution;
import org.eclipse.qvtd.pivot.qvtimperative.attributes.MappingLoopAttribution;
@@ -25,7 +25,7 @@ public class QVTimperativePivotScoping
{
public static void init() {
Map<EClassifier, Attribution> registry = Attribution.REGISTRY;
- registry.put(QVTimperativePackage.Literals.GUARD_VARIABLE, GuardVariableAttribution.INSTANCE);
+ registry.put(QVTimperativePackage.Literals.GUARD_PARAMETER, GuardParameterAttribution.INSTANCE);
registry.put(QVTimperativePackage.Literals.MAPPING, MappingAttribution.INSTANCE);
registry.put(QVTimperativePackage.Literals.MAPPING_CALL_BINDING, MappingCallBindingAttribution.INSTANCE);
registry.put(QVTimperativePackage.Literals.MAPPING_LOOP, MappingLoopAttribution.INSTANCE);
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 669fde40b..0f0ec456c 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
@@ -17,14 +17,14 @@ import org.eclipse.ocl.pivot.Type;
import org.eclipse.ocl.pivot.utilities.EnvironmentFactory;
import org.eclipse.qvtd.pivot.qvtbase.utilities.QVTbaseHelper;
import org.eclipse.qvtd.pivot.qvtimperative.AddStatement;
+import org.eclipse.qvtd.pivot.qvtimperative.AppendParameter;
import org.eclipse.qvtd.pivot.qvtimperative.CheckStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement;
+import org.eclipse.qvtd.pivot.qvtimperative.GuardParameter;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeTypedModel;
-import org.eclipse.qvtd.pivot.qvtimperative.InConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.LoopVariable;
import org.eclipse.qvtd.pivot.qvtimperative.OutConnectionVariable;
-import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement;
import org.eclipse.qvtd.pivot.qvtimperative.QVTimperativeFactory;
/**
@@ -43,6 +43,14 @@ public class QVTimperativeHelper extends QVTbaseHelper
return addStatement;
}
+ public @NonNull AppendParameter createAppendParameter(@NonNull String name, @NonNull Type asType, boolean isRequired) {
+ AppendParameter asVariable = QVTimperativeFactory.eINSTANCE.createAppendParameter();
+ asVariable.setName(name);
+ asVariable.setType(asType);
+ asVariable.setIsRequired(isRequired);
+ return asVariable;
+ }
+
public @NonNull CheckStatement createCheckStatement(@NonNull OCLExpression asConditionExpression) {
CheckStatement asPredicate = QVTimperativeFactory.eINSTANCE.createCheckStatement();
asPredicate.setOwnedExpression(asConditionExpression);
@@ -59,8 +67,8 @@ public class QVTimperativeHelper extends QVTbaseHelper
return asVariableStatement;
}
- public @NonNull GuardVariable createGuardVariable(@NonNull String name, @NonNull ImperativeTypedModel typedModel, @NonNull Type type, boolean isRequired) {
- GuardVariable asVariable = QVTimperativeFactory.eINSTANCE.createGuardVariable();
+ public @NonNull GuardParameter createGuardParameter(@NonNull String name, @NonNull ImperativeTypedModel typedModel, @NonNull Type type, boolean isRequired) {
+ GuardParameter asVariable = QVTimperativeFactory.eINSTANCE.createGuardParameter();
asVariable.setName(name);
asVariable.setReferredTypedModel(typedModel);
asVariable.setType(type);
@@ -68,14 +76,6 @@ public class QVTimperativeHelper extends QVTbaseHelper
return asVariable;
}
- public @NonNull InConnectionVariable createInConnectionVariable(@NonNull String name, @NonNull Type asType, boolean isRequired) {
- InConnectionVariable asVariable = QVTimperativeFactory.eINSTANCE.createInConnectionVariable();
- asVariable.setName(name);
- asVariable.setType(asType);
- asVariable.setIsRequired(isRequired);
- return asVariable;
- }
-
public @NonNull LoopVariable createLoopVariable(@NonNull String name, @NonNull Type type) {
LoopVariable asVariable = QVTimperativeFactory.eINSTANCE.createLoopVariable();
asVariable.setName(name);
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativePrettyPrintVisitor.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativePrettyPrintVisitor.java
index f58245cec..931e7eb42 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativePrettyPrintVisitor.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativePrettyPrintVisitor.java
@@ -18,18 +18,19 @@ import org.eclipse.ocl.pivot.internal.prettyprint.PrettyPrinter;
import org.eclipse.qvtd.pivot.qvtbase.Predicate;
import org.eclipse.qvtd.pivot.qvtbase.utilities.QVTbasePrettyPrintVisitor;
import org.eclipse.qvtd.pivot.qvtimperative.AddStatement;
+import org.eclipse.qvtd.pivot.qvtimperative.AppendParameter;
import org.eclipse.qvtd.pivot.qvtimperative.CheckStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.GuardParameter;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeModel;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeTypedModel;
-import org.eclipse.qvtd.pivot.qvtimperative.InConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.LoopVariable;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCall;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCallBinding;
import org.eclipse.qvtd.pivot.qvtimperative.MappingLoop;
+import org.eclipse.qvtd.pivot.qvtimperative.MappingParameter;
import org.eclipse.qvtd.pivot.qvtimperative.MappingStatement;
import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ObservableStatement;
@@ -55,6 +56,19 @@ public class QVTimperativePrettyPrintVisitor extends QVTbasePrettyPrintVisitor i
}
@Override
+ public Object visitAppendParameter(@NonNull AppendParameter asParameter) {
+ context.append("append ");
+ Type type = asParameter.getType();
+ if (type != null) {
+ context.append(" : ");
+ // context.appendQualifiedType(type);
+ context.appendTypedMultiplicity(asParameter);
+ }
+ context.append(";\n");
+ return null;
+ }
+
+ @Override
public Object visitCheckStatement(@NonNull CheckStatement pPredicate) {
context.append("check ");
safeVisit(pPredicate.getOwnedExpression());
@@ -89,14 +103,15 @@ public class QVTimperativePrettyPrintVisitor extends QVTbasePrettyPrintVisitor i
}
@Override
- public Object visitGuardVariable(@NonNull GuardVariable asVariable) {
- context.append("in ");
- context.appendName(asVariable);
- Type type = asVariable.getType();
+ public Object visitGuardParameter(@NonNull GuardParameter asParameter) {
+ context.append("in:");
+ context.appendName(asParameter.getReferredTypedModel());
+ context.append(" ");
+ Type type = asParameter.getType();
if (type != null) {
context.append(" : ");
// context.appendQualifiedType(type);
- context.appendTypedMultiplicity(asVariable);
+ context.appendTypedMultiplicity(asParameter);
}
context.append(";\n");
return null;
@@ -119,11 +134,6 @@ public class QVTimperativePrettyPrintVisitor extends QVTbasePrettyPrintVisitor i
}
@Override
- public Object visitInConnectionVariable(@NonNull InConnectionVariable object) {
- return visitVariableDeclaration(object);
- }
-
- @Override
public Object visitLoopVariable(@NonNull LoopVariable asVariable) {
context.appendName(asVariable);
Type type = asVariable.getType();
@@ -142,17 +152,8 @@ public class QVTimperativePrettyPrintVisitor extends QVTbasePrettyPrintVisitor i
context.appendName(pMapping.getTransformation());
context.append(" {\n");
context.push("", "");
- for (GuardVariable pVariable : pMapping.getOwnedGuardVariables()) {
- context.append("in:");
- context.appendName(pVariable.getReferredTypedModel());
- context.append(" ");
+ for (MappingParameter pVariable : pMapping.getOwnedParameters()) {
safeVisit(pVariable);
- context.append(";\n");
- }
- for (ConnectionVariable pVariable : pMapping.getInoutVariables()) {
- context.append("inout ");
- safeVisit(pVariable);
- context.append(";\n");
}
for (Statement pStatement : pMapping.getOwnedStatements()) {
safeVisit(pStatement);
@@ -204,8 +205,13 @@ public class QVTimperativePrettyPrintVisitor extends QVTbasePrettyPrintVisitor i
}
@Override
+ public Object visitMappingParameter(@NonNull MappingParameter object) {
+ return visiting(object);
+ }
+
+ @Override
public Object visitMappingStatement(@NonNull MappingStatement object) {
- return visitStatement(object);
+ return visiting(object);
}
@Override
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeToStringVisitor.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeToStringVisitor.java
index 4acfe2dd2..615eb0a5f 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeToStringVisitor.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeToStringVisitor.java
@@ -18,18 +18,19 @@ import org.eclipse.ocl.pivot.Type;
import org.eclipse.ocl.pivot.utilities.ToStringVisitor;
import org.eclipse.qvtd.pivot.qvtbase.utilities.QVTbaseToStringVisitor;
import org.eclipse.qvtd.pivot.qvtimperative.AddStatement;
+import org.eclipse.qvtd.pivot.qvtimperative.AppendParameter;
import org.eclipse.qvtd.pivot.qvtimperative.CheckStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.GuardParameter;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeModel;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeTypedModel;
-import org.eclipse.qvtd.pivot.qvtimperative.InConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.LoopVariable;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCall;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCallBinding;
import org.eclipse.qvtd.pivot.qvtimperative.MappingLoop;
+import org.eclipse.qvtd.pivot.qvtimperative.MappingParameter;
import org.eclipse.qvtd.pivot.qvtimperative.MappingStatement;
import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ObservableStatement;
@@ -82,6 +83,18 @@ public class QVTimperativeToStringVisitor extends QVTbaseToStringVisitor impleme
}
@Override
+ public @Nullable String visitAppendParameter(@NonNull AppendParameter asVariable) {
+ append("append ");
+ appendName(asVariable);
+ Type type = asVariable.getType();
+ if (type != null) {
+ append(" : ");
+ appendElementType(asVariable);
+ }
+ return null;
+ }
+
+ @Override
public @Nullable String visitCheckStatement(@NonNull CheckStatement object) {
append("check ");
safeVisit(object.getOwnedExpression());
@@ -121,7 +134,7 @@ public class QVTimperativeToStringVisitor extends QVTbaseToStringVisitor impleme
}
@Override
- public @Nullable String visitGuardVariable(@NonNull GuardVariable asVariable) {
+ public @Nullable String visitGuardParameter(@NonNull GuardParameter asVariable) {
append("in ");
appendName(asVariable);
Type type = asVariable.getType();
@@ -149,18 +162,6 @@ public class QVTimperativeToStringVisitor extends QVTbaseToStringVisitor impleme
}
@Override
- public @Nullable String visitInConnectionVariable(@NonNull InConnectionVariable asVariable) {
- append("in ");
- appendName(asVariable);
- Type type = asVariable.getType();
- if (type != null) {
- append(" : ");
- appendElementType(asVariable);
- }
- return null;
- }
-
- @Override
public @Nullable String visitLoopVariable(@NonNull LoopVariable asVariable) {
appendName(asVariable);
Type type = asVariable.getType();
@@ -219,8 +220,13 @@ public class QVTimperativeToStringVisitor extends QVTbaseToStringVisitor impleme
}
@Override
+ public @Nullable String visitMappingParameter(@NonNull MappingParameter object) {
+ return visiting(object);
+ }
+
+ @Override
public @Nullable String visitMappingStatement(@NonNull MappingStatement object) {
- return visitStatement(object);
+ return visiting(object);
}
@Override
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/GuardVariable.gif b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/GuardParameter.gif
index cb47d00d9..cb47d00d9 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/GuardVariable.gif
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/GuardParameter.gif
Binary files differ
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/src/org/eclipse/qvtd/xtext/qvtimperative/ui/labeling/QVTimperativeLabelProvider.java b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/src/org/eclipse/qvtd/xtext/qvtimperative/ui/labeling/QVTimperativeLabelProvider.java
index ab3063c38..c125a6852 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/src/org/eclipse/qvtd/xtext/qvtimperative/ui/labeling/QVTimperativeLabelProvider.java
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/src/org/eclipse/qvtd/xtext/qvtimperative/ui/labeling/QVTimperativeLabelProvider.java
@@ -28,7 +28,7 @@ import org.eclipse.qvtd.pivot.qvtimperative.AddStatement;
import org.eclipse.qvtd.pivot.qvtimperative.CheckStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.GuardParameter;
import org.eclipse.qvtd.pivot.qvtimperative.LoopVariable;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.xtext.qvtbase.ui.labeling.QVTbaseLabelProvider;
@@ -66,8 +66,8 @@ public class QVTimperativeLabelProvider extends QVTbaseLabelProvider
return QVTIMPERATIVE_UI_ICONS + "DeclareStatement.gif";
}
- protected String image(GuardVariable ele) {
- return "GuardVariable.gif";
+ protected String image(GuardParameter ele) {
+ return "GuardParameter.gif";
}
protected String image(LoopVariable ele) {
@@ -157,7 +157,7 @@ public class QVTimperativeLabelProvider extends QVTbaseLabelProvider
return s.toString();
}
- protected String text(GuardVariable ele) {
+ protected String text(GuardParameter ele) {
assert ele != null;
Namespace namespace = PivotUtil.getNamespace(ele.eContainer());
if (namespace == null) {
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/src/org/eclipse/qvtd/xtext/qvtimperative/ui/outline/QVTimperativeOutlineTreeProvider.java b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/src/org/eclipse/qvtd/xtext/qvtimperative/ui/outline/QVTimperativeOutlineTreeProvider.java
index 22e5a96fe..f08723fb5 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/src/org/eclipse/qvtd/xtext/qvtimperative/ui/outline/QVTimperativeOutlineTreeProvider.java
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/src/org/eclipse/qvtd/xtext/qvtimperative/ui/outline/QVTimperativeOutlineTreeProvider.java
@@ -14,13 +14,12 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.ocl.xtext.basecs.ImportCS;
import org.eclipse.ocl.xtext.basecs.PackageCS;
import org.eclipse.qvtd.pivot.qvtbase.Domain;
-import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement;
import org.eclipse.qvtd.pivot.qvtimperative.LoopVariable;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
import org.eclipse.qvtd.pivot.qvtimperative.MappingLoop;
+import org.eclipse.qvtd.pivot.qvtimperative.MappingParameter;
import org.eclipse.qvtd.pivot.qvtimperative.MappingStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.Statement;
import org.eclipse.qvtd.xtext.qvtbase.ui.outline.QVTbaseOutlineTreeProvider;
@@ -39,10 +38,7 @@ import org.eclipse.xtext.ui.editor.outline.IOutlineNode;
public class QVTimperativeOutlineTreeProvider extends QVTbaseOutlineTreeProvider
{
protected void _createChildren(IOutlineNode parentNode, Mapping ele) {
- for (GuardVariable asVariable : ele.getOwnedGuardVariables()) {
- createNode(parentNode, asVariable);
- }
- for (ConnectionVariable asVariable : ele.getInoutVariables()) {
+ for (MappingParameter asVariable : ele.getOwnedParameters()) {
createNode(parentNode, asVariable);
}
for (Domain asDomain : ele.getDomain()) {
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/as2cs/QVTimperativeDeclarationVisitor.java b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/as2cs/QVTimperativeDeclarationVisitor.java
index 973d8327c..d73bff782 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/as2cs/QVTimperativeDeclarationVisitor.java
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/as2cs/QVTimperativeDeclarationVisitor.java
@@ -69,18 +69,19 @@ import org.eclipse.qvtd.pivot.qvtbase.Transformation;
import org.eclipse.qvtd.pivot.qvtbase.TypedModel;
import org.eclipse.qvtd.pivot.qvtbase.utilities.QVTbaseUtil;
import org.eclipse.qvtd.pivot.qvtimperative.AddStatement;
+import org.eclipse.qvtd.pivot.qvtimperative.AppendParameter;
import org.eclipse.qvtd.pivot.qvtimperative.CheckStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.GuardParameter;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeModel;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeTypedModel;
-import org.eclipse.qvtd.pivot.qvtimperative.InConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.LoopVariable;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCall;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCallBinding;
import org.eclipse.qvtd.pivot.qvtimperative.MappingLoop;
+import org.eclipse.qvtd.pivot.qvtimperative.MappingParameter;
import org.eclipse.qvtd.pivot.qvtimperative.MappingStatement;
import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ObservableStatement;
@@ -95,15 +96,16 @@ import org.eclipse.qvtd.xtext.qvtbasecs.AbstractTransformationCS;
import org.eclipse.qvtd.xtext.qvtbasecs.QVTbaseCSPackage;
import org.eclipse.qvtd.xtext.qvtbasecs.QualifiedPackageCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.AddStatementCS;
+import org.eclipse.qvtd.xtext.qvtimperativecs.AppendParameterCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.CheckStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.DeclareStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.DirectionCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.GuardVariableCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.InoutVariableCS;
+import org.eclipse.qvtd.xtext.qvtimperativecs.GuardParameterCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingCallBindingCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingCallCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingLoopCS;
+import org.eclipse.qvtd.xtext.qvtimperativecs.MappingParameterCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.NewStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.OutVariableCS;
@@ -359,6 +361,14 @@ public class QVTimperativeDeclarationVisitor extends QVTbaseDeclarationVisitor i
}
@Override
+ public ElementCS visitAppendParameter(@NonNull AppendParameter asVariable) {
+ AppendParameterCS csVariable = context.refreshNamedElement(AppendParameterCS.class, QVTimperativeCSPackage.Literals.APPEND_PARAMETER_CS, asVariable);
+ csVariable.setPivot(asVariable);
+ csVariable.setOwnedType(createTypeRefCS(asVariable.getType(), null)); //getScope(asVariable)));
+ return csVariable;
+ }
+
+ @Override
public ElementCS visitBaseModel(@NonNull BaseModel object) {
throw new UnsupportedOperationException();
}
@@ -409,12 +419,12 @@ public class QVTimperativeDeclarationVisitor extends QVTbaseDeclarationVisitor i
}
@Override
- public ElementCS visitGuardVariable(@NonNull GuardVariable asVariable) {
+ public ElementCS visitGuardParameter(@NonNull GuardParameter asVariable) {
ImperativeTypedModel asTypedModel = asVariable.getReferredTypedModel();
org.eclipse.ocl.pivot.Package asUsedPackage = asTypedModel.getUsedPackage().size() > 0 ? asTypedModel.getUsedPackage().get(0) : null;
Mapping containingMapping = QVTimperativeUtil.getContainingMapping(asVariable);
assert containingMapping != null;
- GuardVariableCS csUnrealizedVariable = context.refreshNamedElement(GuardVariableCS.class, QVTimperativeCSPackage.Literals.GUARD_VARIABLE_CS, asVariable);
+ GuardParameterCS csUnrealizedVariable = context.refreshNamedElement(GuardParameterCS.class, QVTimperativeCSPackage.Literals.GUARD_PARAMETER_CS, asVariable);
csUnrealizedVariable.setPivot(asVariable);
csUnrealizedVariable.setReferredTypedModel(asTypedModel);
csUnrealizedVariable.setOwnedType(createTypeRefCS(asVariable.getType(), asUsedPackage));
@@ -514,14 +524,6 @@ public class QVTimperativeDeclarationVisitor extends QVTbaseDeclarationVisitor i
}
@Override
- public ElementCS visitInConnectionVariable(@NonNull InConnectionVariable asVariable) {
- InoutVariableCS csVariable = context.refreshNamedElement(InoutVariableCS.class, QVTimperativeCSPackage.Literals.INOUT_VARIABLE_CS, asVariable);
- csVariable.setPivot(asVariable);
- csVariable.setOwnedType(createTypeRefCS(asVariable.getType(), null)); //getScope(asVariable)));
- return csVariable;
- }
-
- @Override
public ElementCS visitLoopVariable(@NonNull LoopVariable asVariable) {
VariableCS csVariable = context.refreshNamedElement(VariableCS.class, EssentialOCLCSPackage.Literals.VARIABLE_CS, asVariable);
Type type = asVariable.getType();
@@ -548,8 +550,7 @@ public class QVTimperativeDeclarationVisitor extends QVTbaseDeclarationVisitor i
MappingCS csMapping = context.refreshNamedElement(MappingCS.class, QVTimperativeCSPackage.Literals.MAPPING_CS, asMapping);
csMapping.setPivot(asMapping);
refreshOwnedInTransformation(csMapping, asMapping);
- context.refreshList(csMapping.getOwnedGuardVariables(), context.visitDeclarations(GuardVariableCS.class, asMapping.getOwnedGuardVariables(), null));
- context.refreshList(csMapping.getOwnedInoutVariables(), context.visitDeclarations(InoutVariableCS.class, asMapping.getInoutVariables(), null));
+ context.refreshList(csMapping.getOwnedParameters(), context.visitDeclarations(MappingParameterCS.class, asMapping.getOwnedParameters(), null));
context.refreshList(csMapping.getOwnedStatements(), context.visitDeclarations(StatementCS.class, asMapping.getOwnedStatements(), null));
return csMapping;
}
@@ -585,8 +586,13 @@ public class QVTimperativeDeclarationVisitor extends QVTbaseDeclarationVisitor i
}
@Override
+ public ElementCS visitMappingParameter(@NonNull MappingParameter object) {
+ return visiting(object);
+ }
+
+ @Override
public ElementCS visitMappingStatement(@NonNull MappingStatement object) {
- return visitStatement(object);
+ return visiting(object);
}
@Override
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSContainmentVisitor.java b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSContainmentVisitor.java
index 2226176a0..2af1cc10b 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSContainmentVisitor.java
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSContainmentVisitor.java
@@ -40,17 +40,18 @@ import org.eclipse.qvtd.pivot.qvtbase.Transformation;
import org.eclipse.qvtd.pivot.qvtbase.TypedModel;
import org.eclipse.qvtd.pivot.qvtbase.utilities.QVTbaseUtil;
import org.eclipse.qvtd.pivot.qvtimperative.AddStatement;
+import org.eclipse.qvtd.pivot.qvtimperative.AppendParameter;
import org.eclipse.qvtd.pivot.qvtimperative.CheckStatement;
import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.GuardParameter;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeModel;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeTypedModel;
-import org.eclipse.qvtd.pivot.qvtimperative.InConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.LoopVariable;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCall;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCallBinding;
import org.eclipse.qvtd.pivot.qvtimperative.MappingLoop;
+import org.eclipse.qvtd.pivot.qvtimperative.MappingParameter;
import org.eclipse.qvtd.pivot.qvtimperative.MappingStatement;
import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.OutConnectionVariable;
@@ -58,11 +59,11 @@ import org.eclipse.qvtd.pivot.qvtimperative.QVTimperativePackage;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.Statement;
import org.eclipse.qvtd.xtext.qvtimperativecs.AddStatementCS;
+import org.eclipse.qvtd.xtext.qvtimperativecs.AppendParameterCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.CheckStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.DeclareStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.DirectionCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.GuardVariableCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.InoutVariableCS;
+import org.eclipse.qvtd.xtext.qvtimperativecs.GuardParameterCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingCallBindingCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingCallCS;
@@ -94,15 +95,15 @@ public class QVTimperativeCSContainmentVisitor extends AbstractQVTimperativeCSCo
}
}
- public static class GuardVariableCompletion extends SingleContinuation<@NonNull GuardVariableCS>
+ public static class GuardParameterCompletion extends SingleContinuation<@NonNull GuardParameterCS>
{
- public GuardVariableCompletion(@NonNull CS2ASConversion context, @NonNull GuardVariableCS csElement) {
+ public GuardParameterCompletion(@NonNull CS2ASConversion context, @NonNull GuardParameterCS csElement) {
super(context, null, null, csElement);
}
@Override
public BasicContinuation<?> execute() {
- GuardVariable pivotElement = PivotUtil.getPivot(GuardVariable.class, csElement);
+ GuardParameter pivotElement = PivotUtil.getPivot(GuardParameter.class, csElement);
if (pivotElement != null) {
pivotElement.setReferredTypedModel(csElement.getReferredTypedModel());
}
@@ -196,6 +197,12 @@ public class QVTimperativeCSContainmentVisitor extends AbstractQVTimperativeCSCo
}
@Override
+ public Continuation<?> visitAppendParameterCS(@NonNull AppendParameterCS csElement) {
+ refreshNamedElement(AppendParameter.class, QVTimperativePackage.Literals.APPEND_PARAMETER, csElement);
+ return null;
+ }
+
+ @Override
public Continuation<?> visitCheckStatementCS(@NonNull CheckStatementCS csElement) {
context.refreshModelElement(CheckStatement.class, QVTimperativePackage.Literals.CHECK_STATEMENT, csElement);
return null;
@@ -219,22 +226,15 @@ public class QVTimperativeCSContainmentVisitor extends AbstractQVTimperativeCSCo
}
@Override
- public Continuation<?> visitGuardVariableCS(@NonNull GuardVariableCS csElement) {
- refreshNamedElement(GuardVariable.class, QVTimperativePackage.Literals.GUARD_VARIABLE, csElement);
- return new GuardVariableCompletion(context, csElement);
- }
-
- @Override
- public Continuation<?> visitInoutVariableCS(@NonNull InoutVariableCS csElement) {
- refreshNamedElement(InConnectionVariable.class, QVTimperativePackage.Literals.IN_CONNECTION_VARIABLE, csElement);
- return null;
+ public Continuation<?> visitGuardParameterCS(@NonNull GuardParameterCS csElement) {
+ refreshNamedElement(GuardParameter.class, QVTimperativePackage.Literals.GUARD_PARAMETER, csElement);
+ return new GuardParameterCompletion(context, csElement);
}
@Override
public Continuation<?> visitMappingCS(@NonNull MappingCS csElement) {
Mapping pivotElement = refreshNamedElement(Mapping.class, QVTimperativePackage.Literals.MAPPING, csElement);
- context.refreshPivotList(GuardVariable.class, pivotElement.getOwnedGuardVariables(), csElement.getOwnedGuardVariables());
- context.refreshPivotList(InConnectionVariable.class, pivotElement.getInoutVariables(), csElement.getOwnedInoutVariables());
+ context.refreshPivotList(MappingParameter.class, pivotElement.getOwnedParameters(), csElement.getOwnedParameters());
context.refreshPivotList(Statement.class, pivotElement.getOwnedStatements(), csElement.getOwnedStatements());
return null;
}
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 90439d971..2f15f81ff 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
@@ -30,7 +30,7 @@ import org.eclipse.qvtd.pivot.qvtbase.Function;
import org.eclipse.qvtd.pivot.qvtimperative.AddStatement;
import org.eclipse.qvtd.pivot.qvtimperative.CheckStatement;
import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.GuardParameter;
import org.eclipse.qvtd.pivot.qvtimperative.LoopVariable;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCallBinding;
import org.eclipse.qvtd.pivot.qvtimperative.MappingLoop;
@@ -41,7 +41,7 @@ import org.eclipse.qvtd.xtext.qvtimperativecs.AddStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.CheckStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.DeclareStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.DirectionCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.GuardVariableCS;
+import org.eclipse.qvtd.xtext.qvtimperativecs.GuardParameterCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingCallBindingCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingLoopCS;
@@ -181,10 +181,10 @@ public class QVTimperativeCSPostOrderVisitor extends AbstractQVTimperativeCSPost
}
@Override
- public Continuation<?> visitGuardVariableCS(@NonNull GuardVariableCS csElement) {
- GuardVariable asGuardVariable = PivotUtil.getPivot(GuardVariable.class, csElement);
- if (asGuardVariable != null) {
- asGuardVariable.setReferredTypedModel(csElement.getReferredTypedModel());
+ public Continuation<?> visitGuardParameterCS(@NonNull GuardParameterCS csElement) {
+ GuardParameter asGuardParameter = PivotUtil.getPivot(GuardParameter.class, csElement);
+ if (asGuardParameter != null) {
+ asGuardParameter.setReferredTypedModel(csElement.getReferredTypedModel());
}
return null;
}
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPreOrderVisitor.java b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPreOrderVisitor.java
index e4db4c055..a863e4425 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPreOrderVisitor.java
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPreOrderVisitor.java
@@ -35,9 +35,9 @@ import org.eclipse.ocl.xtext.essentialoclcs.VariableCS;
import org.eclipse.qvtd.pivot.qvtbase.Function;
import org.eclipse.qvtd.pivot.qvtbase.FunctionParameter;
import org.eclipse.qvtd.pivot.qvtbase.Transformation;
+import org.eclipse.qvtd.pivot.qvtimperative.AppendParameter;
import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable;
-import org.eclipse.qvtd.pivot.qvtimperative.InConnectionVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.GuardParameter;
import org.eclipse.qvtd.pivot.qvtimperative.LoopVariable;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCall;
@@ -48,11 +48,11 @@ import org.eclipse.qvtd.pivot.qvtimperative.ObservableStatement;
import org.eclipse.qvtd.pivot.qvtimperative.OutConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.QVTimperativePackage;
import org.eclipse.qvtd.xtext.qvtimperativecs.AddStatementCS;
+import org.eclipse.qvtd.xtext.qvtimperativecs.AppendParameterCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.CheckStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.DeclareStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.DirectionCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.GuardVariableCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.InoutVariableCS;
+import org.eclipse.qvtd.xtext.qvtimperativecs.GuardParameterCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingCallBindingCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingCallCS;
@@ -68,15 +68,15 @@ import org.eclipse.qvtd.xtext.qvtimperativecs.util.AbstractQVTimperativeCSPreOrd
public class QVTimperativeCSPreOrderVisitor extends AbstractQVTimperativeCSPreOrderVisitor
{
- public static class DeclareStatementCompletion extends SingleContinuation<@NonNull DeclareStatementCS>
+ public static class AppendParameterCompletion extends SingleContinuation<@NonNull AppendParameterCS>
{
- public DeclareStatementCompletion(@NonNull CS2ASConversion context, @NonNull DeclareStatementCS csElement) {
+ public AppendParameterCompletion(@NonNull CS2ASConversion context, @NonNull AppendParameterCS csElement) {
super(context, null, null, csElement, createDependencies(csElement.getOwnedType()));
}
@Override
public BasicContinuation<?> execute() {
- DeclareStatement pivotElement = PivotUtil.getPivot(DeclareStatement.class, csElement);
+ AppendParameter pivotElement = PivotUtil.getPivot(AppendParameter.class, csElement);
if (pivotElement != null) {
context.refreshRequiredType(pivotElement, csElement);
}
@@ -84,15 +84,15 @@ public class QVTimperativeCSPreOrderVisitor extends AbstractQVTimperativeCSPreOr
}
}
- public static class GuardVariableCompletion extends SingleContinuation<@NonNull GuardVariableCS>
+ public static class DeclareStatementCompletion extends SingleContinuation<@NonNull DeclareStatementCS>
{
- public GuardVariableCompletion(@NonNull CS2ASConversion context, @NonNull GuardVariableCS csElement) {
+ public DeclareStatementCompletion(@NonNull CS2ASConversion context, @NonNull DeclareStatementCS csElement) {
super(context, null, null, csElement, createDependencies(csElement.getOwnedType()));
}
@Override
public BasicContinuation<?> execute() {
- GuardVariable pivotElement = PivotUtil.getPivot(GuardVariable.class, csElement);
+ DeclareStatement pivotElement = PivotUtil.getPivot(DeclareStatement.class, csElement);
if (pivotElement != null) {
context.refreshRequiredType(pivotElement, csElement);
}
@@ -100,15 +100,15 @@ public class QVTimperativeCSPreOrderVisitor extends AbstractQVTimperativeCSPreOr
}
}
- public static class InoutVariableCompletion extends SingleContinuation<@NonNull InoutVariableCS>
+ public static class GuardParameterCompletion extends SingleContinuation<@NonNull GuardParameterCS>
{
- public InoutVariableCompletion(@NonNull CS2ASConversion context, @NonNull InoutVariableCS csElement) {
+ public GuardParameterCompletion(@NonNull CS2ASConversion context, @NonNull GuardParameterCS csElement) {
super(context, null, null, csElement, createDependencies(csElement.getOwnedType()));
}
@Override
public BasicContinuation<?> execute() {
- InConnectionVariable pivotElement = PivotUtil.getPivot(InConnectionVariable.class, csElement);
+ GuardParameter pivotElement = PivotUtil.getPivot(GuardParameter.class, csElement);
if (pivotElement != null) {
context.refreshRequiredType(pivotElement, csElement);
}
@@ -275,6 +275,11 @@ public class QVTimperativeCSPreOrderVisitor extends AbstractQVTimperativeCSPreOr
}
@Override
+ public @Nullable Continuation<?> visitAppendParameterCS(@NonNull AppendParameterCS csElement) {
+ return new AppendParameterCompletion(context, csElement);
+ }
+
+ @Override
public Continuation<?> visitCheckStatementCS(@NonNull CheckStatementCS csElement) {
refreshObservedProperties(csElement, csElement.getObservedProperties());
return null;
@@ -292,13 +297,8 @@ public class QVTimperativeCSPreOrderVisitor extends AbstractQVTimperativeCSPreOr
}
@Override
- public @Nullable Continuation<?> visitGuardVariableCS(@NonNull GuardVariableCS csElement) {
- return new GuardVariableCompletion(context, csElement);
- }
-
- @Override
- public @Nullable Continuation<?> visitInoutVariableCS(@NonNull InoutVariableCS csElement) {
- return new InoutVariableCompletion(context, csElement);
+ public @Nullable Continuation<?> visitGuardParameterCS(@NonNull GuardParameterCS csElement) {
+ return new GuardParameterCompletion(context, csElement);
}
@Override
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/formatting/QVTimperativeFormatter.java b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/formatting/QVTimperativeFormatter.java
index 14d509542..7f351f54c 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/formatting/QVTimperativeFormatter.java
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/formatting/QVTimperativeFormatter.java
@@ -13,12 +13,12 @@ package org.eclipse.qvtd.xtext.qvtimperative.formatting;
import org.eclipse.ocl.xtext.essentialocl.formatting.AbstractEssentialOCLFormatter;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.AddStatementCSElements;
+import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.AppendParameterCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.CheckStatementCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.DeclareStatementCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.DirectionCSElements;
-import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.GuardVariableCSElements;
+import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.GuardParameterCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.ImportCSElements;
-import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.InoutVariableCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.MappingCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.MappingCallBindingCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.MappingCallCSElements;
@@ -83,6 +83,11 @@ public class QVTimperativeFormatter extends AbstractEssentialOCLFormatter
c.setNoSpace().before(a.getSemicolonKeyword_5());
}
{
+ AppendParameterCSElements a = f.getAppendParameterCSAccess();
+ c.setLinewrap(1).before(a.getGroup());
+ c.setNoSpace().before(a.getSemicolonKeyword_4());
+ }
+ {
CheckStatementCSElements a = f.getCheckStatementCSAccess();
c.setLinewrap(1).before(a.getGroup());
c.setNoSpace().before(a.getSemicolonKeyword_2());
@@ -101,7 +106,7 @@ public class QVTimperativeFormatter extends AbstractEssentialOCLFormatter
c.setNoSpace().before(a.getCommaKeyword_5_0());
}
{
- GuardVariableCSElements a = f.getGuardVariableCSAccess();
+ GuardParameterCSElements a = f.getGuardParameterCSAccess();
c.setLinewrap(1).before(a.getGroup());
c.setNoSpace().around(a.getColonKeyword_1());
c.setNoSpace().before(a.getSemicolonKeyword_6());
@@ -111,11 +116,6 @@ public class QVTimperativeFormatter extends AbstractEssentialOCLFormatter
setNoSpaceLineWrap(c, a.getSemicolonKeyword_4());
}
{
- InoutVariableCSElements a = f.getInoutVariableCSAccess();
- c.setLinewrap(1).before(a.getGroup());
- c.setNoSpace().before(a.getSemicolonKeyword_4());
- }
- {
MappingCSElements a = f.getMappingCSAccess();
c.setLinewrap(2).before(a.getGroup());
c.setNoSpace().between(a.getLeftCurlyBracketKeyword_4(), a.getRightCurlyBracketKeyword_9());
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/utilities/QVTimperativeCSResource.java b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/utilities/QVTimperativeCSResource.java
index 82c2f771b..416e4238e 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/utilities/QVTimperativeCSResource.java
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/utilities/QVTimperativeCSResource.java
@@ -30,10 +30,9 @@ import org.eclipse.ocl.xtext.essentialocl.utilities.EssentialOCLCSResource;
import org.eclipse.qvtd.pivot.qvtbase.FunctionParameter;
import org.eclipse.qvtd.pivot.qvtbase.Transformation;
import org.eclipse.qvtd.pivot.qvtbase.TypedModel;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable;
-import org.eclipse.qvtd.pivot.qvtimperative.InConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.LoopVariable;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
+import org.eclipse.qvtd.pivot.qvtimperative.MappingParameter;
import org.eclipse.qvtd.pivot.qvtimperative.QVTimperativePackage;
import org.eclipse.qvtd.pivot.qvtimperative.VariableStatement;
import org.eclipse.qvtd.pivot.qvtimperative.evaluation.QVTiEnvironmentFactory;
@@ -94,11 +93,8 @@ public class QVTimperativeCSResource extends EssentialOCLCSResource
else if (element instanceof VariableStatement) { // NewStatement, PredicateVariable, OutConnectionVariable
return (VariableStatement)element;
}
- else if (element instanceof InConnectionVariable) {
- return (InConnectionVariable)element;
- }
- else if (element instanceof GuardVariable) {
- return (GuardVariable)element;
+ else if (element instanceof MappingParameter) {
+ return (MappingParameter)element;
}
else if (element instanceof LoopVariable) {
return (LoopVariable)element;

Back to the top