Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-10-28 16:46:36 +0000
committerEd Willink2016-10-29 17:36:23 +0000
commitfc51f84c752a9386aba8adee9e22cc4b726da219 (patch)
tree4fdd07ffd858df4c4a39a9f79c66113ffbf55668
parentfb0d96788c5b635bdd9eab8ddffe6196c67e82ec (diff)
downloadorg.eclipse.qvtd-fc51f84c752a9386aba8adee9e22cc4b726da219.tar.gz
org.eclipse.qvtd-fc51f84c752a9386aba8adee9e22cc4b726da219.tar.xz
org.eclipse.qvtd-fc51f84c752a9386aba8adee9e22cc4b726da219.zip
[506716] Hide QVTp2QVTg completely
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/QVTp2QVTs.java10
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/SchedulerConstants.java45
2 files changed, 16 insertions, 39 deletions
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/QVTp2QVTs.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/QVTp2QVTs.java
index f5622e34a..a71469a32 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/QVTp2QVTs.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/QVTp2QVTs.java
@@ -40,7 +40,6 @@ import org.eclipse.qvtd.pivot.qvtbase.Transformation;
import org.eclipse.qvtd.pivot.schedule.AbstractAction;
import org.eclipse.qvtd.pivot.schedule.ClassDatum;
import org.eclipse.qvtd.pivot.schedule.MappingAction;
-import org.eclipse.qvtd.pivot.schedule.utilities.DependencyUtil;
public class QVTp2QVTs extends SchedulerConstants
{
@@ -67,17 +66,9 @@ public class QVTp2QVTs extends SchedulerConstants
*/
private final @NonNull Map<@NonNull AbstractAction, @NonNull BasicMappingRegion> action2mappingRegion = new HashMap<>();
- private final @NonNull List<@NonNull AbstractAction> orderedActions;
-
public QVTp2QVTs(@NonNull ProblemHandler problemHandler, @NonNull EnvironmentFactory environmentFactory, @NonNull Transformation asTransformation) {
super(environmentFactory, asTransformation);
this.problemHandler = problemHandler;
- DependencyUtil.NaturalOrderer orderer = new DependencyUtil.NaturalOrderer(getDependencyGraph());
- List<@NonNull AbstractAction> orderedActions = orderer.computeOrdering(); // FIXME ??is this ordering still needed??
- if (orderedActions == null) {
- throw new IllegalArgumentException(orderer.diagnoseOrderingFailure());
- }
- this.orderedActions = orderedActions;
}
private Map<@NonNull OperationDatum, @NonNull OperationRegion> map = new HashMap<>();
@@ -326,6 +317,7 @@ public class QVTp2QVTs extends SchedulerConstants
public @NonNull MultiRegion transform() throws IOException {
MultiRegion multiRegion = new MultiRegion(this);
+ List<@NonNull AbstractAction> orderedActions = getOrderedActions();
//
// Extract salient characteristics from within each MappingAction.
//
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/SchedulerConstants.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/SchedulerConstants.java
index 47a2723a5..9383484c2 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/SchedulerConstants.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/SchedulerConstants.java
@@ -49,10 +49,10 @@ import org.eclipse.qvtd.pivot.qvtcore.analysis.DomainUsageAnalysis;
import org.eclipse.qvtd.pivot.qvtcore.analysis.QVTcoreDomainUsageAnalysis;
import org.eclipse.qvtd.pivot.qvtcore.analysis.RootDomainUsageAnalysis;
import org.eclipse.qvtd.pivot.qvtimperative.utilities.QVTimperativeUtil;
-import org.eclipse.qvtd.pivot.schedule.AbstractDatum;
+import org.eclipse.qvtd.pivot.schedule.AbstractAction;
import org.eclipse.qvtd.pivot.schedule.ClassDatum;
-import org.eclipse.qvtd.pivot.schedule.PropertyDatum;
import org.eclipse.qvtd.pivot.schedule.Schedule;
+import org.eclipse.qvtd.pivot.schedule.utilities.DependencyUtil;
public abstract class SchedulerConstants
{
@@ -90,7 +90,7 @@ public abstract class SchedulerConstants
/**
* The DependencyGraph to be analyzed
*/
- private final @NonNull Schedule dependencyGraph;
+ // private final @NonNull Schedule zdependencyGraph;
@SuppressWarnings("unused")
private final @NonNull DomainUsage inputUsage;
@@ -110,11 +110,6 @@ public abstract class SchedulerConstants
private final @NonNull Map<ClassDatum, ClassDatumAnalysis> classDatum2classDatumAnalysis = new HashMap<ClassDatum, ClassDatumAnalysis>();
/**
- * The PropertyDatum for each property. // FIXME domains
- */
- private final @NonNull Map<Property, PropertyDatum> property2propertyDatum = new HashMap<Property, PropertyDatum>();
-
- /**
* Property used as a navigation to cast to a specific type.
*/
private final @NonNull Map<Type, Property> type2castProperty = new HashMap<Type, Property>();
@@ -136,6 +131,8 @@ public abstract class SchedulerConstants
private /*@LazyNonNull */ DependencyAnalyzer dependencyAnalyzer = null;
+ private final @NonNull List<@NonNull AbstractAction> orderedActions;
+
protected SchedulerConstants(@NonNull EnvironmentFactory environmentFactory, @NonNull Transformation asTransformation) {
this.environmentFactory = environmentFactory;
this.transformation = asTransformation;
@@ -143,7 +140,7 @@ public abstract class SchedulerConstants
this.domainAnalysis = new QVTcoreDomainUsageAnalysis(environmentFactory);
domainAnalysis.analyzeTransformation(asTransformation);
this.qvtp2qvtg = new QVTp2QVTg(domainAnalysis, classRelationships);
- this.dependencyGraph = qvtp2qvtg.transformTransformation(asTransformation);
+ Schedule dependencyGraph = qvtp2qvtg.transformTransformation(asTransformation);
//
this.inputUsage = domainAnalysis.getInputUsage();
// int outputMask = ((DomainUsage.Internal)domainAnalysis.getOutputUsage()).getMask();
@@ -177,24 +174,12 @@ public abstract class SchedulerConstants
assert candidateOclContainerProperty != null : "OCL Standard Librarty has no OclElement::oclContainer property";
oclContainerProperty = candidateOclContainerProperty;
//
- // Extract salient characteristics from the DependencyGraph.
- //
- analyzeDatums(ClassUtil.nullFree(dependencyGraph.getDatums()));
- }
-
- private void analyzeDatums(/*@NonNull*/ List<@NonNull ? extends AbstractDatum> datums) {
- for (@NonNull AbstractDatum abstractDatum : datums) {
- if (abstractDatum instanceof ClassDatum) {
- ClassDatum classDatum = (ClassDatum)abstractDatum;
- // class2classDatum.put(classDatum.getType(), classDatum);
- analyzeDatums(ClassUtil.nullFree(classDatum.getPropertyDatums()));
- }
- else if (abstractDatum instanceof PropertyDatum) {
- PropertyDatum propertyDatum = (PropertyDatum)abstractDatum;
- property2propertyDatum.put(propertyDatum.getProperty(), propertyDatum);
- }
- analyzeDatums(ClassUtil.nullFree(abstractDatum.getSub()));
+ DependencyUtil.NaturalOrderer orderer = new DependencyUtil.NaturalOrderer(dependencyGraph);
+ List<@NonNull AbstractAction> orderedActions = orderer.computeOrdering(); // FIXME ??is this ordering still needed??
+ if (orderedActions == null) {
+ throw new IllegalArgumentException(orderer.diagnoseOrderingFailure());
}
+ this.orderedActions = orderedActions;
}
protected abstract @NonNull ClassDatumAnalysis createClassDatumAnalysis(@NonNull ClassDatum classDatum);
@@ -295,10 +280,6 @@ public abstract class SchedulerConstants
return dependencyAnalyzer2;
}
- public @NonNull Schedule getDependencyGraph() {
- return dependencyGraph;
- }
-
public @NonNull RootDomainUsageAnalysis getDomainAnalysis() {
return domainAnalysis;
}
@@ -357,6 +338,10 @@ public abstract class SchedulerConstants
return oclVoidClassDatumAnalysis;
}
+ protected @NonNull List<@NonNull AbstractAction> getOrderedActions() {
+ return orderedActions;
+ }
+
public @NonNull StandardLibrary getStandardLibrary() {
return environmentFactory.getStandardLibrary();
}

Back to the top