Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2022-06-27 07:24:58 +0000
committerEd Willink2022-06-28 11:31:59 +0000
commitbe71ee6407a656866e95cef3ecb8c73ec218efd8 (patch)
treeac8d793808c8f60a4a7cb650b37f56f0ae1489c2
parentcbd61b9542fb7aa54fe397c96f86d6379016475f (diff)
downloadorg.eclipse.qvtd-be71ee6407a656866e95cef3ecb8c73ec218efd8.tar.gz
org.eclipse.qvtd-be71ee6407a656866e95cef3ecb8c73ec218efd8.tar.xz
org.eclipse.qvtd-be71ee6407a656866e95cef3ecb8c73ec218efd8.zip
'ok' ClassCallingConvention
-rw-r--r--plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java6
-rw-r--r--plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/java/InternalFunctionOperationCallingConvention.java8
2 files changed, 5 insertions, 9 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 38a4bf9d1..227aeb9e1 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
@@ -452,9 +452,9 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit
QVTiAnalyzer analyzer = getAnalyzer();
CGFunction cgFunction = analyzer.basicGetCGFunction(asFunction);
if (cgFunction == null) {
- CGClass cgClass = analyzer.getCGClass(PivotUtil.getOwningClass(asOperation));
- pushClassNameManager(cgClass);
FunctionOperationCallingConvention callingConvention = (FunctionOperationCallingConvention)context.getCallingConvention(asFunction, true);
+ CGClass cgClass = generateClassDeclaration(PivotUtil.getOwningClass(asOperation), callingConvention.getClassCallingConvention());
+ pushClassNameManager(cgClass);
cgFunction = callingConvention.createCGOperation(this, asSourceType, asFunction);
assert cgFunction.getAst() != null;
assert cgFunction.getCallingConvention() == callingConvention;
@@ -1131,7 +1131,7 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit
CGTransformation cgTransformation = QVTiCGModelFactory.eINSTANCE.createCGTransformation();
cgTransformation.setAst(asTransformation);
globalNameManager.declareGlobalName(cgTransformation, asTransformation.getName());
- analyzer.setCGRootClass(cgTransformation);
+ analyzer.setCGRootClass(cgTransformation); // set TransformationCallingConvention
pushClassNameManager(cgTransformation);
List<CGTypedModel> cgTypedModels = cgTransformation.getOwnedTypedModels();
for (@NonNull TypedModel asTypedModel : QVTimperativeUtil.getModelParameters(asTransformation)) {
diff --git a/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/java/InternalFunctionOperationCallingConvention.java b/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/java/InternalFunctionOperationCallingConvention.java
index 1589cf361..d6b7abcc5 100644
--- a/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/java/InternalFunctionOperationCallingConvention.java
+++ b/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/java/InternalFunctionOperationCallingConvention.java
@@ -17,13 +17,9 @@ import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.ocl.examples.codegen.analyzer.AS2CGVisitor;
import org.eclipse.ocl.examples.codegen.analyzer.BoxingAnalyzer;
import org.eclipse.ocl.examples.codegen.analyzer.CodeGenAnalyzer;
-import org.eclipse.ocl.examples.codegen.calling.CachePropertyCallingConvention;
-import org.eclipse.ocl.examples.codegen.calling.PropertyCallingConvention;
-import org.eclipse.ocl.examples.codegen.cgmodel.CGClass;
import org.eclipse.ocl.examples.codegen.cgmodel.CGOperation;
import org.eclipse.ocl.examples.codegen.cgmodel.CGOperationCallExp;
import org.eclipse.ocl.examples.codegen.cgmodel.CGParameter;
-import org.eclipse.ocl.examples.codegen.cgmodel.CGProperty;
import org.eclipse.ocl.examples.codegen.cgmodel.CGValuedElement;
import org.eclipse.ocl.examples.codegen.java.CG2JavaVisitor;
import org.eclipse.ocl.examples.codegen.java.JavaStream;
@@ -86,7 +82,7 @@ public class InternalFunctionOperationCallingConvention extends FunctionOperatio
CGFunction cgFunction = QVTiCGModelFactory.eINSTANCE.createCGFunction();
analyzer.installOperation(asOperation, cgFunction, this);
- CGClass cgNestedClass = analyzer.createNestedCGClass(asOperation);
+ /*XXX CGClass cgNestedClass = analyzer.createNestedCGClass(as2cgVisitor, asOperation);
for (@NonNull Parameter asParameter : PivotUtil.getOwnedParameters(asOperation)) {
PropertyCallingConvention propertyCallingConventon = CachePropertyCallingConvention.INSTANCE;
CGProperty cgProperty = propertyCallingConventon.createCGProperty(analyzer, asParameter);
@@ -98,7 +94,7 @@ public class InternalFunctionOperationCallingConvention extends FunctionOperatio
cgNestedClass.getProperties().add(cgProperty);
as2cgVisitor.pushNestedNameManager(cgProperty);
as2cgVisitor.popNestedNameManager();
- }
+ } */
return cgFunction;
}

Back to the top