use of org.osate.aadl2.AnnexLibrary in project AMASE by loonwerks.
the class SafetyAnnexContentAssist method annexCompletionSuggestions.
@Override
public List<String> annexCompletionSuggestions(EObject defaultAnnex, int offset) {
// get one character back
offset = (offset <= 0) ? 0 : offset - 1;
EObjectAtOffsetHelper helper = getOffsetHelper();
EObject grammerObject = null;
// EObjectAtOffsetHelper
if (defaultAnnex instanceof DefaultAnnexLibrary) {
AnnexLibrary annexLib = ((DefaultAnnexLibrary) defaultAnnex).getParsedAnnexLibrary();
XtextResource resource = (XtextResource) annexLib.eResource();
grammerObject = helper.resolveContainedElementAt(resource, offset);
} else if (defaultAnnex instanceof DefaultAnnexSubclause) {
AnnexSubclause annexSub = ((DefaultAnnexSubclause) defaultAnnex).getParsedAnnexSubclause();
XtextResource resource = (XtextResource) annexSub.eResource();
grammerObject = helper.resolveContainedElementAt(resource, offset);
}
List<String> results = new ArrayList<>();
if (grammerObject instanceof SelectionExpr) {
results.addAll(getNestedDotIDCandidates((SelectionExpr) grammerObject));
}
return results;
}
use of org.osate.aadl2.AnnexLibrary in project AMASE by loonwerks.
the class SafetyPackageImpl method initializePackageContents.
/**
* Complete the initialization of the package and its meta-model. This
* method is guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void initializePackageContents() {
if (isInitialized)
return;
isInitialized = true;
// Initialize package
setName(eNAME);
setNsPrefix(eNS_PREFIX);
setNsURI(eNS_URI);
// Obtain other dependent packages
Aadl2Package theAadl2Package = (Aadl2Package) EPackage.Registry.INSTANCE.getEPackage(Aadl2Package.eNS_URI);
AgreePackage theAgreePackage = (AgreePackage) EPackage.Registry.INSTANCE.getEPackage(AgreePackage.eNS_URI);
EcorePackage theEcorePackage = (EcorePackage) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
annexLibraryEClass.getESuperTypes().add(theAadl2Package.getAnnexLibrary());
annexSubclauseEClass.getESuperTypes().add(theAadl2Package.getAnnexSubclause());
safetyLibraryEClass.getESuperTypes().add(this.getAnnexLibrary());
safetySubclauseEClass.getESuperTypes().add(this.getAnnexSubclause());
specStatementEClass.getESuperTypes().add(theAgreePackage.getSpecStatement());
faultSubcomponentEClass.getESuperTypes().add(theAadl2Package.getElement());
safetyEqStatementEClass.getESuperTypes().add(theAadl2Package.getElement());
safetyEqStatementEClass.getESuperTypes().add(this.getFaultSubcomponent());
safetyContractLibraryEClass.getESuperTypes().add(this.getSafetyLibrary());
safetyContractSubclauseEClass.getESuperTypes().add(this.getSafetySubclause());
safetyContractEClass.getESuperTypes().add(this.getContract());
faultStatementEClass.getESuperTypes().add(this.getSpecStatement());
analysisStatementEClass.getESuperTypes().add(this.getSpecStatement());
hwFaultStatementEClass.getESuperTypes().add(this.getSpecStatement());
propagateStatementEClass.getESuperTypes().add(this.getSpecStatement());
activationStatementEClass.getESuperTypes().add(this.getSpecStatement());
faultCountBehaviorEClass.getESuperTypes().add(this.getAnalysisBehavior());
probabilityBehaviorEClass.getESuperTypes().add(this.getAnalysisBehavior());
inputStatementEClass.getESuperTypes().add(this.getFaultSubcomponent());
outputStatementEClass.getESuperTypes().add(this.getFaultSubcomponent());
durationStatementEClass.getESuperTypes().add(this.getFaultSubcomponent());
durationStatementEClass.getESuperTypes().add(this.getHWFaultSubcomponent());
probabilityStatementEClass.getESuperTypes().add(this.getFaultSubcomponent());
probabilityStatementEClass.getESuperTypes().add(this.getHWFaultSubcomponent());
disableStatementEClass.getESuperTypes().add(this.getFaultSubcomponent());
triggerStatementEClass.getESuperTypes().add(this.getFaultSubcomponent());
propagationTypeStatementEClass.getESuperTypes().add(this.getFaultSubcomponent());
propagationTypeStatementEClass.getESuperTypes().add(this.getHWFaultSubcomponent());
asymmetricEClass.getESuperTypes().add(this.getPropagationTypeConstraint());
symmetricEClass.getESuperTypes().add(this.getPropagationTypeConstraint());
permanentConstraintEClass.getESuperTypes().add(this.getTemporalConstraint());
transientConstraintEClass.getESuperTypes().add(this.getTemporalConstraint());
enablerConditionEClass.getESuperTypes().add(this.getTriggerCondition());
eqValueEClass.getESuperTypes().add(this.getSafetyEqStatement());
intervalEqEClass.getESuperTypes().add(this.getSafetyEqStatement());
setEqEClass.getESuperTypes().add(this.getSafetyEqStatement());
rangeEqEClass.getESuperTypes().add(this.getSafetyEqStatement());
closedSafetyIntervalEClass.getESuperTypes().add(this.getSafetyInterval());
openLeftSafetyIntervalEClass.getESuperTypes().add(this.getSafetyInterval());
openRightSafetyIntervalEClass.getESuperTypes().add(this.getSafetyInterval());
openSafetyIntervalEClass.getESuperTypes().add(this.getSafetyInterval());
// Initialize classes and features; add operations and parameters
initEClass(annexLibraryEClass, AnnexLibrary.class, "AnnexLibrary", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(annexSubclauseEClass, AnnexSubclause.class, "AnnexSubclause", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(safetyLibraryEClass, SafetyLibrary.class, "SafetyLibrary", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(safetySubclauseEClass, SafetySubclause.class, "SafetySubclause", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(contractEClass, Contract.class, "Contract", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(specStatementEClass, SpecStatement.class, "SpecStatement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(analysisBehaviorEClass, AnalysisBehavior.class, "AnalysisBehavior", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(faultSubcomponentEClass, FaultSubcomponent.class, "FaultSubcomponent", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(hwFaultSubcomponentEClass, HWFaultSubcomponent.class, "HWFaultSubcomponent", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(propagationTypeConstraintEClass, PropagationTypeConstraint.class, "PropagationTypeConstraint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(temporalConstraintEClass, TemporalConstraint.class, "TemporalConstraint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(triggerConditionEClass, TriggerCondition.class, "TriggerCondition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(safetyEqStatementEClass, SafetyEqStatement.class, "SafetyEqStatement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(safetyIntervalEClass, SafetyInterval.class, "SafetyInterval", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getSafetyInterval_Low(), theAgreePackage.getExpr(), null, "low", null, 0, 1, SafetyInterval.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getSafetyInterval_High(), theAgreePackage.getExpr(), null, "high", null, 0, 1, SafetyInterval.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(safetyContractLibraryEClass, SafetyContractLibrary.class, "SafetyContractLibrary", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getSafetyContractLibrary_Contract(), this.getContract(), null, "contract", null, 0, 1, SafetyContractLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(safetyContractSubclauseEClass, SafetyContractSubclause.class, "SafetyContractSubclause", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getSafetyContractSubclause_Contract(), this.getContract(), null, "contract", null, 0, 1, SafetyContractSubclause.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(safetyContractEClass, SafetyContract.class, "SafetyContract", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getSafetyContract_Specs(), this.getSpecStatement(), null, "specs", null, 0, -1, SafetyContract.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(faultStatementEClass, FaultStatement.class, "FaultStatement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getFaultStatement_Name(), theEcorePackage.getEString(), "name", null, 0, 1, FaultStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getFaultStatement_Str(), theEcorePackage.getEString(), "str", null, 0, 1, FaultStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getFaultStatement_FaultDefName(), theAgreePackage.getDoubleDotRef(), null, "faultDefName", null, 0, 1, FaultStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getFaultStatement_FaultDefinitions(), this.getFaultSubcomponent(), null, "faultDefinitions", null, 0, -1, FaultStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(analysisStatementEClass, AnalysisStatement.class, "AnalysisStatement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getAnalysisStatement_Behavior(), this.getAnalysisBehavior(), null, "behavior", null, 0, 1, AnalysisStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(hwFaultStatementEClass, HWFaultStatement.class, "HWFaultStatement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getHWFaultStatement_Name(), theEcorePackage.getEString(), "name", null, 0, 1, HWFaultStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getHWFaultStatement_Str(), theEcorePackage.getEString(), "str", null, 0, 1, HWFaultStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getHWFaultStatement_FaultDefinitions(), this.getHWFaultSubcomponent(), null, "faultDefinitions", null, 0, -1, HWFaultStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(propagateStatementEClass, PropagateStatement.class, "PropagateStatement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getPropagateStatement_SrcFaultList(), theEcorePackage.getEString(), "srcFaultList", null, 0, -1, PropagateStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getPropagateStatement_SrcComp_path(), theAadl2Package.getNamedElement(), null, "srcComp_path", null, 0, -1, PropagateStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getPropagateStatement_DestFaultList(), theEcorePackage.getEString(), "destFaultList", null, 0, -1, PropagateStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getPropagateStatement_DestComp_path(), theAadl2Package.getNamedElement(), null, "destComp_path", null, 0, -1, PropagateStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(activationStatementEClass, ActivationStatement.class, "ActivationStatement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getActivationStatement_AgreeBoolVarName(), theEcorePackage.getEString(), "agreeBoolVarName", null, 0, 1, ActivationStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getActivationStatement_AgreeComp_Path(), theAadl2Package.getNamedElement(), null, "agreeComp_Path", null, 0, 1, ActivationStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getActivationStatement_FaultName(), theEcorePackage.getEString(), "faultName", null, 0, 1, ActivationStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getActivationStatement_FaultComp_Path(), theAadl2Package.getNamedElement(), null, "faultComp_Path", null, 0, 1, ActivationStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(faultCountBehaviorEClass, FaultCountBehavior.class, "FaultCountBehavior", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getFaultCountBehavior_MaxFaults(), theEcorePackage.getEString(), "maxFaults", null, 0, 1, FaultCountBehavior.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(probabilityBehaviorEClass, ProbabilityBehavior.class, "ProbabilityBehavior", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getProbabilityBehavior_Probabilty(), theEcorePackage.getEString(), "probabilty", null, 0, 1, ProbabilityBehavior.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(inputStatementEClass, InputStatement.class, "InputStatement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getInputStatement_Fault_in(), theEcorePackage.getEString(), "fault_in", null, 0, -1, InputStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getInputStatement_Nom_conn(), theAgreePackage.getExpr(), null, "nom_conn", null, 0, -1, InputStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(outputStatementEClass, OutputStatement.class, "OutputStatement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getOutputStatement_Nom_conn(), theAadl2Package.getNamedElement(), null, "nom_conn", null, 0, -1, OutputStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getOutputStatement_Fault_out(), theEcorePackage.getEString(), "fault_out", null, 0, -1, OutputStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(durationStatementEClass, DurationStatement.class, "DurationStatement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getDurationStatement_Tc(), this.getTemporalConstraint(), null, "tc", null, 0, 1, DurationStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getDurationStatement_Interv(), this.getSafetyInterval(), null, "interv", null, 0, 1, DurationStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(probabilityStatementEClass, ProbabilityStatement.class, "ProbabilityStatement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getProbabilityStatement_Probability(), theEcorePackage.getEString(), "probability", null, 0, 1, ProbabilityStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(disableStatementEClass, DisableStatement.class, "DisableStatement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getDisableStatement_Cond(), theAadl2Package.getBooleanLiteral(), null, "cond", null, 0, 1, DisableStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(triggerStatementEClass, TriggerStatement.class, "TriggerStatement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getTriggerStatement_Cond(), this.getTriggerCondition(), null, "cond", null, 0, 1, TriggerStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(propagationTypeStatementEClass, PropagationTypeStatement.class, "PropagationTypeStatement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getPropagationTypeStatement_Pty(), this.getPropagationTypeConstraint(), null, "pty", null, 0, 1, PropagationTypeStatement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(asymmetricEClass, asymmetric.class, "asymmetric", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(symmetricEClass, symmetric.class, "symmetric", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(permanentConstraintEClass, PermanentConstraint.class, "PermanentConstraint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(transientConstraintEClass, TransientConstraint.class, "TransientConstraint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(enablerConditionEClass, EnablerCondition.class, "EnablerCondition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getEnablerCondition_ExprList(), theAgreePackage.getExpr(), null, "exprList", null, 0, -1, EnablerCondition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(eqValueEClass, EqValue.class, "EqValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getEqValue_Lhs(), theAgreePackage.getArg(), null, "lhs", null, 0, -1, EqValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getEqValue_Expr(), theAgreePackage.getExpr(), null, "expr", null, 0, 1, EqValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(intervalEqEClass, IntervalEq.class, "IntervalEq", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getIntervalEq_Lhs_int(), theAgreePackage.getArg(), null, "lhs_int", null, 0, 1, IntervalEq.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getIntervalEq_Interv(), this.getSafetyInterval(), null, "interv", null, 0, 1, IntervalEq.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(setEqEClass, SetEq.class, "SetEq", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getSetEq_Lhs_set(), theAgreePackage.getArg(), null, "lhs_set", null, 0, 1, SetEq.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getSetEq_L1(), theAgreePackage.getExpr(), null, "l1", null, 0, 1, SetEq.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getSetEq_List(), theAgreePackage.getExpr(), null, "list", null, 0, -1, SetEq.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(rangeEqEClass, RangeEq.class, "RangeEq", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getRangeEq_Lhs_range(), theAgreePackage.getArg(), null, "lhs_range", null, 0, 1, RangeEq.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getRangeEq_L1(), theAgreePackage.getExpr(), null, "l1", null, 0, 1, RangeEq.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getRangeEq_L2(), theAgreePackage.getExpr(), null, "l2", null, 0, 1, RangeEq.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(closedSafetyIntervalEClass, ClosedSafetyInterval.class, "ClosedSafetyInterval", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(openLeftSafetyIntervalEClass, OpenLeftSafetyInterval.class, "OpenLeftSafetyInterval", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(openRightSafetyIntervalEClass, OpenRightSafetyInterval.class, "OpenRightSafetyInterval", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(openSafetyIntervalEClass, OpenSafetyInterval.class, "OpenSafetyInterval", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
// Create resource
createResource(eNS_URI);
}
use of org.osate.aadl2.AnnexLibrary in project osate-plugin by sireum.
the class VisitorUtil method buildPosInfo.
public static Position buildPosInfo(EObject elem) {
final org.sireum.hamr.ir.AadlASTFactory factory = new org.sireum.hamr.ir.AadlASTFactory();
EObject obj = elem;
if (obj == null) {
return null;
}
INode node = NodeModelUtils.findActualNodeFor(obj);
if (node != null) {
int startOffset = node.getOffset();
int endOffset = node.getEndOffset();
INode rnode = node.getRootNode();
if (//
rnode.getSemanticElement() != null && (rnode.getSemanticElement() instanceof AnnexLibrary || rnode.getSemanticElement() instanceof AnnexSubclause)) {
AadlPackage pack = AadlUtil.getContainingPackage(node.getRootNode().getSemanticElement());
INode ccNode = NodeModelUtils.findActualNodeFor(pack);
rnode = ccNode.getRootNode();
}
LineAndColumn startLC = NodeModelUtils.getLineAndColumn(rnode, startOffset);
LineAndColumn endLC = NodeModelUtils.getLineAndColumn(rnode, endOffset);
return factory.flatPos(getResourcePath(elem), startLC.getLine(), startLC.getColumn(), endLC.getLine(), endLC.getColumn(), node.getOffset(), node.getLength());
} else {
EObject defaultannex = AadlUtil.getContainingDefaultAnnex(obj);
if (defaultannex != null) {
node = NodeModelUtils.findActualNodeFor(obj);
if (node != null) {
return factory.flatPos(getResourcePath(elem), node.getTotalStartLine(), node.getOffset(), node.getTotalEndLine(), node.getEndOffset(), node.getOffset(), node.getLength());
}
}
}
return null;
}
use of org.osate.aadl2.AnnexLibrary in project AMASE by loonwerks.
the class SafetyLinkingService method getElm.
private Element getElm(EObject context, EReference reference, String name) {
String[] segments = name.split("::");
if (segments.length >= 2) {
String pkgName = String.join("::", Arrays.copyOf(segments, segments.length - 1));
String statementName = segments[segments.length - 1];
Namespace namespace = AadlUtil.getContainingTopLevelNamespace(context);
PropertySet propSet = AadlUtil.findImportedPropertySet(pkgName, namespace);
if (propSet != null) {
Element elm = propSet.findNamedElement(statementName);
return elm;
}
AadlPackage aadlPackage = AadlUtil.findImportedPackage(pkgName, namespace);
if (aadlPackage == null) {
for (PackageRename rename : EcoreUtil2.getAllContentsOfType(namespace.getElementRoot(), PackageRename.class)) {
if (rename.getName() != null && pkgName.equals(rename.getName())) {
aadlPackage = rename.getRenamedPackage();
}
}
}
if (aadlPackage != null) {
for (AnnexLibrary annex : AnnexUtil.getAllActualAnnexLibraries(aadlPackage, AgreePackage.eINSTANCE.getAgreeContractLibrary())) {
AgreeContract contract = (AgreeContract) ((AgreeContractLibrary) annex).getContract();
for (com.rockwellcollins.atc.agree.agree.SpecStatement spec : contract.getSpecs()) {
if (spec instanceof RecordDef) {
if (((RecordDef) spec).getName().equals(statementName)) {
return (spec);
}
} else if (spec instanceof FnDef) {
if (((FnDef) spec).getName().equals(statementName)) {
return (spec);
}
} else if (spec instanceof LibraryFnDef) {
if (((LibraryFnDef) spec).getName().equals(statementName)) {
return (spec);
}
} else if (spec instanceof NodeDef) {
if (((NodeDef) spec).getName().equals(statementName)) {
return (spec);
}
} else if (spec instanceof LinearizationDef) {
if (((LinearizationDef) spec).getName().equals(statementName)) {
return (spec);
}
} else if (spec instanceof ConstStatement) {
if (((ConstStatement) spec).getName().equals(statementName)) {
return (spec);
}
} else if (spec instanceof EnumStatement) {
if (((EnumStatement) spec).getName().equals(statementName)) {
return (spec);
}
EList<NamedID> enums = ((EnumStatement) spec).getEnums();
for (NamedID nid : enums) {
if (nid.getName().contentEquals(statementName)) {
return nid;
}
}
}
}
}
}
}
return null;
}
use of org.osate.aadl2.AnnexLibrary in project AMASE by loonwerks.
the class SafetyScopeProvider method getNamedElements.
private Set<NamedElement> getNamedElements(EObject ctx) {
Set<NamedElement> components = new HashSet<>();
if (ctx instanceof AadlPackage) {
PublicPackageSection pubSec = ((AadlPackage) ctx).getPublicSection();
for (Element el : pubSec.getOwnedElements()) {
if (el instanceof DataImplementation || el instanceof DataType) {
components.add((NamedElement) el);
}
}
for (AnnexLibrary annex : AnnexUtil.getAllActualAnnexLibraries(((AadlPackage) ctx), AgreePackage.eINSTANCE.getAgreeContractLibrary())) {
AgreeContract contract = (AgreeContract) ((AgreeContractLibrary) annex).getContract();
components.addAll(getNamedElementsFromSpecs(contract.getSpecs()));
}
components.add((AadlPackage) ctx);
} else {
components.addAll(getNamedElementsFromClassifier((Classifier) ctx, false));
}
return components;
}
Aggregations