Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-09-09 16:14:56 +0000
committerEd Willink2016-09-19 11:18:15 +0000
commit6d4ce13074847d6d510e8291b9d0db53a4af4ccf (patch)
tree32fb46106ce91192f6329ff7c12b246ad9d1878d
parenta42ae1f9fe887761f8e9c4f198f94b67e1c6f9e3 (diff)
downloadorg.eclipse.qvtd-6d4ce13074847d6d510e8291b9d0db53a4af4ccf.tar.gz
org.eclipse.qvtd-6d4ce13074847d6d510e8291b9d0db53a4af4ccf.tar.xz
org.eclipse.qvtd-6d4ce13074847d6d510e8291b9d0db53a4af4ccf.zip
[500369] Support NewStatement
-rw-r--r--plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java57
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicRegion2Mapping.java15
-rw-r--r--plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/stepper/AbstractQVTimperativeStepperVisitor.java2
-rw-r--r--plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/stepper/QVTiStepperVisitor.java6
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/analysis/AbstractDomainUsageAnalysis.java15
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/MappingAttribution.java11
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/QVTimperativeEnvironmentUtil.java20
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/BasicQVTiExecutor.java78
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEvaluationVisitor.java12
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEvaluationVisitorDecorator.java14
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiExecutor.java4
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiIncrementalExecutor.java6
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeAS2XMIidVisitor.java26
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeASSaverNormalizeVisitor.java3
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeHelper.java11
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativePrettyPrintVisitor.java17
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeToStringVisitor.java14
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeUtil.java15
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/src/org/eclipse/qvtd/xtext/qvtimperative/ui/labeling/QVTimperativeLabelProvider.java20
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/src/org/eclipse/qvtd/xtext/qvtimperative/ui/outline/QVTimperativeOutlineTreeProvider.java17
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/as2cs/QVTimperativeDeclarationVisitor.java22
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSContainmentVisitor.java32
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPostOrderVisitor.java73
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSPreOrderVisitor.java22
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/formatting/QVTimperativeFormatter.java13
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/utilities/QVTimperativeCSResource.java6
26 files changed, 290 insertions, 241 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 38f651f3b..4edc27aae 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
@@ -117,7 +117,7 @@ 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.MappingStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.RealizedVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.Statement;
import org.eclipse.qvtd.pivot.qvtimperative.VariableAssignment;
@@ -308,7 +308,7 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit
}
public void doBottoms(@NonNull CGMappingExp cgMappingExp) {
- List<@NonNull BottomPattern> pBottomPatterns = new ArrayList<@NonNull BottomPattern>();
+ List<@NonNull BottomPattern> pBottomPatterns = new ArrayList<>();
{
BottomPattern pBottomPattern = asMapping.getBottomPattern();
if (pBottomPattern != null) {
@@ -367,22 +367,23 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit
appendSubTree(doVisit(CGValuedElement.class, asPredicate));
}
}
- List<@NonNull RealizedVariable> pRealizedVariables = new ArrayList<@NonNull RealizedVariable>();
- for (@NonNull BottomPattern pBottomPattern : pBottomPatterns) {
- for (@NonNull RealizedVariable asRealizedVariable : ClassUtil.nullFree(pBottomPattern.getRealizedVariable())) {
- OCLExpression asInit = asRealizedVariable.getOwnedInit();
+ List<@NonNull NewStatement> asNewStatements = new ArrayList<>();
+ for (@NonNull Statement asStatement : ClassUtil.nullFree(asMapping.getOwnedStatements())) {
+ if (asStatement instanceof NewStatement) {
+ NewStatement asNewStatement = (NewStatement) asStatement;
+ OCLExpression asInit = asNewStatement.getOwnedInit();
if (asInit == null) {
- pRealizedVariables.add(asRealizedVariable);
+ asNewStatements.add(asNewStatement);
}
else {
- appendCheckedLetVariable(asRealizedVariable, asInit);
+ appendCheckedLetVariable(asNewStatement, asInit);
}
}
}
- Collections.sort(pRealizedVariables, NameUtil.NAMEABLE_COMPARATOR);
+ Collections.sort(asNewStatements, NameUtil.NAMEABLE_COMPARATOR);
List<@NonNull CGValuedElement> cgRealizedVariables = ClassUtil.nullFree(cgMappingExp.getRealizedVariables());
- for (@NonNull RealizedVariable pRealizedVariable : pRealizedVariables) {
- CGRealizedVariable cgVariable = getRealizedVariable(pRealizedVariable);
+ for (@NonNull NewStatement asNewStatement : asNewStatements) {
+ CGRealizedVariable cgVariable = getRealizedVariable(asNewStatement);
cgRealizedVariables.add(cgVariable);
}
for (@NonNull BottomPattern pBottomPattern : pBottomPatterns) {
@@ -647,12 +648,12 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit
return cgGuardVariable;
}
- public @NonNull CGRealizedVariable getRealizedVariable(@NonNull RealizedVariable pRealizedVariable) {
+ public @NonNull CGRealizedVariable getRealizedVariable(@NonNull NewStatement pNewStatement) {
Variables variablesStack = getVariablesStack();
- CGVariable cgVariable2 = variablesStack.getVariable(pRealizedVariable);
+ CGVariable cgVariable2 = variablesStack.getVariable(pNewStatement);
CGRealizedVariable cgVariable = (CGRealizedVariable) cgVariable2;
if (cgVariable == null) {
- EClassifier eClassifier = getEClassifier(pRealizedVariable.getType());
+ EClassifier eClassifier = getEClassifier(pNewStatement.getType());
if (eClassifier != null) {
CGEcoreRealizedVariable cgEcoreRealizedVariable = QVTiCGModelFactory.eINSTANCE.createCGEcoreRealizedVariable();
cgEcoreRealizedVariable.setEClassifier(eClassifier);
@@ -661,9 +662,11 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit
if (cgVariable == null) {
cgVariable = QVTiCGModelFactory.eINSTANCE.createCGRealizedVariable();
}
- setAst(cgVariable, pRealizedVariable);
- cgVariable.setTypedModel(getTypedModel(pRealizedVariable));
- variablesStack.putVariable(pRealizedVariable, cgVariable);
+ setAst(cgVariable, pNewStatement);
+ TypedModel asTypedModel = ClassUtil.nonNullState(pNewStatement.getReferredTypedModel());
+ CGTypedModel cgTypedModel = ClassUtil.nonNullState(analyzer.getTypedModel(asTypedModel));
+ cgVariable.setTypedModel(cgTypedModel);
+ variablesStack.putVariable(pNewStatement, cgVariable);
}
return cgVariable;
}
@@ -810,8 +813,10 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit
CGSequence cgSequence = QVTiCGModelFactory.eINSTANCE.createCGSequence();
List<CGValuedElement> cgMappingStatements = cgSequence.getStatements();
for (Statement asStatement : pMapping.getOwnedStatements()) {
- CGValuedElement cgMappingStatement = doVisit(CGValuedElement.class, asStatement);
- cgMappingStatements.add(cgMappingStatement);
+ if (!(asStatement instanceof NewStatement)) { // FIXME
+ CGValuedElement cgMappingStatement = doVisit(CGValuedElement.class, asStatement);
+ cgMappingStatements.add(cgMappingStatement);
+ }
}
cgMappingExp.setBody(cgSequence);
List<CGGuardVariable> cgFreeVariables = cgMapping.getFreeVariables();
@@ -889,6 +894,13 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit
}
@Override
+ public @Nullable CGNamedElement visitNewStatement(@NonNull NewStatement object) {
+ // CGExecutorType cgExecutorType = analyzer.createExecutorType(pTypeExp.getReferredType());
+ // cgTypeExp.setExecutorType(cgExecutorType);
+ return visiting(object);
+ }
+
+ @Override
public @Nullable CGNamedElement visitPattern(@NonNull Pattern object) {
return visiting(object);
}
@@ -933,13 +945,6 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit
} */
@Override
- public @Nullable CGNamedElement visitRealizedVariable(@NonNull RealizedVariable object) {
- // CGExecutorType cgExecutorType = analyzer.createExecutorType(pTypeExp.getReferredType());
- // cgTypeExp.setExecutorType(cgExecutorType);
- return visiting(object);
- }
-
- @Override
public @Nullable CGNamedElement visitRule(@NonNull Rule object) {
return visiting(object);
}
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 6e7b52287..d7be00a8a 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
@@ -92,7 +92,7 @@ import org.eclipse.qvtd.pivot.qvtimperative.ImperativeDomain;
import org.eclipse.qvtd.pivot.qvtimperative.GuardPattern;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCallBinding;
import org.eclipse.qvtd.pivot.qvtimperative.MappingStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.RealizedVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.VariableAssignment;
import org.eclipse.qvtd.pivot.qvtimperative.util.AbstractExtendingQVTimperativeVisitor;
@@ -310,7 +310,7 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
for (TreeIterator<EObject> tit = oclExpression.eAllContents(); tit.hasNext(); ) {
EObject eObject = tit.next();
if (eObject instanceof VariableExp) {
- if (((VariableExp)eObject).getReferredVariable() instanceof RealizedVariable) {
+ if (((VariableExp)eObject).getReferredVariable() instanceof NewStatement) {
return true;
}
}
@@ -1203,11 +1203,12 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
}
}
ClassDatumAnalysis classDatumAnalysis = newNode.getClassDatumAnalysis();
- BottomPattern bottomPattern = getArea(classDatumAnalysis).getBottomPattern();
- RealizedVariable realizedVariable = QVTimperativeUtil.createRealizedVariable(getSafeName(newNode), classDatumAnalysis.getCompleteClass().getPrimaryClass());
- realizedVariable.setOwnedInit(constructor);
- bottomPattern.getRealizedVariable().add(realizedVariable);
- Variable oldVariable = node2variable.put(newNode, realizedVariable);
+ TypedModel pTypedModel = classDatumAnalysis.getTypedModel();
+ TypedModel iTypedModel = ClassUtil.nonNullState(visitor.getQVTiTypedModel(pTypedModel));
+ NewStatement newStatement = QVTimperativeUtil.createNewStatement(getSafeName(newNode), iTypedModel, classDatumAnalysis.getCompleteClass().getPrimaryClass());
+ newStatement.setOwnedInit(constructor);
+ mapping.getOwnedStatements().add(newStatement);
+ Variable oldVariable = node2variable.put(newNode, newStatement);
assert oldVariable == null;
}
}
diff --git a/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/stepper/AbstractQVTimperativeStepperVisitor.java b/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/stepper/AbstractQVTimperativeStepperVisitor.java
index 953376c00..33c269009 100644
--- a/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/stepper/AbstractQVTimperativeStepperVisitor.java
+++ b/plugins/org.eclipse.qvtd.debug/src/org/eclipse/qvtd/debug/stepper/AbstractQVTimperativeStepperVisitor.java
@@ -101,7 +101,7 @@ implements QVTimperativeVisitor<IStepper>
}
@Override
- public @Nullable IStepper visitRealizedVariable(org.eclipse.qvtd.pivot.qvtimperative.@NonNull RealizedVariable object) {
+ public @Nullable IStepper visitNewStatement(org.eclipse.qvtd.pivot.qvtimperative.@NonNull NewStatement object) {
return visitVariable(object);
}
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 6e2eedc5d..57ffe3474 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
@@ -29,7 +29,7 @@ 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.MappingStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.RealizedVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.Statement;
public class QVTiStepperVisitor extends AbstractQVTimperativeStepperVisitor
@@ -101,12 +101,12 @@ public class QVTiStepperVisitor extends AbstractQVTimperativeStepperVisitor
}
@Override
- public @Nullable IStepper visitPredicate(@NonNull Predicate object) {
+ public @Nullable IStepper visitNewStatement(@NonNull NewStatement object) {
return NonStepper.INSTANCE;
}
@Override
- public @Nullable IStepper visitRealizedVariable(@NonNull RealizedVariable object) {
+ public @Nullable IStepper visitPredicate(@NonNull Predicate object) {
return NonStepper.INSTANCE;
}
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 9df1ebe27..2c8a2e31d 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
@@ -83,7 +83,7 @@ import org.eclipse.qvtd.pivot.qvtimperative.BottomPattern;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeDomain;
import org.eclipse.qvtd.pivot.qvtimperative.GuardPattern;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
-import org.eclipse.qvtd.pivot.qvtimperative.RealizedVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.VariableAssignment;
import org.eclipse.qvtd.pivot.qvtimperative.util.AbstractExtendingQVTimperativeVisitor;
@@ -365,9 +365,6 @@ public abstract class AbstractDomainUsageAnalysis extends AbstractExtendingQVTim
for (Variable variable : object.getVariable()) {
visit(variable);
}
- for (RealizedVariable variable : object.getRealizedVariable()) {
- visit(variable);
- }
for (Assignment assignment : object.getAssignment()) {
visit(assignment);
}
@@ -570,6 +567,11 @@ public abstract class AbstractDomainUsageAnalysis extends AbstractExtendingQVTim
}
@Override
+ public @NonNull DomainUsage visitNewStatement(@NonNull NewStatement object) {
+ return visit(object.getReferredTypedModel());
+ }
+
+ @Override
public @NonNull DomainUsage visitNullLiteralExp(@NonNull NullLiteralExp object) {
return getRootAnalysis().createVariableUsage(getRootAnalysis().getAnyMask());
}
@@ -743,11 +745,6 @@ public abstract class AbstractDomainUsageAnalysis extends AbstractExtendingQVTim
}
@Override
- public @NonNull DomainUsage visitRealizedVariable(@NonNull RealizedVariable object) {
- return getDomainUsage(object);
- }
-
- @Override
public @NonNull DomainUsage visitRule(@NonNull Rule object) {
for (Domain domain : object.getDomain()) {
visit(domain);
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 41bd8a5f2..9c805bccb 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
@@ -19,7 +19,9 @@ import org.eclipse.qvtd.pivot.qvtbase.QVTbasePackage;
import org.eclipse.qvtd.pivot.qvtbase.Transformation;
import org.eclipse.qvtd.pivot.qvtbase.TypedModel;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.QVTimperativePackage;
+import org.eclipse.qvtd.pivot.qvtimperative.Statement;
import org.eclipse.qvtd.pivot.qvtimperative.utilities.QVTimperativeUtil;
public class MappingAttribution extends AbstractAttribution
@@ -34,6 +36,15 @@ public class MappingAttribution extends AbstractAttribution
}
Mapping mapping = (Mapping)target;
if (scopeView.getContainmentFeature() == QVTimperativePackage.Literals.MAPPING__OWNED_STATEMENTS) {
+ EObject child = scopeView.getChild();
+ for (Statement asStatement : mapping.getOwnedStatements()) {
+ if (asStatement == child) {
+ break;
+ }
+ if (asStatement instanceof NewStatement) {
+ environmentView.addNamedElement(asStatement);
+ }
+ }
QVTimperativeEnvironmentUtil.addMiddleGuardVariables(environmentView, mapping);
QVTimperativeEnvironmentUtil.addSideGuardVariables(environmentView, mapping, null);
QVTimperativeEnvironmentUtil.addMiddleBottomVariables(environmentView, mapping);
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/QVTimperativeEnvironmentUtil.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/QVTimperativeEnvironmentUtil.java
index b3f505f75..4fc0fd539 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/QVTimperativeEnvironmentUtil.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/attributes/QVTimperativeEnvironmentUtil.java
@@ -19,6 +19,8 @@ import org.eclipse.qvtd.pivot.qvtimperative.BottomPattern;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeDomain;
import org.eclipse.qvtd.pivot.qvtimperative.GuardPattern;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
+import org.eclipse.qvtd.pivot.qvtimperative.Statement;
public class QVTimperativeEnvironmentUtil
{
@@ -38,9 +40,13 @@ public class QVTimperativeEnvironmentUtil
if (bottomToo) {
BottomPattern bottomPattern = mapping.getBottomPattern();
if (bottomPattern != null) {
- environmentView.addNamedElements(bottomPattern.getRealizedVariable());
environmentView.addNamedElements(bottomPattern.getVariable());
}
+ for (Statement asStatement : mapping.getOwnedStatements()) {
+ if (asStatement instanceof NewStatement) {
+ environmentView.addNamedElement(asStatement);
+ }
+ }
}
GuardPattern guardPattern = mapping.getGuardPattern();
if (guardPattern != null) {
@@ -52,9 +58,13 @@ public class QVTimperativeEnvironmentUtil
if (bottomToo) {
BottomPattern bottomPattern = domain.getBottomPattern();
if (bottomPattern != null) {
- environmentView.addNamedElements(bottomPattern.getRealizedVariable());
environmentView.addNamedElements(bottomPattern.getVariable());
}
+ for (Statement asStatement : mapping.getOwnedStatements()) {
+ if (asStatement instanceof NewStatement) {
+ environmentView.addNamedElement(asStatement);
+ }
+ }
}
guardPattern = domain.getGuardPattern();
if (guardPattern != null) {
@@ -84,9 +94,13 @@ public class QVTimperativeEnvironmentUtil
if (bottomToo) {
BottomPattern bottomPattern = domain.getBottomPattern();
if (bottomPattern != null) {
- environmentView.addNamedElements(bottomPattern.getRealizedVariable());
environmentView.addNamedElements(bottomPattern.getVariable());
}
+ for (Statement asStatement : mapping.getOwnedStatements()) {
+ if (asStatement instanceof NewStatement) {
+ environmentView.addNamedElement(asStatement);
+ }
+ }
}
GuardPattern guardPattern = domain.getGuardPattern();
if (guardPattern != null) {
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/BasicQVTiExecutor.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/BasicQVTiExecutor.java
index 9ed5e3766..00ae2d915 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/BasicQVTiExecutor.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/BasicQVTiExecutor.java
@@ -54,7 +54,6 @@ 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.qvtbase.utilities.QVTbaseUtil;
-import org.eclipse.qvtd.pivot.qvtimperative.Area;
import org.eclipse.qvtd.pivot.qvtimperative.Assignment;
import org.eclipse.qvtd.pivot.qvtimperative.BottomPattern;
import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
@@ -63,7 +62,7 @@ import org.eclipse.qvtd.pivot.qvtimperative.ImperativeDomain;
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.RealizedVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.Statement;
import org.eclipse.qvtd.pivot.qvtimperative.VariableAssignment;
@@ -141,34 +140,6 @@ public class BasicQVTiExecutor extends AbstractExecutor implements QVTiExecutor
protected void doCommits(@NonNull Mapping mapping, @NonNull EvaluationVisitor undecoratedVisitor) {
//
- // creations
- //
- for (Domain domain : mapping.getDomain()) {
- if (domain.isIsEnforceable()) {
- ImperativeDomain enforceableDomain = (ImperativeDomain)domain;
- BottomPattern enforceableBottomPattern = enforceableDomain.getBottomPattern();
- for (RealizedVariable realizedVariable : enforceableBottomPattern.getRealizedVariable()) {
- OCLExpression ownedInit = realizedVariable.getOwnedInit();
- if (ownedInit != null) {
- Object initValue = ownedInit.accept(undecoratedVisitor);
- getEvaluationEnvironment().add(realizedVariable, initValue);
- replace(realizedVariable, initValue);
- Area area = ((BottomPattern)realizedVariable.eContainer()).getArea();
- TypedModel typedModel = QVTimperativeUtil.getTypedModel(area);
- assert typedModel != null;
- Object ecoreValue = getIdResolver().ecoreValueOf(null, initValue);
- assert ecoreValue != null;
- getModelManager().addModelElement(typedModel, ecoreValue);
- }
- }
- for (RealizedVariable realizedVariable : enforceableBottomPattern.getRealizedVariable()) {
- if (realizedVariable.getOwnedInit() == null) {
- realizedVariable.accept(undecoratedVisitor);
- }
- }
- }
- }
- //
// property and connection assignments
//
BottomPattern middleBottomPattern = mapping.getBottomPattern();
@@ -200,7 +171,6 @@ public class BasicQVTiExecutor extends AbstractExecutor implements QVTiExecutor
BottomPattern checkableBottomPattern = checkableDomain.getBottomPattern();
assert checkableBottomPattern.getAssignment().isEmpty();
assert checkableBottomPattern.getPredicate().isEmpty();
- assert checkableBottomPattern.getRealizedVariable().isEmpty();
// assert checkableBottomPattern.getVariable().isEmpty();
for (@NonNull Variable rVar : ClassUtil.nullFree(checkableBottomPattern.getVariable())) {
OCLExpression ownedInit = rVar.getOwnedInit();
@@ -224,7 +194,6 @@ public class BasicQVTiExecutor extends AbstractExecutor implements QVTiExecutor
}
}
BottomPattern middleBottomPattern = mapping.getBottomPattern();
- assert middleBottomPattern.getRealizedVariable().isEmpty();
//
// variable declarations/initializations
//
@@ -448,22 +417,35 @@ public class BasicQVTiExecutor extends AbstractExecutor implements QVTiExecutor
}
@Override
- public @Nullable Object internalExecuteRealizedVariable(@NonNull RealizedVariable realizedVariable, @NonNull EvaluationVisitor undecoratedVisitor) {
- // Realized variables are in the mapping's target bottom pattern
- // and create elements in the target model. The realized variables
- // are being visited for each binding of variable in the mapping.
- Type type = realizedVariable.getType();
- if (!(type instanceof org.eclipse.ocl.pivot.Class)) {
- return null;
- }
- Area area = ((BottomPattern)realizedVariable.eContainer()).getArea();
- TypedModel typedModel = QVTimperativeUtil.getTypedModel(area);
- assert typedModel != null;
- Object element = ((org.eclipse.ocl.pivot.Class)type).createInstance();
- // Add the realize variable binding to the environment
- replace(realizedVariable, element, false);
- getModelManager().addModelElement(typedModel, element);
- return element;
+ public @Nullable Object internalExecuteNewStatement(@NonNull NewStatement newStatement, @NonNull EvaluationVisitor undecoratedVisitor) {
+ OCLExpression ownedInit = newStatement.getOwnedInit();
+ if (ownedInit != null) {
+ Object initValue = ownedInit.accept(undecoratedVisitor);
+ getEvaluationEnvironment().add(newStatement, initValue);
+ replace(newStatement, initValue);
+ TypedModel typedModel = newStatement.getReferredTypedModel();
+ assert typedModel != null;
+ Object ecoreValue = getIdResolver().ecoreValueOf(null, initValue);
+ assert ecoreValue != null;
+ getModelManager().addModelElement(typedModel, ecoreValue);
+ return ecoreValue;
+ }
+ else {
+ // Realized variables are in the mapping's target bottom pattern
+ // and create elements in the target model. The realized variables
+ // are being visited for each binding of variable in the mapping.
+ Type type = newStatement.getType();
+ if (!(type instanceof org.eclipse.ocl.pivot.Class)) {
+ return null;
+ }
+ TypedModel typedModel = newStatement.getReferredTypedModel();
+ assert typedModel != null;
+ Object element = ((org.eclipse.ocl.pivot.Class)type).createInstance();
+ // Add the realize variable binding to the environment
+ replace(newStatement, element, false);
+ getModelManager().addModelElement(typedModel, element);
+ return element;
+ }
}
@Override
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 3fa8db8b4..ab912e34d 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
@@ -51,7 +51,7 @@ 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.MappingStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.RealizedVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.Statement;
import org.eclipse.qvtd.pivot.qvtimperative.VariableAssignment;
@@ -257,6 +257,11 @@ public class QVTiEvaluationVisitor extends BasicEvaluationVisitor implements IQV
return visitStatement(object); // MappingStatement is abstract
}
+ @Override
+ public @Nullable Object visitNewStatement(@NonNull NewStatement newStatement) {
+ return executor.internalExecuteNewStatement(newStatement, undecoratedVisitor);
+ }
+
/* @Override
public Object visitOppositePropertyCallExp(@NonNull OppositePropertyCallExp oppositePropertyCallExp) {
QVTiModelManager modelManager = (QVTiModelManager) context.getModelManager();
@@ -299,11 +304,6 @@ public class QVTiEvaluationVisitor extends BasicEvaluationVisitor implements IQV
}
@Override
- public @Nullable Object visitRealizedVariable(@NonNull RealizedVariable realizedVariable) {
- return executor.internalExecuteRealizedVariable(realizedVariable, undecoratedVisitor);
- }
-
- @Override
public @Nullable Object visitRule(@NonNull Rule object) {
return visiting(object);
}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEvaluationVisitorDecorator.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEvaluationVisitorDecorator.java
index 927d1710f..7faa34121 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEvaluationVisitorDecorator.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEvaluationVisitorDecorator.java
@@ -37,7 +37,7 @@ import org.eclipse.qvtd.pivot.qvtimperative.ImperativePattern;
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.RealizedVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.VariableAssignment;
@@ -278,24 +278,24 @@ implements IQVTiEvaluationVisitor {
* Delegates to my decorated visitor.
*/
@Override
- public @Nullable Object visitPattern(@NonNull Pattern pattern) {
- return delegate.visitPattern(pattern);
+ public @Nullable Object visitNewStatement(@NonNull NewStatement newStatement) {
+ return delegate.visitNewStatement(newStatement);
}
/**
* Delegates to my decorated visitor.
*/
@Override
- public @Nullable Object visitPredicate(@NonNull Predicate predicate) {
- return delegate.visitPredicate(predicate);
+ public @Nullable Object visitPattern(@NonNull Pattern pattern) {
+ return delegate.visitPattern(pattern);
}
/**
* Delegates to my decorated visitor.
*/
@Override
- public @Nullable Object visitRealizedVariable(@NonNull RealizedVariable realizedVariable) {
- return delegate.visitRealizedVariable(realizedVariable);
+ public @Nullable Object visitPredicate(@NonNull Predicate predicate) {
+ return delegate.visitPredicate(predicate);
}
/**
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiExecutor.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiExecutor.java
index 6a4750095..d58ea4ca0 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiExecutor.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiExecutor.java
@@ -20,7 +20,7 @@ import org.eclipse.ocl.pivot.internal.evaluation.ExecutorInternal;
import org.eclipse.qvtd.pivot.qvtbase.Transformation;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCall;
-import org.eclipse.qvtd.pivot.qvtimperative.RealizedVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
public interface QVTiExecutor extends ExecutorInternal
@@ -34,7 +34,7 @@ public interface QVTiExecutor extends ExecutorInternal
@NonNull QVTiModelManager getModelManager();
@Nullable Object internalExecuteMapping(@NonNull Mapping mapping, @NonNull EvaluationVisitor undecoratedVisitor);
@Nullable Object internalExecuteMappingCall(@NonNull MappingCall mappingCall, @NonNull Object @NonNull [] boundValues, @NonNull EvaluationVisitor undecoratedVisitor);
- @Nullable Object internalExecuteRealizedVariable(@NonNull RealizedVariable realizedVariable, @NonNull EvaluationVisitor undecoratedVisitor);
+ @Nullable Object internalExecuteNewStatement(@NonNull NewStatement newStatement, @NonNull EvaluationVisitor undecoratedVisitor);
void internalExecuteSetStatement(@NonNull SetStatement setStatement, @NonNull Object slotObject, @Nullable Object ecoreValue, @Nullable Object childKey);
@Nullable Object internalExecuteTransformation(@NonNull Transformation transformation, @NonNull EvaluationVisitor undecoratedVisitor);
void loadModel(@NonNull String inName, @NonNull URI inURI, @Nullable String contentType);
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiIncrementalExecutor.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiIncrementalExecutor.java
index 198dd8856..46d47f968 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiIncrementalExecutor.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiIncrementalExecutor.java
@@ -32,7 +32,7 @@ import org.eclipse.qvtd.pivot.qvtbase.Transformation;
import org.eclipse.qvtd.pivot.qvtbase.graphs.GraphStringBuilder;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCall;
-import org.eclipse.qvtd.pivot.qvtimperative.RealizedVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.utilities.QVTimperativeUtil;
import org.eclipse.qvtd.runtime.evaluation.AbstractComputation;
@@ -266,8 +266,8 @@ public class QVTiIncrementalExecutor extends BasicQVTiExecutor
}
@Override
- public @Nullable Object internalExecuteRealizedVariable(@NonNull RealizedVariable realizedVariable, @NonNull EvaluationVisitor undecoratedVisitor) {
- Object element = super.internalExecuteRealizedVariable(realizedVariable, undecoratedVisitor);
+ public @Nullable Object internalExecuteNewStatement(@NonNull NewStatement asNewStatement, @NonNull EvaluationVisitor undecoratedVisitor) {
+ Object element = super.internalExecuteNewStatement(asNewStatement, undecoratedVisitor);
if ((element != null) && (mode == Mode.INCREMENTAL)) {
Invocation.Incremental currentInvocation2 = currentInvocation;
assert currentInvocation2 != null;
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeAS2XMIidVisitor.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeAS2XMIidVisitor.java
index b3545aedf..3c3604ef7 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeAS2XMIidVisitor.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeAS2XMIidVisitor.java
@@ -28,7 +28,7 @@ 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.MappingStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.RealizedVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.util.AbstractQVTimperativeAS2XMIidVisitor;
public class QVTimperativeAS2XMIidVisitor extends AbstractQVTimperativeAS2XMIidVisitor
@@ -108,20 +108,20 @@ public class QVTimperativeAS2XMIidVisitor extends AbstractQVTimperativeAS2XMIidV
}
@Override
- public @Nullable Boolean visitRealizedVariable(@NonNull RealizedVariable object) {
- if (object.eContainer() instanceof ImperativePattern) {
- Rule rule = QVTimperativeUtil.getContainingRule(object);
- if((rule != null) && (rule.getName() != null)) {
- String name = object.getName();
- if (name != null) {
- s.append(VARIABLE_PREFIX);
- appendParent(object);
- appendName(name);
- return true;
- }
+ public @Nullable Boolean visitNewStatement(@NonNull NewStatement object) {
+ // if (object.eContainer() instanceof ImperativePattern) {
+ Rule rule = QVTimperativeUtil.getContainingRule(object);
+ if ((rule != null) && (rule.getName() != null)) {
+ String name = object.getName();
+ if (name != null) {
+ s.append(VARIABLE_PREFIX);
+ appendParent(object);
+ appendName(name);
+ return true;
}
}
- return super.visitRealizedVariable(object);
+ // }
+ return super.visitNewStatement(object);
}
@Override
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeASSaverNormalizeVisitor.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeASSaverNormalizeVisitor.java
index 3da3664db..39923f605 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeASSaverNormalizeVisitor.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeASSaverNormalizeVisitor.java
@@ -17,7 +17,6 @@ import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.ocl.pivot.internal.resource.ASSaver;
import org.eclipse.ocl.pivot.utilities.ClassUtil;
-import org.eclipse.ocl.pivot.utilities.NameUtil;
import org.eclipse.qvtd.pivot.qvtbase.Predicate;
import org.eclipse.qvtd.pivot.qvtimperative.Assignment;
import org.eclipse.qvtd.pivot.qvtimperative.BottomPattern;
@@ -49,7 +48,7 @@ public class QVTimperativeASSaverNormalizeVisitor extends AbstractQVTimperativeA
public @Nullable Object visitBottomPattern(@NonNull BottomPattern object) {
List<@NonNull Assignment> assignments = ClassUtil.nullFree(object.getAssignment());
ClassUtil.sort(assignments, new AssignmentComparator(assignments));
- ClassUtil.sort(ClassUtil.nullFree(object.getRealizedVariable()), NameUtil.NAMEABLE_COMPARATOR);
+ // ClassUtil.sort(ClassUtil.nullFree(object.getRealizedVariable()), NameUtil.NAMEABLE_COMPARATOR);
return super.visitBottomPattern(object);
}
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 d2ab39ae0..1f75fad83 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,11 +17,12 @@ import org.eclipse.ocl.pivot.Property;
import org.eclipse.ocl.pivot.Type;
import org.eclipse.ocl.pivot.Variable;
import org.eclipse.ocl.pivot.utilities.EnvironmentFactory;
+import org.eclipse.qvtd.pivot.qvtbase.TypedModel;
import org.eclipse.qvtd.pivot.qvtbase.utilities.QVTbaseHelper;
import org.eclipse.qvtd.pivot.qvtimperative.AddStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.QVTimperativeFactory;
-import org.eclipse.qvtd.pivot.qvtimperative.RealizedVariable;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.VariableAssignment;
@@ -50,12 +51,8 @@ public class QVTimperativeHelper extends QVTbaseHelper
return asVariable;
}
- public @NonNull RealizedVariable createRealizedVariable(@NonNull String name, @NonNull Type type) {
- RealizedVariable realizedVariable = QVTimperativeFactory.eINSTANCE.createRealizedVariable();
- realizedVariable.setName(name);
- realizedVariable.setType(type);
- realizedVariable.setIsRequired(true);;
- return realizedVariable;
+ public @NonNull NewStatement createNewStatement(@NonNull String name, @NonNull TypedModel typedModel, @NonNull Type type) {
+ return QVTimperativeUtil.createNewStatement(name, typedModel, type);
}
public @NonNull SetStatement createSetStatement(@NonNull Variable asVariable, @NonNull Property asProperty, @NonNull OCLExpression asValueExpression) {
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 99163534a..3f3e492d0 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
@@ -34,7 +34,7 @@ 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.MappingStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.RealizedVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.Statement;
import org.eclipse.qvtd.pivot.qvtimperative.VariableAssignment;
@@ -72,9 +72,6 @@ public class QVTimperativePrettyPrintVisitor extends QVTbasePrettyPrintVisitor i
@Override
public Object visitBottomPattern(@NonNull BottomPattern pBottomPattern) {
- for (RealizedVariable pRealizedVariable : pBottomPattern.getRealizedVariable()) {
- safeVisit(pRealizedVariable);
- }
for (Variable pVariable : pBottomPattern.getVariable()) {
safeVisit(pVariable);
}
@@ -210,15 +207,17 @@ public class QVTimperativePrettyPrintVisitor extends QVTbasePrettyPrintVisitor i
}
@Override
- public Object visitPredicate(@NonNull Predicate pPredicate) {
- safeVisit(pPredicate.getConditionExpression());
+ public Object visitNewStatement(@NonNull NewStatement pNewStatement) {
+ context.append("new@");
+ context.appendName(pNewStatement.getReferredTypedModel());
+ context.append(" ");
+ visitVariable(pNewStatement);
return null;
}
@Override
- public Object visitRealizedVariable(@NonNull RealizedVariable pRealizedVariable) {
- context.append("realize ");
- visitVariable(pRealizedVariable);
+ public Object visitPredicate(@NonNull Predicate pPredicate) {
+ safeVisit(pPredicate.getConditionExpression());
return null;
}
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 95b792946..d9b0126a2 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
@@ -22,17 +22,17 @@ import org.eclipse.qvtd.pivot.qvtimperative.Assignment;
import org.eclipse.qvtd.pivot.qvtimperative.BottomPattern;
import org.eclipse.qvtd.pivot.qvtimperative.BottomStatement;
import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
-import org.eclipse.qvtd.pivot.qvtimperative.GuardPattern;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeDomain;
-import org.eclipse.qvtd.pivot.qvtimperative.ImperativeModel;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativePattern;
+import org.eclipse.qvtd.pivot.qvtimperative.GuardPattern;
+import org.eclipse.qvtd.pivot.qvtimperative.ImperativeModel;
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.MappingStatement;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.QVTimperativePackage;
-import org.eclipse.qvtd.pivot.qvtimperative.RealizedVariable;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.Statement;
import org.eclipse.qvtd.pivot.qvtimperative.VariableAssignment;
@@ -182,9 +182,11 @@ public class QVTimperativeToStringVisitor extends QVTbaseToStringVisitor impleme
}
@Override
- public String visitRealizedVariable(@NonNull RealizedVariable variable) {
- // append("realized ");
- visitVariable(variable);
+ public String visitNewStatement(@NonNull NewStatement newStatement) {
+ append("new@");
+ appendName(newStatement.getReferredTypedModel());
+ append(" ");
+ visitVariable(newStatement);
return null;
}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeUtil.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeUtil.java
index e0b11f954..08e7c7c72 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeUtil.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/utilities/QVTimperativeUtil.java
@@ -56,8 +56,8 @@ 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.MappingStatement;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.QVTimperativeFactory;
-import org.eclipse.qvtd.pivot.qvtimperative.RealizedVariable;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.VariablePredicate;
import org.eclipse.qvtd.pivot.qvtimperative.evaluation.QVTiEnvironmentFactory;
@@ -211,12 +211,13 @@ public class QVTimperativeUtil extends QVTbaseUtil
return propertyCallExp;
} */
- public static @NonNull RealizedVariable createRealizedVariable(@NonNull String name, @NonNull Type type) {
- RealizedVariable realizedVariable = QVTimperativeFactory.eINSTANCE.createRealizedVariable();
- realizedVariable.setName(name);
- realizedVariable.setType(type);
- realizedVariable.setIsRequired(true);
- return realizedVariable;
+ public static @NonNull NewStatement createNewStatement(@NonNull String name, @NonNull TypedModel typedModel, @NonNull Type type) {
+ NewStatement newStatement = QVTimperativeFactory.eINSTANCE.createNewStatement();
+ newStatement.setName(name);
+ newStatement.setReferredTypedModel(typedModel);
+ newStatement.setType(type);
+ newStatement.setIsRequired(true);
+ return newStatement;
}
public static @NonNull SetStatement createSetStatement(@NonNull Variable asVariable, @NonNull Property asProperty, @NonNull OCLExpression asValueExpression) {
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 c359486af..d061470fa 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
@@ -15,6 +15,7 @@ import org.eclipse.ocl.pivot.Namespace;
import org.eclipse.ocl.pivot.Property;
import org.eclipse.ocl.pivot.Type;
import org.eclipse.ocl.pivot.Variable;
+import org.eclipse.ocl.pivot.VariableExp;
import org.eclipse.ocl.pivot.internal.prettyprint.PrettyPrinter;
import org.eclipse.ocl.pivot.utilities.NameUtil;
import org.eclipse.ocl.pivot.utilities.PivotUtil;
@@ -28,7 +29,7 @@ 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.RealizedVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.VariableAssignment;
import org.eclipse.qvtd.xtext.qvtbase.ui.labeling.QVTbaseLabelProvider;
@@ -91,12 +92,12 @@ public class QVTimperativeLabelProvider extends QVTbaseLabelProvider
return "MappingCallBinding.gif";
}
- protected String image(SetStatement ele) {
- return QVTIMPERATIVE_UI_ICONS + "SetStatement.gif";
+ protected String image(NewStatement ele) {
+ return QVTIMPERATIVE_UI_ICONS + "NewStatement.gif";
}
- protected String image(RealizedVariable ele) {
- return QVTIMPERATIVE_UI_ICONS + "RealizedVariable.gif";
+ protected String image(SetStatement ele) {
+ return QVTIMPERATIVE_UI_ICONS + "SetStatement.gif";
}
protected String image(TopLevelCS ele) {
@@ -154,7 +155,10 @@ public class QVTimperativeLabelProvider extends QVTbaseLabelProvider
return "";
}
StringBuilder s = new StringBuilder();
- s.append(PrettyPrinter.printName(ele.getSlotExpression(), namespace));
+ VariableExp slotExpression = ele.getSlotExpression();
+ if (slotExpression != null) {
+ s.append(PrettyPrinter.printName(slotExpression, namespace));
+ }
Property targetProperty = ele.getTargetProperty();
s.append(".");
if (targetProperty != null) {
@@ -179,7 +183,9 @@ public class QVTimperativeLabelProvider extends QVTbaseLabelProvider
}
StringBuilder s = new StringBuilder();
Variable targetVariable = ele.getTargetVariable();
- s.append(PrettyPrinter.printName(targetVariable, namespace));
+ if (targetVariable != null) {
+ s.append(PrettyPrinter.printName(targetVariable, namespace));
+ }
s.append(" : ");
if (targetVariable != null) {
Type type = targetVariable.getType();
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 d4a71f168..fc111d8c3 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,16 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.ocl.pivot.Variable;
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.qvtbase.Predicate;
import org.eclipse.qvtd.pivot.qvtimperative.Assignment;
import org.eclipse.qvtd.pivot.qvtimperative.BottomPattern;
import org.eclipse.qvtd.pivot.qvtimperative.GuardPattern;
+import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
import org.eclipse.qvtd.pivot.qvtimperative.MappingLoop;
import org.eclipse.qvtd.pivot.qvtimperative.MappingStatement;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
+import org.eclipse.qvtd.pivot.qvtimperative.Statement;
import org.eclipse.qvtd.pivot.qvtimperative.VariableAssignment;
import org.eclipse.qvtd.xtext.qvtbase.ui.outline.QVTbaseOutlineTreeProvider;
import org.eclipse.qvtd.xtext.qvtimperativecs.DirectionCS;
@@ -42,9 +45,6 @@ public class QVTimperativeOutlineTreeProvider extends QVTbaseOutlineTreeProvider
//}
protected void _createChildren(IOutlineNode parentNode, BottomPattern ele) {
- for (Variable asVariable : ele.getRealizedVariable()) {
- createNode(parentNode, asVariable);
- }
for (Variable asVariable : ele.getVariable()) {
createNode(parentNode, asVariable);
}
@@ -65,6 +65,17 @@ public class QVTimperativeOutlineTreeProvider extends QVTbaseOutlineTreeProvider
}
}
+ protected void _createChildren(IOutlineNode parentNode, Mapping ele) {
+ for (Domain asDomain : ele.getDomain()) {
+ createNode(parentNode, asDomain);
+ }
+ createNode(parentNode, ele.getGuardPattern());
+ createNode(parentNode, ele.getBottomPattern());
+ for (Statement asStatement : ele.getOwnedStatements()) {
+ createNode(parentNode, asStatement);
+ }
+ }
+
protected void _createChildren(IOutlineNode parentNode, MappingLoop ele) {
if (ele.getOwnedSource() != null) {
createNode(parentNode, ele.getOwnedSource());
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 8b9ca352e..2e32c31f2 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
@@ -84,7 +84,7 @@ 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.MappingStatement;
-import org.eclipse.qvtd.pivot.qvtimperative.RealizedVariable;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.Statement;
import org.eclipse.qvtd.pivot.qvtimperative.VariableAssignment;
@@ -95,8 +95,8 @@ import org.eclipse.qvtd.xtext.qvtbase.as2cs.QVTbaseDeclarationVisitor;
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.BottomPatternCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.ConnectionStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.DirectionCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.DomainCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.GuardPatternCS;
@@ -105,12 +105,12 @@ 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.MappingStatementCS;
+import org.eclipse.qvtd.xtext.qvtimperativecs.NewStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.ParamDeclarationCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.PredicateCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.PredicateOrAssignmentCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.QVTimperativeCSPackage;
import org.eclipse.qvtd.xtext.qvtimperativecs.QueryCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.RealizedVariableCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.SetStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.StatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.TopLevelCS;
@@ -367,7 +367,7 @@ public class QVTimperativeDeclarationVisitor extends QVTbaseDeclarationVisitor i
@Override
public ElementCS visitAddStatement(@NonNull AddStatement asAddStatement) {
- ConnectionStatementCS csStatement = context.refreshElement(ConnectionStatementCS.class, QVTimperativeCSPackage.Literals.CONNECTION_STATEMENT_CS, asAddStatement);
+ AddStatementCS csStatement = context.refreshElement(AddStatementCS.class, QVTimperativeCSPackage.Literals.ADD_STATEMENT_CS, asAddStatement);
csStatement.setPivot(asAddStatement);
Variable asVariable = asAddStatement.getTargetVariable();
if (asVariable != null) {
@@ -400,7 +400,6 @@ public class QVTimperativeDeclarationVisitor extends QVTbaseDeclarationVisitor i
context.refreshList(csBottomPattern.getOwnedUnrealizedVariables(), context.visitDeclarations(UnrealizedVariableCS.class, asBottomPattern.getVariable(), null));
}
else {
- context.refreshList(csBottomPattern.getOwnedRealizedVariables(), context.visitDeclarations(RealizedVariableCS.class, asBottomPattern.getRealizedVariable(), null));
context.refreshList(csBottomPattern.getOwnedUnrealizedVariables(), context.visitDeclarations(UnrealizedVariableCS.class, asBottomPattern.getVariable(), null));
}
return csBottomPattern;
@@ -632,12 +631,13 @@ public class QVTimperativeDeclarationVisitor extends QVTbaseDeclarationVisitor i
}
@Override
- public ElementCS visitRealizedVariable(@NonNull RealizedVariable asRealizedVariable) {
- RealizedVariableCS csRealizedVariable = context.refreshNamedElement(RealizedVariableCS.class, QVTimperativeCSPackage.Literals.REALIZED_VARIABLE_CS, asRealizedVariable);
- csRealizedVariable.setPivot(asRealizedVariable);
- csRealizedVariable.setOwnedType(createTypeRefCS(asRealizedVariable.getType(), getScope(asRealizedVariable)));
- csRealizedVariable.setOwnedInitExpression(context.visitDeclaration(ExpCS.class, asRealizedVariable.getOwnedInit()));
- return csRealizedVariable;
+ public ElementCS visitNewStatement(@NonNull NewStatement asNewStatement) {
+ NewStatementCS csNewStatement = context.refreshNamedElement(NewStatementCS.class, QVTimperativeCSPackage.Literals.NEW_STATEMENT_CS, asNewStatement);
+ csNewStatement.setPivot(asNewStatement);
+ csNewStatement.setOwnedType(createTypeRefCS(asNewStatement.getType(), getScope(asNewStatement)));
+ csNewStatement.setReferredTypedModel(asNewStatement.getReferredTypedModel());
+ csNewStatement.setOwnedInitExpression(context.visitDeclaration(ExpCS.class, asNewStatement.getOwnedInit()));
+ return csNewStatement;
}
@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 c0cf72597..87b32f1cf 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
@@ -57,14 +57,14 @@ 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.MappingStatement;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.QVTimperativeFactory;
import org.eclipse.qvtd.pivot.qvtimperative.QVTimperativePackage;
-import org.eclipse.qvtd.pivot.qvtimperative.RealizedVariable;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.Statement;
import org.eclipse.qvtd.pivot.qvtimperative.VariableAssignment;
+import org.eclipse.qvtd.xtext.qvtimperativecs.AddStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.BottomPatternCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.ConnectionStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.DirectionCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.DomainCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.GuardPatternCS;
@@ -72,12 +72,12 @@ 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.NewStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.ParamDeclarationCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.PatternCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.PredicateCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.PredicateOrAssignmentCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.QueryCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.RealizedVariableCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.SetStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.TopLevelCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.TransformationCS;
@@ -212,9 +212,14 @@ public class QVTimperativeCSContainmentVisitor extends AbstractQVTimperativeCSCo
}
@Override
+ public @Nullable Continuation<?> visitAddStatementCS(@NonNull AddStatementCS csElement) {
+ context.refreshModelElement(AddStatement.class, QVTimperativePackage.Literals.ADD_STATEMENT, csElement);
+ return null;
+ }
+
+ @Override
public Continuation<?> visitBottomPatternCS(@NonNull BottomPatternCS csElement) {
BottomPattern pBottomPattern = context.refreshModelElement(BottomPattern.class, QVTimperativePackage.Literals.BOTTOM_PATTERN, csElement);
- context.refreshPivotList(RealizedVariable.class, pBottomPattern.getRealizedVariable(), csElement.getOwnedRealizedVariables());
context.refreshPivotList(Variable.class, pBottomPattern.getVariable(), csElement.getOwnedUnrealizedVariables());
context.refreshPivotList(Assignment.class, pBottomPattern.getAssignment(), Iterables.filter(csElement.getOwnedConstraints(), IsAssignmentPredicate.INSTANCE));
context.refreshPivotList(Predicate.class, pBottomPattern.getPredicate(), Iterables.filter(csElement.getOwnedConstraints(), IsPredicatePredicate.INSTANCE));
@@ -223,12 +228,6 @@ public class QVTimperativeCSContainmentVisitor extends AbstractQVTimperativeCSCo
}
@Override
- public @Nullable Continuation<?> visitConnectionStatementCS(@NonNull ConnectionStatementCS csElement) {
- context.refreshModelElement(AddStatement.class, QVTimperativePackage.Literals.ADD_STATEMENT, csElement);
- return null;
- }
-
- @Override
public Continuation<?> visitDirectionCS(@NonNull DirectionCS csElement) {
refreshNamedElement(TypedModel.class, QVTbasePackage.Literals.TYPED_MODEL, csElement);
Continuation<?> continuation = new DirectionContentContinuation(context, csElement);
@@ -278,7 +277,6 @@ public class QVTimperativeCSContainmentVisitor extends AbstractQVTimperativeCSCo
bottomPattern.getAssignment().clear();
bottomPattern.getBindsTo().clear();
bottomPattern.getPredicate().clear();
- bottomPattern.getRealizedVariable().clear();
bottomPattern.getVariable().clear();
pivotElement.setBottomPattern(bottomPattern);
}
@@ -329,6 +327,12 @@ public class QVTimperativeCSContainmentVisitor extends AbstractQVTimperativeCSCo
}
@Override
+ public Continuation<?> visitNewStatementCS(@NonNull NewStatementCS csElement) {
+ refreshNamedElement(NewStatement.class, QVTimperativePackage.Literals.NEW_STATEMENT, csElement);
+ return null;
+ }
+
+ @Override
public Continuation<?> visitParamDeclarationCS(@NonNull ParamDeclarationCS csElement) {
refreshNamedElement(FunctionParameter.class, QVTbasePackage.Literals.FUNCTION_PARAMETER, csElement);
return null;
@@ -370,12 +374,6 @@ public class QVTimperativeCSContainmentVisitor extends AbstractQVTimperativeCSCo
}
@Override
- public Continuation<?> visitRealizedVariableCS(@NonNull RealizedVariableCS csElement) {
- refreshNamedElement(RealizedVariable.class, QVTimperativePackage.Literals.REALIZED_VARIABLE, csElement);
- return null;
- }
-
- @Override
public @Nullable Continuation<?> visitSetStatementCS(@NonNull SetStatementCS csElement) {
context.refreshModelElement(SetStatement.class, QVTimperativePackage.Literals.SET_STATEMENT, csElement);
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 3c97ffe63..bf6f644f3 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
@@ -41,29 +41,29 @@ import org.eclipse.qvtd.pivot.qvtimperative.GuardPattern;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCallBinding;
import org.eclipse.qvtd.pivot.qvtimperative.MappingLoop;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.QVTimperativeFactory;
-import org.eclipse.qvtd.pivot.qvtimperative.RealizedVariable;
import org.eclipse.qvtd.pivot.qvtimperative.SetStatement;
import org.eclipse.qvtd.pivot.qvtimperative.VariableAssignment;
import org.eclipse.qvtd.pivot.qvtimperative.VariablePredicate;
import org.eclipse.qvtd.pivot.qvtimperative.utilities.QVTimperativeUtil;
+import org.eclipse.qvtd.xtext.qvtimperativecs.AddStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.AreaCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.BottomPatternCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.ConnectionStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.DirectionCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.DomainCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.GuardPatternCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingCallBindingCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.MappingLoopCS;
+import org.eclipse.qvtd.xtext.qvtimperativecs.NewStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.ParamDeclarationCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.PatternCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.PredicateCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.PredicateOrAssignmentCS;
+import org.eclipse.qvtd.xtext.qvtimperativecs.SetStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.QueryCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.RealizeableVariableCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.RealizedVariableCS;
-import org.eclipse.qvtd.xtext.qvtimperativecs.SetStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.TopLevelCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.TransformationCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.UnrealizedVariableCS;
@@ -122,6 +122,20 @@ public class QVTimperativeCSPostOrderVisitor extends AbstractQVTimperativeCSPost
}
@Override
+ public @Nullable Continuation<?> visitAddStatementCS(@NonNull AddStatementCS csElement) {
+ AddStatement asAddStatement = PivotUtil.getPivot(AddStatement.class, csElement);
+ if (asAddStatement != null) {
+ asAddStatement.setTargetVariable((ConnectionVariable) csElement.getTargetVariable());
+ ExpCS csInitialiser = csElement.getOwnedExpression();
+ if (csInitialiser != null) {
+ OCLExpression initialiser = context.visitLeft2Right(OCLExpression.class, csInitialiser);
+ asAddStatement.setValue(initialiser);
+ }
+ }
+ return null;
+ }
+
+ @Override
public Continuation<?> visitAreaCS(@NonNull AreaCS csElement) {
return null;
}
@@ -130,8 +144,8 @@ public class QVTimperativeCSPostOrderVisitor extends AbstractQVTimperativeCSPost
public Continuation<?> visitBottomPatternCS(@NonNull BottomPatternCS csElement) {
BottomPattern pBottomPattern = PivotUtil.getPivot(BottomPattern.class, csElement);
if (pBottomPattern != null) {
- List<Assignment> pAssignments = new ArrayList<Assignment>();
- List<Predicate> pPredicates = new ArrayList<Predicate>();
+ List<@NonNull Assignment> pAssignments = new ArrayList<>();
+ List<@NonNull Predicate> pPredicates = new ArrayList<>();
for (PredicateOrAssignmentCS csConstraint : csElement.getOwnedConstraints()) {
ExpCS csTarget = csConstraint.getOwnedTarget();
ExpCS csInitialiser = csConstraint.getOwnedInitExpression();
@@ -169,20 +183,6 @@ public class QVTimperativeCSPostOrderVisitor extends AbstractQVTimperativeCSPost
}
@Override
- public @Nullable Continuation<?> visitConnectionStatementCS(@NonNull ConnectionStatementCS csElement) {
- AddStatement asAddStatement = PivotUtil.getPivot(AddStatement.class, csElement);
- if (asAddStatement != null) {
- asAddStatement.setTargetVariable((ConnectionVariable) csElement.getTargetVariable());
- ExpCS csInitialiser = csElement.getOwnedExpression();
- if (csInitialiser != null) {
- OCLExpression initialiser = context.visitLeft2Right(OCLExpression.class, csInitialiser);
- asAddStatement.setValue(initialiser);
- }
- }
- return null;
- }
-
- @Override
public Continuation<?> visitConstraintCS(@NonNull ConstraintCS object) {
return null;
}
@@ -210,7 +210,7 @@ public class QVTimperativeCSPostOrderVisitor extends AbstractQVTimperativeCSPost
public Continuation<?> visitMappingCS(@NonNull MappingCS csElement) {
Mapping asMapping = PivotUtil.getPivot(Mapping.class, csElement);
if (asMapping != null) {
- List<VariablePredicate> asVariablePredicates = null;
+ List<@NonNull VariablePredicate> asVariablePredicates = null;
for (DomainCS csDomain : csElement.getOwnedDomains()) {
GuardPatternCS csGuardPattern = csDomain.getOwnedGuardPattern();
for (UnrealizedVariableCS csVariable : csGuardPattern.getOwnedUnrealizedVariables()) {
@@ -224,7 +224,7 @@ public class QVTimperativeCSPostOrderVisitor extends AbstractQVTimperativeCSPost
asVariablePredicate.setTargetVariable(asVariable);
asVariablePredicate.setConditionExpression(asExpression);
if (asVariablePredicates == null) {
- asVariablePredicates = new ArrayList<VariablePredicate>();
+ asVariablePredicates = new ArrayList<>();
}
asVariablePredicates.add(asVariablePredicate);
}
@@ -279,6 +279,21 @@ public class QVTimperativeCSPostOrderVisitor extends AbstractQVTimperativeCSPost
}
return null;
}
+
+ @Override
+ public Continuation<?> visitNewStatementCS(@NonNull NewStatementCS csElement) {
+ NewStatement asNewStatement = PivotUtil.getPivot(NewStatement.class, csElement);
+ if (asNewStatement != null) {
+ asNewStatement.setReferredTypedModel(csElement.getReferredTypedModel());
+ ExpCS expression = csElement.getOwnedInitExpression();
+ if (expression != null) {
+ OCLExpression target = context.visitLeft2Right(OCLExpression.class, expression);
+ asNewStatement.setOwnedInit(target);
+ }
+ }
+ return null;
+ }
+
@Override
public Continuation<?> visitParamDeclarationCS(@NonNull ParamDeclarationCS object) {
return null;
@@ -328,23 +343,11 @@ public class QVTimperativeCSPostOrderVisitor extends AbstractQVTimperativeCSPost
}
@Override
- public Continuation<?> visitRealizedVariableCS(@NonNull RealizedVariableCS csElement) {
- RealizedVariable asRealizedVariable = PivotUtil.getPivot(RealizedVariable.class, csElement);
- if (asRealizedVariable != null) {
- ExpCS expression = csElement.getOwnedInitExpression();
- if (expression != null) {
- OCLExpression target = context.visitLeft2Right(OCLExpression.class, expression);
- asRealizedVariable.setOwnedInit(target);
- }
- }
- return null;
- }
-
- @Override
public Continuation<?> visitSetStatementCS(@NonNull SetStatementCS csElement) {
SetStatement setStatement = PivotUtil.getPivot(SetStatement.class, csElement);
if (setStatement != null) {
Variable targetVariable = csElement.getReferredVariable();
+ assert targetVariable != null;
setStatement.setSlotExpression(PivotUtil.createVariableExp(targetVariable));
Property targetProperty = csElement.getReferredProperty();
ExpCS csInitialiser = csElement.getOwnedInitExpression();
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 afecec058..e39903ab9 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
@@ -49,6 +49,7 @@ 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.NewStatementCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.ParamDeclarationCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.PredicateCS;
import org.eclipse.qvtd.xtext.qvtimperativecs.PredicateOrAssignmentCS;
@@ -95,6 +96,22 @@ public class QVTimperativeCSPreOrderVisitor extends AbstractQVTimperativeCSPreOr
}
}
+ public static class NewStatementCompletion extends SingleContinuation<NewStatementCS>
+ {
+ public NewStatementCompletion(@NonNull CS2ASConversion context, @NonNull NewStatementCS csElement) {
+ super(context, null, null, csElement, new PivotDependency(csElement.getOwnedType()));
+ }
+
+ @Override
+ public BasicContinuation<?> execute() {
+ Variable pivotElement = PivotUtil.getPivot(Variable.class, csElement);
+ if (pivotElement != null) {
+ context.refreshRequiredType(pivotElement, csElement);
+ }
+ return null;
+ }
+ }
+
public static class ParamDeclarationCompletion extends SingleContinuation<ParamDeclarationCS>
{
public ParamDeclarationCompletion(@NonNull CS2ASConversion context, @NonNull ParamDeclarationCS csElement) {
@@ -267,6 +284,11 @@ public class QVTimperativeCSPreOrderVisitor extends AbstractQVTimperativeCSPreOr
}
@Override
+ public Continuation<?> visitNewStatementCS(@NonNull NewStatementCS csElement) {
+ return new NewStatementCompletion(context, csElement);
+ }
+
+ @Override
public Continuation<?> visitParamDeclarationCS(@NonNull ParamDeclarationCS csElement) {
return new ParamDeclarationCompletion(context, csElement);
}
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 2234f5a86..171b997d7 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
@@ -23,11 +23,11 @@ import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.MappingLoopCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.MiddleBottomPatternCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.MiddleDomainCSElements;
+import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.NewStatementCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.PredicateCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.PredicateOrAssignmentCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.QualifiedPackageCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.QueryCSElements;
-import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.RealizedVariableCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.ScopeNameCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.SetStatementCSElements;
import org.eclipse.qvtd.xtext.qvtimperative.services.QVTimperativeGrammarAccess.SourceBottomPatternCSElements;
@@ -324,13 +324,14 @@ public class QVTimperativeFormatter extends AbstractEssentialOCLFormatter
c.setNoSpace().between(a.getLeftParenthesisKeyword_0_0(), a.getRightParenthesisKeyword_0_5());
}
{
- PredicateOrAssignmentCSElements a = f.getPredicateOrAssignmentCSAccess();
- setNoSpaceLineWrap(c, a.getSemicolonKeyword_2());
+ NewStatementCSElements a = f.getNewStatementCSAccess();
+ c.setLinewrap(1).before(a.getNewKeyword_0());
+ c.setNoSpace().around(a.getColonKeyword_1());
+ c.setNoSpace().before(a.getSemicolonKeyword_7());
}
{
- RealizedVariableCSElements a = f.getRealizedVariableCSAccess();
- c.setLinewrap(1).before(a.getRealizeKeyword_0());
- c.setLinewrap(1).after(a.getOwnedInitExpressionAssignment_4_1());
+ PredicateOrAssignmentCSElements a = f.getPredicateOrAssignmentCSAccess();
+ setNoSpaceLineWrap(c, a.getSemicolonKeyword_2());
}
{
ScopeNameCSElements a = f.getScopeNameCSAccess();
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 dd687dbe0..28fee60ee 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
@@ -33,8 +33,8 @@ import org.eclipse.qvtd.pivot.qvtbase.TypedModel;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativePattern;
import org.eclipse.qvtd.pivot.qvtimperative.Mapping;
import org.eclipse.qvtd.pivot.qvtimperative.MappingLoop;
+import org.eclipse.qvtd.pivot.qvtimperative.NewStatement;
import org.eclipse.qvtd.pivot.qvtimperative.QVTimperativePackage;
-import org.eclipse.qvtd.pivot.qvtimperative.RealizedVariable;
import org.eclipse.qvtd.pivot.qvtimperative.evaluation.QVTiEnvironmentFactory;
import org.eclipse.qvtd.pivot.qvtimperative.utilities.QVTimperativeASResourceFactory;
import org.eclipse.qvtd.xtext.qvtimperative.as2cs.QVTimperativeAS2CS;
@@ -90,8 +90,8 @@ public class QVTimperativeCSResource extends EssentialOCLCSResource
else if (element instanceof Mapping) {
return (Mapping)element;
}
- else if (element instanceof RealizedVariable) {
- return (RealizedVariable)element;
+ else if (element instanceof NewStatement) {
+ return (NewStatement)element;
}
else if ((element instanceof Variable) && (element.eContainer() instanceof ImperativePattern)) {
return (Variable)element;

Back to the top