Search in sources :

Example 41 with ListValue

use of com.google.api.expr.v1alpha1.ListValue in project osate2 by osate.

the class ProgrammingProperties method getSupportedSourceLanguage.

public static Optional<List<SupportedSourceLanguages>> getSupportedSourceLanguage(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getSupportedSourceLanguage_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(((ListValue) resolved).getOwnedListElements().stream().map(element1 -> {
            PropertyExpression resolved1 = CodeGenUtil.resolveNamedValue(element1, lookupContext, mode);
            return SupportedSourceLanguages.valueOf(resolved1);
        }).collect(Collectors.toList()));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) ListValue(org.osate.aadl2.ListValue) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 42 with ListValue

use of com.google.api.expr.v1alpha1.ListValue in project osate2 by osate.

the class AadlProject method getSupportedTypeConversions.

public static List<List<Classifier>> getSupportedTypeConversions(EObject lookupContext) {
    PropertyConstant constant = getSupportedTypeConversions_PropertyConstant(lookupContext);
    PropertyExpression resolved = CodeGenUtil.resolveNamedValue(constant.getConstantValue());
    return ((ListValue) resolved).getOwnedListElements().stream().map(element1 -> {
        PropertyExpression resolved1 = CodeGenUtil.resolveNamedValue(element1);
        return ((ListValue) resolved1).getOwnedListElements().stream().map(element2 -> {
            PropertyExpression resolved2 = CodeGenUtil.resolveNamedValue(element2);
            return ((ClassifierValue) resolved2).getClassifier();
        }).collect(Collectors.toList());
    }).collect(Collectors.toList());
}
Also used : ClassifierValue(org.osate.aadl2.ClassifierValue) ListValue(org.osate.aadl2.ListValue) IntegerWithUnits(org.osate.pluginsupport.properties.IntegerWithUnits) IntegerLiteral(org.osate.aadl2.IntegerLiteral) EObject(org.eclipse.emf.ecore.EObject) PropertyConstant(org.osate.aadl2.PropertyConstant) Collectors(java.util.stream.Collectors) Aadl2GlobalScopeUtil(org.osate.aadl2.modelsupport.scoping.Aadl2GlobalScopeUtil) PropertyExpression(org.osate.aadl2.PropertyExpression) CodeGenUtil(org.osate.pluginsupport.properties.CodeGenUtil) List(java.util.List) Classifier(org.osate.aadl2.Classifier) Aadl2Package(org.osate.aadl2.Aadl2Package) ClassifierValue(org.osate.aadl2.ClassifierValue) ListValue(org.osate.aadl2.ListValue) PropertyExpression(org.osate.aadl2.PropertyExpression) PropertyConstant(org.osate.aadl2.PropertyConstant)

Example 43 with ListValue

use of com.google.api.expr.v1alpha1.ListValue in project osate2 by osate.

the class InstantiateModel method processConnections.

