Skip to content
Snippets Groups Projects
Commit f45551db authored by Florian's avatar Florian
Browse files

fixed transform pattern when multiple transform pipes are directly corrected with each other

parent 80b15868
No related branches found
No related tags found
No related merge requests found
...@@ -44,13 +44,13 @@ ...@@ -44,13 +44,13 @@
// Create Configuration nodes // Create Configuration nodes
MERGE (assignTemp:Assignment {operation: "new", MERGE (assignTemp:Assignment {operation: "new",
var: "%{temp$0}", var: "%{temp$}" + id(function),
vartype: function.vartype, vartype: function.vartype,
type: "Assignment", type: "Assignment",
rightValue: function.rightValue, rightValue: function.rightValue,
displayname: "%{temp$0} = " + function.rightValue}) displayname: "%{temp$}"+ id(function) + " = " + function.rightValue})
-[:CONTROL_FLOW]-> -[:CONTROL_FLOW]->
(initNode:MethodCall:ConstructorCall {caller: "%{temp$0}", (initNode:MethodCall:ConstructorCall {caller: assignTemp.var,
fqn: function.vartype + ".<init>()", fqn: function.vartype + ".<init>()",
name:"<init>", name:"<init>",
type:"MethodCall", type:"MethodCall",
...@@ -60,22 +60,22 @@ ...@@ -60,22 +60,22 @@
displayname: "<init>()"}) displayname: "<init>()"})
-[:CONTROL_FLOW]-> -[:CONTROL_FLOW]->
(assignValue:Assignment {operation: "value", (assignValue:Assignment {operation: "value",
var: "%{stage$0}", var: "%{stage$}" + id(function),
vartype: function.vartype, vartype: function.vartype,
isdeclaration: true, isdeclaration: true,
type: "Assignment", type: "Assignment",
rightValue: "%{temp$0}", rightValue: assignTemp.var,
displayname: "%{stage$0} = %{temp$0}"}) displayname: "%{stage$}"+ id(function) +" = " + assignTemp.var})
// Create InputPort // Create InputPort
MERGE (inputPort:Assignment:MethodCall {caller: assignValue.var, CREATE (inputPort:Assignment:MethodCall {caller: assignValue.var,
fqn: "teetime.framework.AbstractConsumerStage.getInputPort()", fqn: "teetime.framework.AbstractConsumerStage.getInputPort()",
operation: "MethodCall", operation: "MethodCall",
var: "%{temp$5}", var: "%{temp$5}",
name: "getInputPort", name: "getInputPort",
vartype: "teetime.framework.InputPort", vartype: "teetime.framework.InputPort",
type: "Assignment", type: "Assignment",
rightValue: "virtualinvoke %{stage$0}.<" + functionClass.fqn + ": teetime.framework.InputPort getInputPort()>()", rightValue: "virtualinvoke "+ assignValue.var + ".<" + functionClass.fqn + ": teetime.framework.InputPort getInputPort()>()",
args: [], args: [],
argumentscount: "0", argumentscount: "0",
displayname: "%{temp$5} = getInputPort()", displayname: "%{temp$5} = getInputPort()",
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
displayname: "%{temp$6} = (teetime.framework.InputPort) %{temp$5}" }) displayname: "%{temp$6} = (teetime.framework.InputPort) %{temp$5}" })
// Create OutputPort // Create OutputPort
MERGE (outputPort:Assignment:MethodCall {caller: assignValue.var, CREATE (outputPort:Assignment:MethodCall {caller: assignValue.var,
fqn: functionClass.fqn + ".getOutputPort()", fqn: functionClass.fqn + ".getOutputPort()",
operation: "MethodCall", operation: "MethodCall",
var: "%{temp$7}", var: "%{temp$7}",
...@@ -110,6 +110,9 @@ ...@@ -110,6 +110,9 @@
nopkind:"Pipe"}) nopkind:"Pipe"})
-[:CONTROL_FLOW]-> -[:CONTROL_FLOW]->
(successor) (successor)
MERGE (functionPipe)-[:IS_TRANSFORMED_THROUGH_START]->(nopCS)
MERGE (endPipe)-[:IS_TRANSFORMED_THROUGH_END]->(nopCS)
MERGE (nopCS)-[:HAS_CONFIGURATION]->(assignTemp) MERGE (nopCS)-[:HAS_CONFIGURATION]->(assignTemp)
MERGE (nopCS)-[:INPUTPORT_START]->(inputPort) MERGE (nopCS)-[:INPUTPORT_START]->(inputPort)
MERGE (nopCS)-[:INPUTPORT_END]->(inputPortCast) MERGE (nopCS)-[:INPUTPORT_END]->(inputPortCast)
...@@ -267,8 +270,10 @@ ...@@ -267,8 +270,10 @@
displayname: "return" } displayname: "return" }
// Delete pipe // Delete pipe
WITH functionPipe, endPipe WITH functionPipe, endPipe, nopCS, predecessor
MATCH pipe = (functionPipe)-[*]->(endPipe) MATCH pipe = (functionPipe)-[*]->(endPipe)
OPTIONAL MATCH (predecessor)-[:IS_TRANSFORMED_THROUGH_END]->(preNop)
MERGE (preNop)-[:CONTROL_FLOW]->(nopCS)
FOREACH (n IN nodes(pipe) | DETACH DELETE n) FOREACH (n IN nodes(pipe) | DETACH DELETE n)
]]> ]]>
</query> </query>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment