Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-10-20 15:22:22 +0000
committerEd Willink2016-10-30 11:38:45 +0000
commit3cc5dc7ff76317ff8c5cdae607930b9df68cd7d9 (patch)
tree0ced0fd0b7e76eabd9bc31472e1ccfd359fd4b87 /plugins
parentb279f137130ca1fd38903590461b7d23b09fa2d1 (diff)
downloadorg.eclipse.qvtd-3cc5dc7ff76317ff8c5cdae607930b9df68cd7d9.tar.gz
org.eclipse.qvtd-3cc5dc7ff76317ff8c5cdae607930b9df68cd7d9.tar.xz
org.eclipse.qvtd-3cc5dc7ff76317ff8c5cdae607930b9df68cd7d9.zip
[506228] Test that QVTr's qvti is loadable.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/as2cs/QVTimperativeDeclarationVisitor.java6
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtrelation/src/org/eclipse/qvtd/xtext/qvtrelation/cs2as/QVTrelationCSLeft2RightVisitor.java17
2 files changed, 12 insertions, 11 deletions
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 31da6ae8f..c91df2cf8 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
@@ -457,7 +457,7 @@ public class QVTimperativeDeclarationVisitor extends QVTbaseDeclarationVisitor i
GuardParameterCS csUnrealizedVariable = context.refreshNamedElement(GuardParameterCS.class, QVTimperativeCSPackage.Literals.GUARD_PARAMETER_CS, asVariable);
csUnrealizedVariable.setPivot(asVariable);
csUnrealizedVariable.setReferredTypedModel(asTypedModel);
- csUnrealizedVariable.setOwnedType(createTypeRefCS(asVariable.getType(), asUsedPackage));
+ csUnrealizedVariable.setOwnedType(createTypeRefCS(asVariable.getType(), null));
return csUnrealizedVariable;
}
@@ -663,7 +663,7 @@ public class QVTimperativeDeclarationVisitor extends QVTbaseDeclarationVisitor i
ImperativeTypedModel asTypedModel = asNewStatement.getReferredTypedModel();
org.eclipse.ocl.pivot.Package asUsedPackage = asTypedModel.getUsedPackage().size() > 0 ? asTypedModel.getUsedPackage().get(0) : null;
NewStatementCS csNewStatement = context.refreshNamedElement(NewStatementCS.class, QVTimperativeCSPackage.Literals.NEW_STATEMENT_CS, asNewStatement);
- csNewStatement.setOwnedType(createTypeRefCS(asNewStatement.getType(), asUsedPackage));
+ csNewStatement.setOwnedType(createTypeRefCS(asNewStatement.getType(), null));
csNewStatement.setReferredTypedModel(asTypedModel);
csNewStatement.setOwnedExpression(context.visitDeclaration(ExpCS.class, asNewStatement.getOwnedExpression()));
refreshObservedProperties(asNewStatement, csNewStatement.getObservedProperties(), ClassUtil.nullFree(asNewStatement.getObservedProperties()));
@@ -733,7 +733,7 @@ public class QVTimperativeDeclarationVisitor extends QVTbaseDeclarationVisitor i
SimpleParameterCS csUnrealizedVariable = context.refreshNamedElement(SimpleParameterCS.class, QVTimperativeCSPackage.Literals.SIMPLE_PARAMETER_CS, asVariable);
csUnrealizedVariable.setPivot(asVariable);
csUnrealizedVariable.setReferredTypedModel(asTypedModel);
- csUnrealizedVariable.setOwnedType(createTypeRefCS(asVariable.getType(), asUsedPackage));
+ csUnrealizedVariable.setOwnedType(createTypeRefCS(asVariable.getType(), null));
return csUnrealizedVariable;
}
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtrelation/src/org/eclipse/qvtd/xtext/qvtrelation/cs2as/QVTrelationCSLeft2RightVisitor.java b/plugins/org.eclipse.qvtd.xtext.qvtrelation/src/org/eclipse/qvtd/xtext/qvtrelation/cs2as/QVTrelationCSLeft2RightVisitor.java
index 3bb94f45a..4cf671524 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtrelation/src/org/eclipse/qvtd/xtext/qvtrelation/cs2as/QVTrelationCSLeft2RightVisitor.java
+++ b/plugins/org.eclipse.qvtd.xtext.qvtrelation/src/org/eclipse/qvtd/xtext/qvtrelation/cs2as/QVTrelationCSLeft2RightVisitor.java
@@ -24,6 +24,7 @@ import org.eclipse.ocl.pivot.OperationCallExp;
import org.eclipse.ocl.pivot.PivotPackage;
import org.eclipse.ocl.pivot.Type;
import org.eclipse.ocl.pivot.Variable;
+import org.eclipse.ocl.pivot.VariableDeclaration;
import org.eclipse.ocl.pivot.internal.messages.PivotMessagesInternal;
import org.eclipse.ocl.pivot.internal.scoping.EnvironmentView;
import org.eclipse.ocl.pivot.internal.scoping.ScopeFilter;
@@ -74,11 +75,11 @@ public class QVTrelationCSLeft2RightVisitor extends AbstractQVTrelationCSLeft2Ri
return (object instanceof Operation) || (object instanceof Rule);
}
}
-
+
public static class ResolvedRuleInvocation implements Invocations
{
protected final @NonNull Rule invocation;
-
+
public ResolvedRuleInvocation(@NonNull Rule invocation) {
this.invocation = invocation;
}
@@ -87,7 +88,7 @@ public class QVTrelationCSLeft2RightVisitor extends AbstractQVTrelationCSLeft2Ri
public @NonNull NamedElement getSingleResult() {
return invocation;
}
-
+
@Override
public @NonNull Type getSourceType() {
return ClassUtil.nonNullState(invocation.getTransformation());
@@ -173,7 +174,7 @@ public class QVTrelationCSLeft2RightVisitor extends AbstractQVTrelationCSLeft2Ri
}
Function function = getBestFunction(invocations);
if (function != null) {
-// Operation baseOperation = metamodelManager.resolveBaseOperation(function);
+ // Operation baseOperation = metamodelManager.resolveBaseOperation(function);
OperationCallExp operationCallExp = context.refreshModelElement(OperationCallExp.class, PivotPackage.Literals.OPERATION_CALL_EXP, csNameExp);
context.setReferredOperation(operationCallExp, function);
context.setType(operationCallExp, function.getType(), function.isIsRequired());
@@ -181,7 +182,7 @@ public class QVTrelationCSLeft2RightVisitor extends AbstractQVTrelationCSLeft2Ri
resolveOperationArguments(csRoundBracketedClause, function, operationCallExp);
Type owningClass = function.getOwningClass();
if (owningClass instanceof RelationalTransformation) {
- Variable thisVariable = QVTbaseUtil.getContextVariable(standardLibrary, (RelationalTransformation) owningClass);
+ VariableDeclaration thisVariable = QVTbaseUtil.getContextVariable(standardLibrary, (RelationalTransformation) owningClass);
operationCallExp.setOwnedSource(PivotUtil.createVariableExp(thisVariable));
}
return operationCallExp;
@@ -214,7 +215,7 @@ public class QVTrelationCSLeft2RightVisitor extends AbstractQVTrelationCSLeft2Ri
int csArgumentCount = csArguments.size();
if (csArgumentCount > 0) {
if (csArguments.get(0).getRole() != NavigationRole.EXPRESSION) {
- context.addDiagnostic(csNameExp, "Relation calls can only specify expressions");
+ context.addDiagnostic(csNameExp, "Relation calls can only specify expressions");
}
for (int argIndex = 0; argIndex < csArgumentCount; argIndex++) {
NavigatingArgCS csArgument = csArguments.get(argIndex);
@@ -232,11 +233,11 @@ public class QVTrelationCSLeft2RightVisitor extends AbstractQVTrelationCSLeft2Ri
}
if ((csArgumentCount != patternsCount) && (relation != standardLibrary.getOclInvalidOperation())) {
String boundMessage = StringUtil.bind(PivotMessagesInternal.MismatchedArgumentCount_ERROR_, csArgumentCount, patternsCount);
- context.addDiagnostic(csNameExp, boundMessage);
+ context.addDiagnostic(csNameExp, boundMessage);
}
context.refreshList(relationCallExp.getArgument(), pivotArguments);
}
-
+
protected void resolveRelationArgumentTypes(@Nullable List<Variable> rootVariables, @NonNull RoundBracketedClauseCS csRoundBracketedClause) {
int argIndex = 0;
for (NavigatingArgCS csArgument : csRoundBracketedClause.getOwnedArguments()) {

Back to the top