// --------------------------------------------------------------------------------------------
// Methods for connection sets and connection patterns
// --------------------------------------------------------------------------------------------
private void processConnections(SystemInstance root) throws InterruptedException {
    if (monitor.isCanceled()) {
        throw new InterruptedException();
    }
    EList<ComponentInstance> replicateConns = new UniqueEList<ComponentInstance>();
    List<ConnectionInstance> toRemove = new ArrayList<ConnectionInstance>();
    EList<ConnectionInstance> connilist = root.getAllConnectionInstances();
    for (ConnectionInstance conni : connilist) {
        // track all component instances that contain connection instances
        replicateConns.add(conni.getComponentInstance());
        PropertyAssociation setPA = getPA(conni, "Connection_Set");
        PropertyAssociation patternPA = getPA(conni, "Connection_Pattern");
        if (setPA == null && patternPA == null) {
            // OsateDebug.osateDebug("[InstantiateModel] processConnections");
            LinkedList<Integer> srcDims = new LinkedList<Integer>();
            LinkedList<Integer> dstDims = new LinkedList<Integer>();
            LinkedList<Integer> srcSizes = new LinkedList<Integer>();
            LinkedList<Integer> dstSizes = new LinkedList<Integer>();
            boolean done = false;
            analyzePath(conni.getContainingComponentInstance(), conni.getSource(), null, srcDims, srcSizes);
            analyzePath(conni.getContainingComponentInstance(), conni.getDestination(), null, dstDims, dstSizes);
            for (int d : srcDims) {
                if (d != 0) {
                    done = true;
                    if (interpretConnectionPatterns(conni, false, null, 0, srcSizes, 0, dstSizes, 0, new ArrayList<Long>(), new ArrayList<Long>())) {
                        toRemove.add(conni);
                    }
                    break;
                }
            }
            if (!done) {
                for (int d : dstDims) {
                    if (d != 0) {
                        done = true;
                        if (interpretConnectionPatterns(conni, false, null, 0, srcSizes, 0, dstSizes, 0, new ArrayList<Long>(), new ArrayList<Long>())) {
                            toRemove.add(conni);
                        }
                        break;
                    }
                }
            }
        } else if (patternPA != null) {
            boolean isOpposite = Aadl2InstanceUtil.isOpposite(conni);
            EcoreUtil.remove(patternPA);
            List<PropertyExpression> patterns = ((ListValue) patternPA.getOwnedValues().get(0).getOwnedValue()).getOwnedListElements();
            for (PropertyExpression pe : patterns) {
                List<PropertyExpression> pattern = ((ListValue) pe).getOwnedListElements();
                LinkedList<Integer> srcSizes = new LinkedList<Integer>();
                LinkedList<Integer> dstSizes = new LinkedList<Integer>();
                analyzePath(conni.getContainingComponentInstance(), conni.getSource(), null, null, srcSizes);
                analyzePath(conni.getContainingComponentInstance(), conni.getDestination(), null, null, dstSizes);
                if (srcSizes.size() == 0 && dstSizes.size() == 0) {
                    errManager.warning(conni, "Connection pattern specified for connection that does not connect array elements.");
                } else {
                    if (interpretConnectionPatterns(conni, isOpposite, pattern, 0, srcSizes, 0, dstSizes, 0, new ArrayList<Long>(), new ArrayList<Long>())) {
                        toRemove.add(conni);
                    }
                }
            }
        }
        // no else as we want both the pattern and the connection set evaluated
        if (setPA != null) {
            EcoreUtil.remove(setPA);
            // TODO-LW: modal conn set allowed?
            List<Long> srcIndices;
            List<Long> dstIndices;
            for (PropertyExpression pe : ((ListValue) setPA.getOwnedValues().get(0).getOwnedValue()).getOwnedListElements()) {
                RecordValue rv = (RecordValue) pe;
                srcIndices = getIndices(rv, "src");
                dstIndices = getIndices(rv, "dst");
                if (Aadl2InstanceUtil.isOpposite(conni)) {
                    // flip indices since we are going in the opposite direction
                    createNewConnection(conni, dstIndices, srcIndices);
                } else {
                    createNewConnection(conni, srcIndices, dstIndices);
                }
            }
            toRemove.add(conni);
        }
    }
    for (ConnectionInstance conni : toRemove) {
        EcoreUtil.delete(conni);
    }
    replicateConnections(replicateConns);
}
Also used : ConnectionInstance(org.osate.aadl2.instance.ConnectionInstance) UniqueEList(org.eclipse.emf.common.util.UniqueEList) PropertyAssociation(org.osate.aadl2.PropertyAssociation) BasicPropertyAssociation(org.osate.aadl2.BasicPropertyAssociation) ListValue(org.osate.aadl2.ListValue) ArrayList(java.util.ArrayList) RecordValue(org.osate.aadl2.RecordValue) LinkedList(java.util.LinkedList) ComponentInstance(org.osate.aadl2.instance.ComponentInstance) ArrayList(java.util.ArrayList) UniqueEList(org.eclipse.emf.common.util.UniqueEList) List(java.util.List) LinkedList(java.util.LinkedList) EList(org.eclipse.emf.common.util.EList) PropertyExpression(org.osate.aadl2.PropertyExpression)

Example 44 with ListValue

use of com.google.api.expr.v1alpha1.ListValue in project osate-plugin by sireum.

the class Visitor method getPropertyExpressionValue.

protected List<org.sireum.hamr.ir.PropertyValue> getPropertyExpressionValue(PropertyExpression pe, List<String> path) {
    if (pe instanceof BooleanLiteral) {
        final String b = Boolean.toString(((BooleanLiteral) pe).getValue());
        return VisitorUtil.toIList(factory.valueProp(b));
    } else if (pe instanceof NumberValue) {
        return VisitorUtil.toIList(getUnitProp((NumberValue) pe));
    } else if (pe instanceof StringLiteral) {
        final String v = ((StringLiteral) pe).getValue();
        return VisitorUtil.toIList(factory.valueProp(v));
    } else if (pe instanceof RangeValue) {
        final RangeValue rv = (RangeValue) pe;
        return VisitorUtil.toIList(factory.rangeProp(getUnitProp(rv.getMinimumValue()), getUnitProp(rv.getMaximumValue())));
    } else if (pe instanceof ClassifierValue) {
        final Classifier cv = ((ClassifierValue) pe).getClassifier();
        if (cv instanceof DataClassifier) {
            processDataType((DataClassifier) cv);
        }
        if (cv.getQualifiedName() != null) {
            return VisitorUtil.toIList(factory.classifierProp(cv.getQualifiedName()));
        } else {
            return VisitorUtil.iList();
        }
    // return VisitorUtil.toIList(factory.classifierProp(cv.getQualifiedName()));
    } else if (pe instanceof ListValue) {
        final ListValue lv = (ListValue) pe;
        List<org.sireum.hamr.ir.PropertyValue> elems = VisitorUtil.iList();
        for (PropertyExpression e : lv.getOwnedListElements()) {
            elems = VisitorUtil.addAll(elems, getPropertyExpressionValue(e, path));
        }
        return elems;
    } else if (pe instanceof NamedValue) {
        final NamedValue nv = (NamedValue) pe;
        final AbstractNamedValue nv2 = nv.getNamedValue();
        if (nv2 instanceof EnumerationLiteral) {
            final EnumerationLiteral el = (EnumerationLiteral) nv2;
            return VisitorUtil.toIList(factory.valueProp(el.getFullName()));
        } else if (nv2 instanceof Property) {
            final Property _p = (Property) nv2;
            if (_p.getDefaultValue() != null) {
                return getPropertyExpressionValue(_p.getDefaultValue(), path);
            } else {
                return VisitorUtil.toIList(factory.valueProp(_p.getQualifiedName()));
            }
        } else if (nv2 instanceof PropertyConstant) {
            final PropertyConstant pc = (PropertyConstant) nv2;
            return getPropertyExpressionValue(pc.getConstantValue(), path);
        } else {
            java.lang.System.err.println("Not handling " + pe.eClass().getClassifierID() + " " + nv2);
            return VisitorUtil.iList();
        }
    } else if (pe instanceof RecordValue) {
        final RecordValue rvy = (RecordValue) pe;
        final List<org.sireum.hamr.ir.Property> properties = rvy.getOwnedFieldValues().stream().map(fv -> factory.property(factory.name(VisitorUtil.add(path, fv.getProperty().getQualifiedName()), VisitorUtil.buildPosInfo(fv.getProperty())), getPropertyExpressionValue(fv.getOwnedValue(), path), VisitorUtil.iList())).collect(Collectors.toList());
        return VisitorUtil.toIList(factory.recordProp(properties));
    } else if (pe instanceof ReferenceValue) {
        final ReferenceValue rvx = (ReferenceValue) pe;
        final org.sireum.hamr.ir.Name refName = factory.name(VisitorUtil.toIList(rvx.toString()), VisitorUtil.buildPosInfo(rvx.getPath().getNamedElement()));
        return VisitorUtil.toIList(factory.referenceProp(refName));
    } else if (pe instanceof InstanceReferenceValue) {
        final InstanceReferenceValue irv = (InstanceReferenceValue) pe;
        final String t = irv.getReferencedInstanceObject().getInstanceObjectPath();
        return VisitorUtil.toIList(factory.referenceProp(factory.name(Arrays.asList(t.split("\\.")), VisitorUtil.buildPosInfo(irv.getReferencedInstanceObject()))));
    } else {
        java.lang.System.err.println("Need to handle " + pe + " " + pe.eClass().getClassifierID());
        if (pe.getClass().getName() != null) {
            return VisitorUtil.toIList(factory.classifierProp(pe.getClass().getName()));
        } else {
            return VisitorUtil.iList();
        }
    }
}
Also used : ClassifierValue(org.osate.aadl2.ClassifierValue) BooleanLiteral(org.osate.aadl2.BooleanLiteral) ReferenceValue(org.osate.aadl2.ReferenceValue) InstanceReferenceValue(org.osate.aadl2.instance.InstanceReferenceValue) ListValue(org.osate.aadl2.ListValue) RecordValue(org.osate.aadl2.RecordValue) AbstractNamedValue(org.osate.aadl2.AbstractNamedValue) NamedValue(org.osate.aadl2.NamedValue) AbstractNamedValue(org.osate.aadl2.AbstractNamedValue) Classifier(org.osate.aadl2.Classifier) DataClassifier(org.osate.aadl2.DataClassifier) DataClassifier(org.osate.aadl2.DataClassifier) RangeValue(org.osate.aadl2.RangeValue) PropertyConstant(org.osate.aadl2.PropertyConstant) StringLiteral(org.osate.aadl2.StringLiteral) NumberValue(org.osate.aadl2.NumberValue) List(java.util.List) ArrayList(java.util.ArrayList) PropertyExpression(org.osate.aadl2.PropertyExpression) InstanceReferenceValue(org.osate.aadl2.instance.InstanceReferenceValue) EnumerationLiteral(org.osate.aadl2.EnumerationLiteral) Property(org.osate.aadl2.Property)

Example 45 with ListValue

use of com.google.api.expr.v1alpha1.ListValue in project AMASE by loonwerks.

the class AbstractSafetySemanticSequencer method sequence.

@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
    EPackage epackage = semanticObject.eClass().getEPackage();
    ParserRule rule = context.getParserRule();
    Action action = context.getAssignedAction();
    Set<Parameter> parameters = context.getEnabledBooleanParameters();
    if (epackage == Aadl2Package.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Aadl2Package.ARRAY_RANGE:
                sequence_ArrayRange(context, (ArrayRange) semanticObject);
                return;
            case Aadl2Package.BASIC_PROPERTY_ASSOCIATION:
                sequence_FieldPropertyAssociation(context, (BasicPropertyAssociation) semanticObject);
                return;
            case Aadl2Package.BOOLEAN_LITERAL:
                sequence_BooleanLiteral(context, (BooleanLiteral) semanticObject);
                return;
            case Aadl2Package.CLASSIFIER_VALUE:
                sequence_ComponentClassifierTerm(context, (ClassifierValue) semanticObject);
                return;
            case Aadl2Package.COMPUTED_VALUE:
                sequence_ComputedTerm(context, (ComputedValue) semanticObject);
                return;
            case Aadl2Package.CONTAINED_NAMED_ELEMENT:
                sequence_ContainmentPath(context, (ContainedNamedElement) semanticObject);
                return;
            case Aadl2Package.CONTAINMENT_PATH_ELEMENT:
                sequence_ContainmentPathElement(context, (ContainmentPathElement) semanticObject);
                return;
            case Aadl2Package.INTEGER_LITERAL:
                sequence_IntegerTerm(context, (IntegerLiteral) semanticObject);
                return;
            case Aadl2Package.LIST_VALUE:
                sequence_ListTerm(context, (ListValue) semanticObject);
                return;
            case Aadl2Package.MODAL_PROPERTY_VALUE:
                if (rule == grammarAccess.getModalPropertyValueRule()) {
                    sequence_ModalPropertyValue(context, (ModalPropertyValue) semanticObject);
                    return;
                } else if (rule == grammarAccess.getOptionalModalPropertyValueRule()) {
                    sequence_OptionalModalPropertyValue(context, (ModalPropertyValue) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPropertyValueRule()) {
                    sequence_PropertyValue(context, (ModalPropertyValue) semanticObject);
                    return;
                } else
                    break;
            case Aadl2Package.NAMED_VALUE:
                if (rule == grammarAccess.getConstantValueRule() || rule == grammarAccess.getNumAltRule()) {
                    sequence_ConstantValue(context, (NamedValue) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPropertyExpressionRule() || rule == grammarAccess.getLiteralorReferenceTermRule()) {
                    sequence_LiteralorReferenceTerm(context, (NamedValue) semanticObject);
                    return;
                } else
                    break;
            case Aadl2Package.OPERATION:
                sequence_SignedConstant(context, (Operation) semanticObject);
                return;
            case Aadl2Package.PROPERTY_ASSOCIATION:
                if (rule == grammarAccess.getBasicPropertyAssociationRule()) {
                    sequence_BasicPropertyAssociation(context, (PropertyAssociation) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPModelRule() || rule == grammarAccess.getContainedPropertyAssociationRule()) {
                    sequence_ContainedPropertyAssociation(context, (PropertyAssociation) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPropertyAssociationRule()) {
                    sequence_PropertyAssociation(context, (PropertyAssociation) semanticObject);
                    return;
                } else
                    break;
            case Aadl2Package.RANGE_VALUE:
                sequence_NumericRangeTerm(context, (RangeValue) semanticObject);
                return;
            case Aadl2Package.REAL_LITERAL:
                sequence_RealTerm(context, (RealLiteral) semanticObject);
                return;
            case Aadl2Package.RECORD_VALUE:
                if (rule == grammarAccess.getOldRecordTermRule()) {
                    sequence_OldRecordTerm(context, (RecordValue) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPropertyExpressionRule() || rule == grammarAccess.getRecordTermRule()) {
                    sequence_RecordTerm(context, (RecordValue) semanticObject);
                    return;
                } else
                    break;
            case Aadl2Package.REFERENCE_VALUE:
                sequence_ReferenceTerm(context, (ReferenceValue) semanticObject);
                return;
            case Aadl2Package.STRING_LITERAL:
                sequence_StringTerm(context, (StringLiteral) semanticObject);
                return;
        }
    else if (epackage == AgreePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case AgreePackage.AGREE_CONTRACT:
                sequence_AgreeContract(context, (AgreeContract) semanticObject);
                return;
            case AgreePackage.AGREE_CONTRACT_LIBRARY:
                sequence_AgreeLibrary(context, (AgreeContractLibrary) semanticObject);
                return;
            case AgreePackage.AGREE_CONTRACT_SUBCLAUSE:
                sequence_AgreeSubclause(context, (AgreeContractSubclause) semanticObject);
                return;
            case AgreePackage.ALWAYS_STATEMENT:
                sequence_PatternStatement(context, (AlwaysStatement) semanticObject);
                return;
            case AgreePackage.ARG:
                sequence_Arg(context, (Arg) semanticObject);
                return;
            case AgreePackage.ARRAY_LITERAL_EXPR:
                sequence_ArrayLiteralExpr(context, (ArrayLiteralExpr) semanticObject);
                return;
            case AgreePackage.ARRAY_SUB_EXPR:
                sequence_ArraySubExpr(context, (ArraySubExpr) semanticObject);
                return;
            case AgreePackage.ARRAY_TYPE:
                sequence_Type(context, (ArrayType) semanticObject);
                return;
            case AgreePackage.ARRAY_UPDATE_EXPR:
                sequence_ArrayUpdateExpr(context, (ArrayUpdateExpr) semanticObject);
                return;
            case AgreePackage.ASSERT_STATEMENT:
                sequence_NamedSpecStatement(context, (AssertStatement) semanticObject);
                return;
            case AgreePackage.ASSIGN_STATEMENT:
                sequence_AssignStatement(context, (AssignStatement) semanticObject);
                return;
            case AgreePackage.ASSUME_STATEMENT:
                sequence_NamedSpecStatement(context, (AssumeStatement) semanticObject);
                return;
            case AgreePackage.ASYNCH_STATEMENT:
                sequence_SynchStatement(context, (AsynchStatement) semanticObject);
                return;
            case AgreePackage.BINARY_EXPR:
                sequence_AddSubExpr_AndExpr_ArrowExpr_EquivExpr_ImpliesExpr_MultDivExpr_OrExpr_PowerExpr_RelateExpr(context, (BinaryExpr) semanticObject);
                return;
            case AgreePackage.BOOL_LIT_EXPR:
                sequence_TermExpr(context, (BoolLitExpr) semanticObject);
                return;
            case AgreePackage.CALEN_STATEMENT:
                sequence_SynchStatement(context, (CalenStatement) semanticObject);
                return;
            case AgreePackage.CALL_EXPR:
                sequence_TermExpr(context, (CallExpr) semanticObject);
                return;
            case AgreePackage.CLOSED_TIME_INTERVAL:
                sequence_TimeInterval(context, (ClosedTimeInterval) semanticObject);
                return;
            case AgreePackage.CONST_STATEMENT:
                sequence_ConstStatement(context, (ConstStatement) semanticObject);
                return;
            case AgreePackage.DOUBLE_DOT_REF:
                sequence_DoubleDotRef(context, (DoubleDotRef) semanticObject);
                return;
            case AgreePackage.ENUM_LIT_EXPR:
                sequence_TermExpr(context, (EnumLitExpr) semanticObject);
                return;
            case AgreePackage.ENUM_STATEMENT:
                sequence_EnumStatement(context, (EnumStatement) semanticObject);
                return;
            case AgreePackage.EQ_STATEMENT:
                sequence_EqStatement(context, (EqStatement) semanticObject);
                return;
            case AgreePackage.EVENT_EXPR:
                sequence_TermExpr(context, (EventExpr) semanticObject);
                return;
            case AgreePackage.EXISTS_EXPR:
                sequence_ExistsExpr(context, (ExistsExpr) semanticObject);
                return;
            case AgreePackage.FLATMAP_EXPR:
                sequence_FlatmapExpr(context, (FlatmapExpr) semanticObject);
                return;
            case AgreePackage.FLOOR_CAST:
                sequence_TermExpr(context, (FloorCast) semanticObject);
                return;
            case AgreePackage.FN_DEF:
                sequence_FnDef(context, (FnDef) semanticObject);
                return;
            case AgreePackage.FOLD_LEFT_EXPR:
                sequence_FoldLeftExpr(context, (FoldLeftExpr) semanticObject);
                return;
            case AgreePackage.FOLD_RIGHT_EXPR:
                sequence_FoldRightExpr(context, (FoldRightExpr) semanticObject);
                return;
            case AgreePackage.FORALL_EXPR:
                sequence_ForallExpr(context, (ForallExpr) semanticObject);
                return;
            case AgreePackage.GET_PROPERTY_EXPR:
                sequence_PreDefFnExpr(context, (GetPropertyExpr) semanticObject);
                return;
            case AgreePackage.GUARANTEE_STATEMENT:
                sequence_NamedSpecStatement(context, (GuaranteeStatement) semanticObject);
                return;
            case AgreePackage.IF_THEN_ELSE_EXPR:
                sequence_IfThenElseExpr(context, (IfThenElseExpr) semanticObject);
                return;
            case AgreePackage.INDICES_EXPR:
                sequence_TermExpr(context, (IndicesExpr) semanticObject);
                return;
            case AgreePackage.INPUT_STATEMENT:
                sequence_InputStatement(context, (InputStatement) semanticObject);
                return;
            case AgreePackage.INT_LIT_EXPR:
                sequence_TermExpr(context, (IntLitExpr) semanticObject);
                return;
            case AgreePackage.LATCHED_EXPR:
                sequence_TermExpr(context, (LatchedExpr) semanticObject);
                return;
            case AgreePackage.LATCHED_STATEMENT:
                sequence_SynchStatement(context, (LatchedStatement) semanticObject);
                return;
            case AgreePackage.LEMMA_STATEMENT:
                sequence_NamedSpecStatement(context, (LemmaStatement) semanticObject);
                return;
            case AgreePackage.LIBRARY_FN_DEF:
                sequence_LibraryFnDef(context, (LibraryFnDef) semanticObject);
                return;
            case AgreePackage.LINEARIZATION_DEF:
                sequence_LinearizationDef(context, (LinearizationDef) semanticObject);
                return;
            case AgreePackage.LINEARIZATION_INTERVAL:
                sequence_LinearizationInterval(context, (LinearizationInterval) semanticObject);
                return;
            case AgreePackage.MN_SYNCH_STATEMENT:
                sequence_SynchStatement(context, (MNSynchStatement) semanticObject);
                return;
            case AgreePackage.NAMED_ELM_EXPR:
                sequence_TermExpr(context, (NamedElmExpr) semanticObject);
                return;
            case AgreePackage.NAMED_ID:
                sequence_NamedID(context, (NamedID) semanticObject);
                return;
            case AgreePackage.NODE_BODY_EXPR:
                sequence_NodeBodyExpr(context, (NodeBodyExpr) semanticObject);
                return;
            case AgreePackage.NODE_DEF:
                sequence_NodeDef(context, (NodeDef) semanticObject);
                return;
            case AgreePackage.NODE_EQ:
                sequence_NodeStmt(context, (NodeEq) semanticObject);
                return;
            case AgreePackage.NODE_LEMMA:
                sequence_NodeStmt(context, (NodeLemma) semanticObject);
                return;
            case AgreePackage.OPEN_LEFT_TIME_INTERVAL:
                sequence_TimeInterval(context, (OpenLeftTimeInterval) semanticObject);
                return;
            case AgreePackage.OPEN_RIGHT_TIME_INTERVAL:
                sequence_TimeInterval(context, (OpenRightTimeInterval) semanticObject);
                return;
            case AgreePackage.OPEN_TIME_INTERVAL:
                sequence_TimeInterval(context, (OpenTimeInterval) semanticObject);
                return;
            case AgreePackage.ORDER_STATEMENT:
                sequence_OrderStatement(context, (OrderStatement) semanticObject);
                return;
            case AgreePackage.PERIODIC_STATEMENT:
                sequence_RealTimeStatement(context, (PeriodicStatement) semanticObject);
                return;
            case AgreePackage.PRE_EXPR:
                sequence_TermExpr(context, (PreExpr) semanticObject);
                return;
            case AgreePackage.PREV_EXPR:
                sequence_PreDefFnExpr(context, (PrevExpr) semanticObject);
                return;
            case AgreePackage.PRIM_TYPE:
                sequence_BaseType(context, (PrimType) semanticObject);
                return;
            case AgreePackage.PROPERTY_STATEMENT:
                sequence_PropertyStatement(context, (PropertyStatement) semanticObject);
                return;
            case AgreePackage.REACHABLE_STATEMENT:
                sequence_NamedSpecStatement(context, (ReachableStatement) semanticObject);
                return;
            case AgreePackage.REAL_CAST:
                sequence_TermExpr(context, (RealCast) semanticObject);
                return;
            case AgreePackage.REAL_LIT_EXPR:
                sequence_TermExpr(context, (RealLitExpr) semanticObject);
                return;
            case AgreePackage.RECORD_DEF:
                sequence_RecordDef(context, (RecordDef) semanticObject);
                return;
            case AgreePackage.RECORD_LIT_EXPR:
                sequence_TermExpr(context, (RecordLitExpr) semanticObject);
                return;
            case AgreePackage.RECORD_UPDATE_EXPR:
                sequence_RecordUpdateExpr(context, (RecordUpdateExpr) semanticObject);
                return;
            case AgreePackage.SELECTION_EXPR:
                sequence_SelectionExpr(context, (SelectionExpr) semanticObject);
                return;
            case AgreePackage.SPORADIC_STATEMENT:
                sequence_RealTimeStatement(context, (SporadicStatement) semanticObject);
                return;
            case AgreePackage.SYNCH_STATEMENT:
                sequence_SynchStatement(context, (SynchStatement) semanticObject);
                return;
            case AgreePackage.TAG_EXPR:
                sequence_TagExpr(context, (TagExpr) semanticObject);
                return;
            case AgreePackage.THIS_REF:
                sequence_ComponentRef(context, (ThisRef) semanticObject);
                return;
            case AgreePackage.TIME_EXPR:
                sequence_TermExpr(context, (TimeExpr) semanticObject);
                return;
            case AgreePackage.TIME_FALL_EXPR:
                sequence_TermExpr(context, (TimeFallExpr) semanticObject);
                return;
            case AgreePackage.TIME_OF_EXPR:
                sequence_TermExpr(context, (TimeOfExpr) semanticObject);
                return;
            case AgreePackage.TIME_RISE_EXPR:
                sequence_TermExpr(context, (TimeRiseExpr) semanticObject);
                return;
            case AgreePackage.UNARY_EXPR:
                sequence_UnaryExpr(context, (UnaryExpr) semanticObject);
                return;
            case AgreePackage.UNINTERPRETED_FN_DEF:
                sequence_UninterpretedFnDef(context, (UninterpretedFnDef) semanticObject);
                return;
            case AgreePackage.WHEN_HOLDS_STATEMENT:
                sequence_WhenStatement(context, (WhenHoldsStatement) semanticObject);
                return;
            case AgreePackage.WHEN_OCCURS_STATMENT:
                sequence_WhenStatement(context, (WhenOccursStatment) semanticObject);
                return;
            case AgreePackage.WHENEVER_BECOMES_TRUE_STATEMENT:
                sequence_WheneverStatement(context, (WheneverBecomesTrueStatement) semanticObject);
                return;
            case AgreePackage.WHENEVER_HOLDS_STATEMENT:
                sequence_WheneverStatement(context, (WheneverHoldsStatement) semanticObject);
                return;
            case AgreePackage.WHENEVER_IMPLIES_STATEMENT:
                sequence_WheneverStatement(context, (WheneverImpliesStatement) semanticObject);
                return;
            case AgreePackage.WHENEVER_OCCURS_STATEMENT:
                sequence_WheneverStatement(context, (WheneverOccursStatement) semanticObject);
                return;
        }
    else if (epackage == SafetyPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case SafetyPackage.ACTIVATION_STATEMENT:
                sequence_SpecStatement(context, (ActivationStatement) semanticObject);
                return;
            case SafetyPackage.ANALYSIS_STATEMENT:
                sequence_SpecStatement(context, (AnalysisStatement) semanticObject);
                return;
            case SafetyPackage.CLOSED_SAFETY_INTERVAL:
                sequence_SafetyInterval(context, (ClosedSafetyInterval) semanticObject);
                return;
            case SafetyPackage.DISABLE_STATEMENT:
                sequence_FaultSubcomponent(context, (DisableStatement) semanticObject);
                return;
            case SafetyPackage.DURATION_STATEMENT:
                if (rule == grammarAccess.getElementSafetyRule() || rule == grammarAccess.getFaultSubcomponentRule()) {
                    sequence_FaultSubcomponent(context, (DurationStatement) semanticObject);
                    return;
                } else if (rule == grammarAccess.getHWFaultSubcomponentRule()) {
                    sequence_HWFaultSubcomponent(context, (DurationStatement) semanticObject);
                    return;
                } else
                    break;
            case SafetyPackage.ENABLER_CONDITION:
                sequence_TriggerCondition(context, (EnablerCondition) semanticObject);
                return;
            case SafetyPackage.EQ_VALUE:
                sequence_SafetyEqStatement(context, (EqValue) semanticObject);
                return;
            case SafetyPackage.FAULT_COUNT_BEHAVIOR:
                sequence_AnalysisBehavior(context, (FaultCountBehavior) semanticObject);
                return;
            case SafetyPackage.FAULT_STATEMENT:
                sequence_SpecStatement(context, (FaultStatement) semanticObject);
                return;
            case SafetyPackage.HW_FAULT_STATEMENT:
                sequence_SpecStatement(context, (HWFaultStatement) semanticObject);
                return;
            case SafetyPackage.INPUT_STATEMENT:
                sequence_FaultSubcomponent(context, (edu.umn.cs.crisys.safety.safety.InputStatement) semanticObject);
                return;
            case SafetyPackage.INTERVAL_EQ:
                sequence_SafetyEqStatement(context, (IntervalEq) semanticObject);
                return;
            case SafetyPackage.OPEN_LEFT_SAFETY_INTERVAL:
                sequence_SafetyInterval(context, (OpenLeftSafetyInterval) semanticObject);
                return;
            case SafetyPackage.OPEN_RIGHT_SAFETY_INTERVAL:
                sequence_SafetyInterval(context, (OpenRightSafetyInterval) semanticObject);
                return;
            case SafetyPackage.OPEN_SAFETY_INTERVAL:
                sequence_SafetyInterval(context, (OpenSafetyInterval) semanticObject);
                return;
            case SafetyPackage.OUTPUT_STATEMENT:
                sequence_FaultSubcomponent(context, (OutputStatement) semanticObject);
                return;
            case SafetyPackage.PERMANENT_CONSTRAINT:
                sequence_TemporalConstraint(context, (PermanentConstraint) semanticObject);
                return;
            case SafetyPackage.PROBABILITY_BEHAVIOR:
                sequence_AnalysisBehavior(context, (ProbabilityBehavior) semanticObject);
                return;
            case SafetyPackage.PROBABILITY_STATEMENT:
                if (rule == grammarAccess.getElementSafetyRule() || rule == grammarAccess.getFaultSubcomponentRule()) {
                    sequence_FaultSubcomponent(context, (ProbabilityStatement) semanticObject);
                    return;
                } else if (rule == grammarAccess.getHWFaultSubcomponentRule()) {
                    sequence_HWFaultSubcomponent(context, (ProbabilityStatement) semanticObject);
                    return;
                } else
                    break;
            case SafetyPackage.PROPAGATE_STATEMENT:
                sequence_SpecStatement(context, (PropagateStatement) semanticObject);
                return;
            case SafetyPackage.PROPAGATION_TYPE_STATEMENT:
                if (rule == grammarAccess.getElementSafetyRule() || rule == grammarAccess.getFaultSubcomponentRule()) {
                    sequence_FaultSubcomponent(context, (PropagationTypeStatement) semanticObject);
                    return;
                } else if (rule == grammarAccess.getHWFaultSubcomponentRule()) {
                    sequence_HWFaultSubcomponent(context, (PropagationTypeStatement) semanticObject);
                    return;
                } else
                    break;
            case SafetyPackage.RANGE_EQ:
                sequence_SafetyEqStatement(context, (RangeEq) semanticObject);
                return;
            case SafetyPackage.SAFETY_CONTRACT:
                sequence_SafetyContract(context, (SafetyContract) semanticObject);
                return;
            case SafetyPackage.SAFETY_CONTRACT_LIBRARY:
                sequence_SafetyLibrary(context, (SafetyContractLibrary) semanticObject);
                return;
            case SafetyPackage.SAFETY_CONTRACT_SUBCLAUSE:
                sequence_SafetySubclause(context, (SafetyContractSubclause) semanticObject);
                return;
            case SafetyPackage.SET_EQ:
                sequence_SafetyEqStatement(context, (SetEq) semanticObject);
                return;
            case SafetyPackage.TRANSIENT_CONSTRAINT:
                sequence_TemporalConstraint(context, (TransientConstraint) semanticObject);
                return;
            case SafetyPackage.TRIGGER_STATEMENT:
                sequence_FaultSubcomponent(context, (TriggerStatement) semanticObject);
                return;
            case SafetyPackage.ASYMMETRIC:
                sequence_PropagationTypeConstraint(context, (asymmetric) semanticObject);
                return;
            case SafetyPackage.SYMMETRIC:
                sequence_PropagationTypeConstraint(context, (symmetric) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : OpenLeftSafetyInterval(edu.umn.cs.crisys.safety.safety.OpenLeftSafetyInterval) ParserRule(org.eclipse.xtext.ParserRule) ClassifierValue(org.osate.aadl2.ClassifierValue) ModalPropertyValue(org.osate.aadl2.ModalPropertyValue) SafetyContractLibrary(edu.umn.cs.crisys.safety.safety.SafetyContractLibrary) OpenRightSafetyInterval(edu.umn.cs.crisys.safety.safety.OpenRightSafetyInterval) ReferenceValue(org.osate.aadl2.ReferenceValue) PropagationTypeStatement(edu.umn.cs.crisys.safety.safety.PropagationTypeStatement) EPackage(org.eclipse.emf.ecore.EPackage) PermanentConstraint(edu.umn.cs.crisys.safety.safety.PermanentConstraint) ActivationStatement(edu.umn.cs.crisys.safety.safety.ActivationStatement) IntervalEq(edu.umn.cs.crisys.safety.safety.IntervalEq) SafetyContract(edu.umn.cs.crisys.safety.safety.SafetyContract) IntegerLiteral(org.osate.aadl2.IntegerLiteral) HWFaultStatement(edu.umn.cs.crisys.safety.safety.HWFaultStatement) DisableStatement(edu.umn.cs.crisys.safety.safety.DisableStatement) ListValue(org.osate.aadl2.ListValue) RangeEq(edu.umn.cs.crisys.safety.safety.RangeEq) PropagateStatement(edu.umn.cs.crisys.safety.safety.PropagateStatement) SafetyContractSubclause(edu.umn.cs.crisys.safety.safety.SafetyContractSubclause) StringLiteral(org.osate.aadl2.StringLiteral) edu.umn.cs.crisys.safety.safety.asymmetric(edu.umn.cs.crisys.safety.safety.asymmetric) ContainedNamedElement(org.osate.aadl2.ContainedNamedElement) DurationStatement(edu.umn.cs.crisys.safety.safety.DurationStatement) ProbabilityStatement(edu.umn.cs.crisys.safety.safety.ProbabilityStatement) ComputedValue(org.osate.aadl2.ComputedValue) Action(org.eclipse.xtext.Action) ProbabilityBehavior(edu.umn.cs.crisys.safety.safety.ProbabilityBehavior) BooleanLiteral(org.osate.aadl2.BooleanLiteral) PropertyAssociation(org.osate.aadl2.PropertyAssociation) BasicPropertyAssociation(org.osate.aadl2.BasicPropertyAssociation) ArrayRange(org.osate.aadl2.ArrayRange) NamedValue(org.osate.aadl2.NamedValue) Operation(org.osate.aadl2.Operation) RangeValue(org.osate.aadl2.RangeValue) EqValue(edu.umn.cs.crisys.safety.safety.EqValue) edu.umn.cs.crisys.safety.safety.asymmetric(edu.umn.cs.crisys.safety.safety.asymmetric) edu.umn.cs.crisys.safety.safety.symmetric(edu.umn.cs.crisys.safety.safety.symmetric) SetEq(edu.umn.cs.crisys.safety.safety.SetEq) RealLiteral(org.osate.aadl2.RealLiteral) FaultCountBehavior(edu.umn.cs.crisys.safety.safety.FaultCountBehavior) BasicPropertyAssociation(org.osate.aadl2.BasicPropertyAssociation) InputStatement(com.rockwellcollins.atc.agree.agree.InputStatement) AnalysisStatement(edu.umn.cs.crisys.safety.safety.AnalysisStatement) TriggerStatement(edu.umn.cs.crisys.safety.safety.TriggerStatement) ContainmentPathElement(org.osate.aadl2.ContainmentPathElement) RecordValue(org.osate.aadl2.RecordValue) EnablerCondition(edu.umn.cs.crisys.safety.safety.EnablerCondition) FaultStatement(edu.umn.cs.crisys.safety.safety.FaultStatement) HWFaultStatement(edu.umn.cs.crisys.safety.safety.HWFaultStatement) OutputStatement(edu.umn.cs.crisys.safety.safety.OutputStatement) OpenSafetyInterval(edu.umn.cs.crisys.safety.safety.OpenSafetyInterval) TransientConstraint(edu.umn.cs.crisys.safety.safety.TransientConstraint) Parameter(org.eclipse.xtext.Parameter) ClosedSafetyInterval(edu.umn.cs.crisys.safety.safety.ClosedSafetyInterval)

Aggregations

ListValue (org.osate.aadl2.ListValue)101 PropertyExpression (org.osate.aadl2.PropertyExpression)85 Property (org.osate.aadl2.Property)64 PropertyNotPresentException (org.osate.aadl2.properties.PropertyNotPresentException)51 ClassifierValue (org.osate.aadl2.ClassifierValue)29 StringLiteral (org.osate.aadl2.StringLiteral)24 BasicPropertyAssociation (org.osate.aadl2.BasicPropertyAssociation)22 PropertyAssociation (org.osate.aadl2.PropertyAssociation)21 InstanceReferenceValue (org.osate.aadl2.instance.InstanceReferenceValue)21 IntegerLiteral (org.osate.aadl2.IntegerLiteral)19 ModalPropertyValue (org.osate.aadl2.ModalPropertyValue)19 RecordValue (org.osate.aadl2.RecordValue)19 ReferenceValue (org.osate.aadl2.ReferenceValue)16 NamedValue (org.osate.aadl2.NamedValue)15 Classifier (org.osate.aadl2.Classifier)14 RangeValue (org.osate.aadl2.RangeValue)13 ContainmentPathElement (org.osate.aadl2.ContainmentPathElement)12 ArrayList (java.util.ArrayList)11 BooleanLiteral (org.osate.aadl2.BooleanLiteral)11 PropertyConstant (org.osate.aadl2.PropertyConstant)11