Search in sources :

Example 1 with ErrorModelLibrary

use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelLibrary in project osate2 by osate.

the class EMV2RootImpl method basicSetLibrary.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetLibrary(ErrorModelLibrary newLibrary, NotificationChain msgs) {
    ErrorModelLibrary oldLibrary = library;
    library = newLibrary;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ErrorModelPackage.EMV2_ROOT__LIBRARY, oldLibrary, newLibrary);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ErrorModelLibrary(org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelLibrary) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 2 with ErrorModelLibrary

use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelLibrary in project osate2 by osate.

the class ErrorModelValidator method checkUniqueInheritedDefiningErrorTypes.

private void checkUniqueInheritedDefiningErrorTypes(ErrorModelLibrary etl, Hashtable<String, EObject> types) {
    for (ErrorTypes et : etl.getTypes()) {
        if (types.containsKey(et.getName())) {
            EObject source = types.get(et.getName());
            ErrorModelLibrary eml = EMV2Util.getContainingErrorModelLibrary(et);
            error(source, "Error type or type set (alias) " + et.getName() + " inherited from " + EMV2Util.getPrintName(eml) + " conflicts with another defining identifier in error type library");
        }
        types.put(et.getName(), et);
    }
    for (ErrorModelLibrary xetl : etl.getExtends()) {
        checkUniqueInheritedDefiningErrorTypes(xetl, types);
    }
}
Also used : ErrorModelLibrary(org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelLibrary) EObject(org.eclipse.emf.ecore.EObject) ErrorTypes(org.osate.xtext.aadl2.errormodel.errorModel.ErrorTypes)

Example 3 with ErrorModelLibrary

use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelLibrary in project osate2 by osate.

the class ErrorModelValidator method checkUniqueDefiningIdentifiers.

private void checkUniqueDefiningIdentifiers(ErrorModelLibrary etl, boolean cyclicextends) {
    Hashtable<String, EObject> types = new Hashtable<String, EObject>(10, 10);
    checkUniqueDefiningEBSMMappingsTransformations(etl, types);
    if (cyclicextends) {
        return;
    }
    for (ErrorModelLibrary xetl : etl.getExtends()) {
        checkUniqueInheritedDefiningErrorTypes(xetl, types);
    }
}
Also used : ErrorModelLibrary(org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelLibrary) Hashtable(java.util.Hashtable) EObject(org.eclipse.emf.ecore.EObject)

Example 4 with ErrorModelLibrary

use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelLibrary in project osate2 by osate.

the class EMV2TypeSetUtil method getAllLeafSubTypes.

/**
 * get list of leaf subtypes of the given error type et excluding et itself
 * Each any error type alias has been resolved
 * @param context
 * @param et
 * @return
 */
public static EList<ErrorType> getAllLeafSubTypes(ErrorType et, List<ErrorModelLibrary> usetypes) {
    EList<ErrorType> result = new UniqueEList<ErrorType>();
    EList<ErrorType> removeMe = new UniqueEList<ErrorType>();
    for (ErrorModelLibrary etl : usetypes) {
        EList<ErrorType> typeslist = etl.getTypes();
        for (ErrorType errorType : typeslist) {
            ErrorType set = EMV2Util.resolveAlias(errorType);
            if (contains(et, set)) {
                result.add(set);
            }
            if (set.getSuperType() != null) {
                removeMe.add(set.getSuperType());
            }
        }
    }
    result.removeAll(removeMe);
    return result;
}
Also used : ErrorType(org.osate.xtext.aadl2.errormodel.errorModel.ErrorType) ErrorModelLibrary(org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelLibrary) UniqueEList(org.eclipse.emf.common.util.UniqueEList)

Example 5 with ErrorModelLibrary

use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelLibrary in project osate2 by osate.

the class EMV2TypeSetUtil method getAllLeafSubTypes.

public static EList<ErrorType> getAllLeafSubTypes(ErrorType et, ErrorModelLibrary el) {
    EList<ErrorType> result = new UniqueEList<ErrorType>();
    EList<ErrorType> removeMe = new UniqueEList<ErrorType>();
    Iterable<ErrorType> typeslist = ErrorModelUtil.getAllErrorTypes(el);
    for (ErrorType errorType : typeslist) {
        ErrorType set = EMV2Util.resolveAlias(errorType);
        if (contains(et, set) && (et != set)) {
            result.add(set);
        }
        if (set.getSuperType() != null) {
            removeMe.add(set.getSuperType());
        }
    }
    result.removeAll(removeMe);
    return result;
}
Also used : ErrorType(org.osate.xtext.aadl2.errormodel.errorModel.ErrorType) UniqueEList(org.eclipse.emf.common.util.UniqueEList)

Aggregations

ErrorModelLibrary (org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelLibrary)14 ErrorType (org.osate.xtext.aadl2.errormodel.errorModel.ErrorType)8 TypeSet (org.osate.xtext.aadl2.errormodel.errorModel.TypeSet)4 UniqueEList (org.eclipse.emf.common.util.UniqueEList)3 EObject (org.eclipse.emf.ecore.EObject)3 Hashtable (java.util.Hashtable)2 AadlPackage (org.osate.aadl2.AadlPackage)2 ErrorModelSubclause (org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelSubclause)2 ErrorTypes (org.osate.xtext.aadl2.errormodel.errorModel.ErrorTypes)2 TypeToken (org.osate.xtext.aadl2.errormodel.errorModel.TypeToken)2 BasicEList (org.eclipse.emf.common.util.BasicEList)1 EPackage (org.eclipse.emf.ecore.EPackage)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1 Resource (org.eclipse.emf.ecore.resource.Resource)1 FormAttachment (org.eclipse.swt.layout.FormAttachment)1 FormData (org.eclipse.swt.layout.FormData)1 Composite (org.eclipse.swt.widgets.Composite)1 Action (org.eclipse.xtext.Action)1 Parameter (org.eclipse.xtext.Parameter)1 ParserRule (org.eclipse.xtext.ParserRule)1