Loading de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/DataFlowValidator.xtend +33 −25 Original line number Diff line number Diff line Loading @@ -59,6 +59,8 @@ import de.ugoe.cs.swe.tTCN3.FdecvalueUnichar import de.ugoe.cs.swe.tTCN3.OpCall import de.ugoe.cs.swe.tTCN3.Expression import de.ugoe.cs.swe.tTCN3.BooleanExpression import de.ugoe.cs.swe.tTCN3.AltstepInstance import de.ugoe.cs.swe.tTCN3.FunctionActualPar class DataFlowValidator extends AbstractDeclarativeValidator { val ConfigTools configTools = ConfigTools.getInstance; Loading Loading @@ -158,8 +160,7 @@ class DataFlowValidator extends AbstractDeclarativeValidator { } //step } else if (b.step !== null) { val bValues = b.step.eAllOfType(ReferencedValue) dfh.checkVariableStatus(bValues.filter[eContainer instanceof Value]) b.step.processAltstepInstance(dfh) } if (b.block !== null) { b.block.traverseChildren(bdfh) Loading Loading @@ -439,6 +440,9 @@ class DataFlowValidator extends AbstractDeclarativeValidator { //not supported } else if (behavior.label !== null) { //not supported } else if (behavior.altstep !== null) { behavior.altstep.processAltstepInstance(dfh) } else { //should cover //cse.behavior.altstep Loading @@ -451,20 +455,28 @@ class DataFlowValidator extends AbstractDeclarativeValidator { } } protected def void processAltstepInstance(AltstepInstance altstep, DataFlowHelper dfh) { println(altstep) if (altstep.list !== null && altstep.ref.params !== null) { altstep.list.params.processParameters(altstep.ref.params.params, dfh) } } protected def void processFunctionInstance(FunctionInstance function, DataFlowHelper dfh) { val r = function.ref; //TODO: also external functions? if (r instanceof FunctionDef) { if (r.parameterList !== null) { function.processParameters(r.parameterList.params, dfh) function.params.params.processParameters(r.parameterList.params, dfh) } } else if (r instanceof ExtFunctionDef) { if (r.list !== null) { function.processParameters(r.list.params, dfh) function.params.params.processParameters(r.list.params, dfh) } } else if (r instanceof AltstepDef) { //TODO: remove? if (r.params !== null) { function.processParameters(r.params.params, dfh) function.params.params.processParameters(r.params.params, dfh) } } else { //handle other cases Loading @@ -473,10 +485,8 @@ class DataFlowValidator extends AbstractDeclarativeValidator { } } protected def void processParameters(FunctionInstance function, EList<FunctionFormalPar> formalParameters, DataFlowHelper dfh) { protected def void processParameters(EList<FunctionActualPar> actualParameters, EList<FunctionFormalPar> formalParameters, DataFlowHelper dfh) { var i = 0; if (function.params!==null) { val actualParameters = function.params.params //actual parameters for (p : actualParameters) { if (p.template!==null) { Loading @@ -496,7 +506,6 @@ class DataFlowValidator extends AbstractDeclarativeValidator { i++; } } } protected def void processInterleavedStatement(InterleavedConstruct interleaved, DataFlowHelper dfh) { val igl = interleaved.eContents.get(0) Loading Loading @@ -547,8 +556,7 @@ class DataFlowValidator extends AbstractDeclarativeValidator { } //step } else if (b.step !== null) { val bValues = b.step.eAllOfType(ReferencedValue) dfh.checkVariableStatus(bValues.filter[eContainer instanceof Value]) b.step.processAltstepInstance(dfh) } if (b.block !== null) { b.block.traverseChildren(bdfh) Loading Loading
de.ugoe.cs.swe.TTCN3/src/de/ugoe/cs/swe/validation/DataFlowValidator.xtend +33 −25 Original line number Diff line number Diff line Loading @@ -59,6 +59,8 @@ import de.ugoe.cs.swe.tTCN3.FdecvalueUnichar import de.ugoe.cs.swe.tTCN3.OpCall import de.ugoe.cs.swe.tTCN3.Expression import de.ugoe.cs.swe.tTCN3.BooleanExpression import de.ugoe.cs.swe.tTCN3.AltstepInstance import de.ugoe.cs.swe.tTCN3.FunctionActualPar class DataFlowValidator extends AbstractDeclarativeValidator { val ConfigTools configTools = ConfigTools.getInstance; Loading Loading @@ -158,8 +160,7 @@ class DataFlowValidator extends AbstractDeclarativeValidator { } //step } else if (b.step !== null) { val bValues = b.step.eAllOfType(ReferencedValue) dfh.checkVariableStatus(bValues.filter[eContainer instanceof Value]) b.step.processAltstepInstance(dfh) } if (b.block !== null) { b.block.traverseChildren(bdfh) Loading Loading @@ -439,6 +440,9 @@ class DataFlowValidator extends AbstractDeclarativeValidator { //not supported } else if (behavior.label !== null) { //not supported } else if (behavior.altstep !== null) { behavior.altstep.processAltstepInstance(dfh) } else { //should cover //cse.behavior.altstep Loading @@ -451,20 +455,28 @@ class DataFlowValidator extends AbstractDeclarativeValidator { } } protected def void processAltstepInstance(AltstepInstance altstep, DataFlowHelper dfh) { println(altstep) if (altstep.list !== null && altstep.ref.params !== null) { altstep.list.params.processParameters(altstep.ref.params.params, dfh) } } protected def void processFunctionInstance(FunctionInstance function, DataFlowHelper dfh) { val r = function.ref; //TODO: also external functions? if (r instanceof FunctionDef) { if (r.parameterList !== null) { function.processParameters(r.parameterList.params, dfh) function.params.params.processParameters(r.parameterList.params, dfh) } } else if (r instanceof ExtFunctionDef) { if (r.list !== null) { function.processParameters(r.list.params, dfh) function.params.params.processParameters(r.list.params, dfh) } } else if (r instanceof AltstepDef) { //TODO: remove? if (r.params !== null) { function.processParameters(r.params.params, dfh) function.params.params.processParameters(r.params.params, dfh) } } else { //handle other cases Loading @@ -473,10 +485,8 @@ class DataFlowValidator extends AbstractDeclarativeValidator { } } protected def void processParameters(FunctionInstance function, EList<FunctionFormalPar> formalParameters, DataFlowHelper dfh) { protected def void processParameters(EList<FunctionActualPar> actualParameters, EList<FunctionFormalPar> formalParameters, DataFlowHelper dfh) { var i = 0; if (function.params!==null) { val actualParameters = function.params.params //actual parameters for (p : actualParameters) { if (p.template!==null) { Loading @@ -496,7 +506,6 @@ class DataFlowValidator extends AbstractDeclarativeValidator { i++; } } } protected def void processInterleavedStatement(InterleavedConstruct interleaved, DataFlowHelper dfh) { val igl = interleaved.eContents.get(0) Loading Loading @@ -547,8 +556,7 @@ class DataFlowValidator extends AbstractDeclarativeValidator { } //step } else if (b.step !== null) { val bValues = b.step.eAllOfType(ReferencedValue) dfh.checkVariableStatus(bValues.filter[eContainer instanceof Value]) b.step.processAltstepInstance(dfh) } if (b.block !== null) { b.block.traverseChildren(bdfh) Loading