Commit bc91034c authored by Sudeep Kanav's avatar Sudeep Kanav
Browse files

YELLOW



Issue-Ref: 3631
Signed-off-by: Sudeep Kanav's avatarSudeep Kanav <kanav@fortiss.org>
parent 88c5a085
......@@ -5,7 +5,7 @@ CodeSpecPrepareRemoveMultipleAssignments.java 795880e1dd95d0a579572c435a9c4647fb
CodeSpecPrepareToIfElseBlock.java a4a0300700fa7c3f11bb0b0a9d06f7392026bfe4 GREEN
CodeSpecPrepareToIfSequence.java aa91a979a9c9ec4bbe92976fc6f94f7a0921f4ae GREEN
CopyProject.java 222c9f6e3adb6d6df48900604a7e76a6d079132f GREEN
FlattenVariableDefs.java f47dcb6ad607b2b0d6ee8825bc33a567725cb2ba GREEN
FlattenVariableDefs.java 5bb7a8810d31c203878b048f5eaee001e181a4b6 YELLOW
MultiValuedMap.java 9a92088a5d39dab3e64dfbb05db0507cb6e89b9a GREEN
NamesTransformation.java d499765e1d165be02536fd671c9af1f4ca170c03 GREEN
ResolveNoVal.java 072925bb14e304611ced7b862b84ea48b0334839 GREEN
......
ArrayToStructureExpressions.java 651b3fb4b48e878f52c6897c9ceaa1e3d3c692ff GREEN
ArrayTypeToStructureType.java adf2e192842255a1d71a4e409bb2d043c6688256 GREEN
FlattenStructureExpression.java 3d102f788943574eae5151c6363b5b11841ca1c9 GREEN
FlattenStructureExpression.java cd544800b3c5832350f522b13ac0b386c780a021 YELLOW
FunctionToSingleStatementFunction.java 658e81eb6f9f932ffd39da09c7eccfa92f5ecbeb GREEN
RemoveStructureFromExpression.java 4aa25fdef0dc1ba67749d3da8229f94927e7f5d6 GREEN
AddActionsForUnassignedPorts.java f3a8d4fada500c58d83bccfa31ca8c774b27312a GREEN
CodeSpecificationToStateAutomata.java b4264acdd95d0ecfc16a2786e886d6c57153196b GREEN
CopyProject.java dec8da4729fa863baab65f6fc05c2dfcc7c7305d GREEN
FlattenStructureExpression.java e8b7c3c0f2c5569ad2833fb3ca7ab5151960685c GREEN
FlattenStructureExpression.java 38e415da90a1e53a324b68d845343193cf282c0b YELLOW
ResolveNoVal.java c63e44f451c8c022a8796c8410b66e69b1345b93 GREEN
StronglyCausalToWeaklyCausalComponent.java 4a107a83f39f48a29b00b72cde0e36808a07f028 GREEN
ToNuSMVStateAutomatonWeaklyCausal.java d1948ba998c72423e62555467698c27faf4cf58c GREEN
......@@ -15,17 +15,18 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.state.generator.nusmv;
import static org.eclipse.emf.ecore.util.EcoreUtil.replace;
import static org.fortiss.af3.component.utils.BehaviorModelElementFactory.createAction;
import static org.fortiss.af3.expression.utils.ExpressionUtils.getTypeDefinition;
import static org.fortiss.af3.expression.utils.ExpressionUtils.reduceMemberAccess;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.copy;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType;
import static org.fortiss.tooling.kernel.utils.UniqueIDUtils.generateMissingIDs;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.fortiss.af3.component.model.behavior.common.Action;
import org.fortiss.af3.expression.model.definitions.FunctionDefinition;
import org.fortiss.af3.expression.model.definitions.Structure;
......@@ -45,7 +46,7 @@ import org.fortiss.tooling.kernel.utils.UniqueIDUtils;
*
* @author kanav
*/
// TODO 8044 Not happy with this at all. To revisit after iterative transformation is fixed.
// TODO 3647 Not happy with this at all. To revisit after iterative transformation is fixed.
public class FlattenStructureExpression extends CacheSupportedTransformationBase {
/** {@inheritDoc} */
......@@ -54,14 +55,13 @@ public class FlattenStructureExpression extends CacheSupportedTransformationBase
if(c instanceof FileProject) {
boolean toBeIteratedAgain = false;
FileProject fp = ((FileProject)c);
// TODO not happy with the 3 for loops. Have to come up with a better idea for
// toBeIteratedAgain variable.
// TODO 3647 Following 3 loops are just ugly implementation to make the feature work.
for(FunctionCall fc : getChildrenWithType(fp, FunctionCall.class)) {
Object t = deferredTransformation.buildTransformation(fc);
toBeIteratedAgain = toBeIteratedAgain || (t != null);
if(t != null && t instanceof FunctionCall)
EcoreUtil.replace(fc, (EObject)t);
replace(fc, (EObject)t);
}
for(FunctionDefinition fd : getChildrenWithType(fp, FunctionDefinition.class)) {
......@@ -76,7 +76,7 @@ public class FlattenStructureExpression extends CacheSupportedTransformationBase
toBeIteratedAgain = toBeIteratedAgain || (t != null);
}
UniqueIDUtils.generateMissingIDs(fp, UniqueIDUtils.getLargestID(fp));
generateMissingIDs(fp, UniqueIDUtils.getLargestID(fp));
return toBeIteratedAgain ? c : null;
} else if(c instanceof Action && checkStructureAssignment((Action)c)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment