Search in sources :

Example 16 with BlockImpl

use of verdict.vdm.vdm_model.BlockImpl in project VERDICT by ge-high-assurance.

the class VDMInstrumentor method retrieve_cmp_impl.

// protected ComponentImpl retrieve_cmp_impl(ComponentType componentType) {
// ComponentImpl componentImpl = null;
// for (ComponentImpl cImpl : vdm_model.getComponentImpl()) {
// ComponentType cmpType = cImpl.getType();
// if (cmpType.getId().equalsIgnoreCase(componentType.getId())) {
// componentImpl = cImpl;
// }
// }
// return componentImpl;
// }
protected ComponentImpl retrieve_cmp_impl(String componentID) {
    ComponentImpl componentImpl = null;
    BlockImpl blockImpl = null;
    for (ComponentImpl cImpl : vdm_model.getComponentImpl()) {
        if (cImpl.getBlockImpl() != null) {
            blockImpl = cImpl.getBlockImpl();
            for (ComponentInstance cmpInstance : blockImpl.getSubcomponent()) {
                ComponentImpl impl = cmpInstance.getImplementation();
                ComponentType enumType = null;
                if (impl != null) {
                    enumType = impl.getType();
                } else {
                    enumType = cmpInstance.getSpecification();
                }
                if (componentID.equals(enumType.getId())) {
                    componentImpl = cImpl;
                    return cImpl;
                }
            }
        }
    }
    return componentImpl;
}
Also used : BlockImpl(verdict.vdm.vdm_model.BlockImpl) ComponentType(verdict.vdm.vdm_model.ComponentType) ComponentInstance(verdict.vdm.vdm_model.ComponentInstance) ComponentImpl(verdict.vdm.vdm_model.ComponentImpl)

Example 17 with BlockImpl

use of verdict.vdm.vdm_model.BlockImpl in project VERDICT by ge-high-assurance.

the class VDM2Lustre method retrieve_block.

protected BlockImpl retrieve_block(ComponentImpl compImpl) {
    BlockImpl blockImpl = null;
    String cmpID = compImpl.getType().getId();
    for (ComponentImpl cmpImpl : vdm_model.getComponentImpl()) {
        if (cmpImpl.getBlockImpl() != null) {
            blockImpl = cmpImpl.getBlockImpl();
            for (ComponentInstance cmpInstance : blockImpl.getSubcomponent()) {
                ComponentImpl impl = cmpInstance.getImplementation();
                ComponentType enumType = null;
                if (impl != null) {
                    enumType = impl.getType();
                } else {
                    enumType = cmpInstance.getSpecification();
                }
                if (cmpID.equals(enumType.getId())) {
                    return blockImpl;
                }
            }
        }
    }
    return blockImpl;
}
Also used : BlockImpl(verdict.vdm.vdm_model.BlockImpl) ComponentType(verdict.vdm.vdm_model.ComponentType) ComponentInstance(verdict.vdm.vdm_model.ComponentInstance) ComponentImpl(verdict.vdm.vdm_model.ComponentImpl)

Aggregations

BlockImpl (verdict.vdm.vdm_model.BlockImpl)17 ComponentImpl (verdict.vdm.vdm_model.ComponentImpl)17 ComponentInstance (verdict.vdm.vdm_model.ComponentInstance)17 ComponentType (verdict.vdm.vdm_model.ComponentType)16 HashSet (java.util.HashSet)9 GenericAttribute (verdict.vdm.vdm_data.GenericAttribute)8 Connection (verdict.vdm.vdm_model.Connection)5 CompInstancePort (verdict.vdm.vdm_model.CompInstancePort)3 Port (verdict.vdm.vdm_model.Port)3 PortMode (verdict.vdm.vdm_model.PortMode)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 DataType (verdict.vdm.vdm_data.DataType)1 ConstantDeclaration (verdict.vdm.vdm_lustre.ConstantDeclaration)1 ContractItem (verdict.vdm.vdm_lustre.ContractItem)1 ContractSpec (verdict.vdm.vdm_lustre.ContractSpec)1 Expression (verdict.vdm.vdm_lustre.Expression)1 LustreProgram (verdict.vdm.vdm_lustre.LustreProgram)1 NodeBody (verdict.vdm.vdm_lustre.NodeBody)1