Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-05-11 16:17:35 -0400
committerEd Willink2016-05-18 09:17:44 -0400
commit187b5ad74de61061f4b489760be78e873f012431 (patch)
treef7cdf360c8ec81cdcdd6e2fb94b49fdff01c8eaa
parentfd98cd243a0df2dce536ab73fc103fe0ac9e18f2 (diff)
downloadorg.eclipse.qvtd-187b5ad74de61061f4b489760be78e873f012431.tar.gz
org.eclipse.qvtd-187b5ad74de61061f4b489760be78e873f012431.tar.xz
org.eclipse.qvtd-187b5ad74de61061f4b489760be78e873f012431.zip
[486722] Add SYNTHESIS trace option
-rw-r--r--plugins/org.eclipse.qvtd.compiler/.options3
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/common/AbstractQVTc2QVTc.java4
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/MergedMappingRegion.java2
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/SchedulerConstants.java12
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/AbstractQVTr2QVTcRelations.java2
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/InvokedRelationToMappingForEnforcement.java2
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/QVTrToQVTc.java6
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicRegion2Mapping.java2
8 files changed, 20 insertions, 13 deletions
diff --git a/plugins/org.eclipse.qvtd.compiler/.options b/plugins/org.eclipse.qvtd.compiler/.options
index 30500280e..f1d30186a 100644
--- a/plugins/org.eclipse.qvtd.compiler/.options
+++ b/plugins/org.eclipse.qvtd.compiler/.options
@@ -33,3 +33,6 @@ org.eclipse.qvtd.compiler/qvtp2qvts/regionTraversal=false
# Turn on tracing of the polled properties computation
org.eclipse.qvtd.compiler/qvts2qvti/polledProperties=false
+
+# Turn on tracing of the QVTc synthesis
+org.eclipse.qvtd.compiler/qvtr2qvtc/synthesize=false
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/common/AbstractQVTc2QVTc.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/common/AbstractQVTc2QVTc.java
index d7d9081b3..10695a45c 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/common/AbstractQVTc2QVTc.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/common/AbstractQVTc2QVTc.java
@@ -396,7 +396,7 @@ public abstract class AbstractQVTc2QVTc
Resource vResource = variable.eResource();
// assert vResource == eResource;
if (vResource != eResource) {
- System.out.println(variable + " : " + NameUtil.debugFullName(variable) + " not in output resource.");
+ System.err.println(variable + " : " + NameUtil.debugFullName(variable) + " not in output resource.");
vResource = variable.eResource();
}
}
@@ -862,7 +862,7 @@ public abstract class AbstractQVTc2QVTc
EObject eSource = target2source.get(eTarget);
EObject eCopied = debugCopy2source.get(eTarget);
if ((eSource == null) && (eCopied == null)) {
- System.out.println("No source for " + eTarget.eClass().getName() + "@" + Integer.toString(System.identityHashCode(eTarget)) + ":" + eTarget + " / " + eTarget.eContainer().eClass().getName() + "@" + Integer.toString(System.identityHashCode(eTarget.eContainer())));
+ System.err.println("No source for " + eTarget.eClass().getName() + "@" + Integer.toString(System.identityHashCode(eTarget)) + ":" + eTarget + " / " + eTarget.eContainer().eClass().getName() + "@" + Integer.toString(System.identityHashCode(eTarget.eContainer())));
}
}
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/MergedMappingRegion.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/MergedMappingRegion.java
index 59cf9006a..ae12ae776 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/MergedMappingRegion.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/MergedMappingRegion.java
@@ -121,7 +121,7 @@ public class MergedMappingRegion extends AbstractMappingRegion
// createMergedEdge(edge.getSource(), edge, edge.getTarget()); -- recomputed
}
else {
- System.out.println("Unmerged edge" + edge);
+ System.err.println("Unmerged edge" + edge);
}
}
}
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 16559d2b3..01cfa4d94 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
@@ -403,7 +403,7 @@ public abstract class SchedulerConstants
outputStream.write(s.toString().getBytes());
outputStream.close();
} catch (IOException e) {
- System.out.println("Failed to generate '" + dotURI + "' : " + e.getLocalizedMessage());
+ System.err.println("Failed to generate '" + dotURI + "' : " + e.getLocalizedMessage());
}
}
@@ -417,7 +417,7 @@ public abstract class SchedulerConstants
outputStream.write(s.toString().getBytes());
outputStream.close();
} catch (IOException e) {
- System.out.println("Failed to generate '" + dotURI + "' : " + e.getLocalizedMessage());
+ System.err.println("Failed to generate '" + dotURI + "' : " + e.getLocalizedMessage());
}
}
@@ -431,7 +431,7 @@ public abstract class SchedulerConstants
outputStream.write(s.toString().getBytes());
outputStream.close();
} catch (IOException e) {
- System.out.println("Failed to generate '" + dotURI + "' : " + e.getLocalizedMessage());
+ System.err.println("Failed to generate '" + dotURI + "' : " + e.getLocalizedMessage());
}
}
@@ -445,7 +445,7 @@ public abstract class SchedulerConstants
outputStream.write(s.toString().getBytes());
outputStream.close();
} catch (IOException e) {
- System.out.println("Failed to generate '" + dotURI + "' : " + e.getLocalizedMessage());
+ System.err.println("Failed to generate '" + dotURI + "' : " + e.getLocalizedMessage());
}
}
@@ -459,7 +459,7 @@ public abstract class SchedulerConstants
outputStream.write(s.toString().getBytes());
outputStream.close();
} catch (IOException e) {
- System.out.println("Failed to generate '" + dotURI + "' : " + e.getLocalizedMessage());
+ System.err.println("Failed to generate '" + dotURI + "' : " + e.getLocalizedMessage());
}
for (@NonNull Region nestedRegion : region.getRegions()) {
if (nestedRegion instanceof ScheduledRegion) {
@@ -478,7 +478,7 @@ public abstract class SchedulerConstants
outputStream.write(s.toString().getBytes());
outputStream.close();
} catch (IOException e) {
- System.out.println("Failed to generate '" + dotURI + "' : " + e.getLocalizedMessage());
+ System.err.println("Failed to generate '" + dotURI + "' : " + e.getLocalizedMessage());
}
for (@NonNull Region nestedRegion : region.getRegions()) {
if (nestedRegion instanceof ScheduledRegion) {
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/AbstractQVTr2QVTcRelations.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/AbstractQVTr2QVTcRelations.java
index 88d676698..25dc67a8b 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/AbstractQVTr2QVTcRelations.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/AbstractQVTr2QVTcRelations.java
@@ -365,7 +365,7 @@ import org.eclipse.qvtd.pivot.qvttemplate.TemplateExp;
}
protected void addPredicate(@NonNull CorePattern cCorePattern, @NonNull OCLExpression cExpression) {
- System.out.println("addPredicate " + cExpression);
+ QVTrToQVTc.SYNTHESIS.println("addPredicate " + cExpression);
Predicate cPredicate = createPredicate(cExpression);
cCorePattern.getPredicate().add(cPredicate);
}
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/InvokedRelationToMappingForEnforcement.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/InvokedRelationToMappingForEnforcement.java
index 23b17b7b6..a229f4086 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/InvokedRelationToMappingForEnforcement.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/InvokedRelationToMappingForEnforcement.java
@@ -149,7 +149,7 @@ import org.eclipse.qvtd.pivot.qvttemplate.TemplateExp;
// check() {
@NonNull List<@NonNull InvokedEnforceableRelationDomain2CoreMapping> enforceableRelationDomain2coreMappings = new ArrayList<@NonNull InvokedEnforceableRelationDomain2CoreMapping>();
for (@NonNull RelationCallExp rInvocation : qvtr2qvtc.getRelationCallExpsForRelation(rRelation)) {
- System.out.println("invocation" + rRelation + " from " + rInvocation);
+ QVTrToQVTc.SYNTHESIS.println("invocation of " + rRelation + " from " + rInvocation);
for (@NonNull Domain rDomain : ClassUtil.nullFree(rRelation.getDomain())) {
if (rDomain.isIsEnforceable()) {
RelationDomain rEnforcedDomain = (RelationDomain)rDomain;
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/QVTrToQVTc.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/QVTrToQVTc.java
index b467ea452..ee9a51a49 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/QVTrToQVTc.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/QVTrToQVTc.java
@@ -67,8 +67,10 @@ import org.eclipse.ocl.pivot.util.DerivedConstants;
import org.eclipse.ocl.pivot.utilities.ClassUtil;
import org.eclipse.ocl.pivot.utilities.EnvironmentFactory;
import org.eclipse.ocl.pivot.utilities.NameUtil;
+import org.eclipse.ocl.pivot.utilities.TracingOption;
import org.eclipse.qvtd.compiler.CompilerChain;
import org.eclipse.qvtd.compiler.CompilerChainException;
+import org.eclipse.qvtd.compiler.CompilerConstants;
import org.eclipse.qvtd.compiler.internal.utilities.CompilerUtil;
import org.eclipse.qvtd.pivot.qvtbase.Domain;
import org.eclipse.qvtd.pivot.qvtbase.Pattern;
@@ -98,6 +100,8 @@ import org.eclipse.qvtd.pivot.qvttemplate.TemplateExp;
public class QVTrToQVTc
{
+ public static final @NonNull TracingOption SYNTHESIS = new TracingOption(CompilerConstants.PLUGIN_ID, "qvtr2qvtc/synthesis");
+
private class Issues {
public void addError(QVTrToQVTc qvTrToQVTc, String message,
@@ -708,7 +712,7 @@ public class QVTrToQVTc
if (rule instanceof Relation) {
Relation rRelation = (Relation)rule;
if (rRelation.isIsTopLevel()) {
- System.out.println("topLevel " + rRelation);
+ QVTrToQVTc.SYNTHESIS.println("topLevel " + rRelation);
TopLevelRelationToMappingForEnforcement topLevelRelationToMappingForEnforcement = new TopLevelRelationToMappingForEnforcement(this, rRelation);
topLevelRelationToMappingForEnforcement.doTopLevelRelationToMappingForEnforcement();
}
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 573e68b5f..db66021fb 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
@@ -490,7 +490,7 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
return PivotUtil.createVariableExp(iVariable);
}
else {
- System.out.println("Creating unexpected variable for " + pVariable + " in " + region);
+ System.err.println("Creating unexpected variable for " + pVariable + " in " + region);
BottomPattern bottomPattern = mapping.getBottomPattern();
assert bottomPattern != null;
Type variableType = pVariable.getType();

Back to the top