Search in sources :

Example 1 with APropertyReference

use of org.osate.alisa.common.common.APropertyReference in project osate2 by osate.

the class CommonSemanticSequencer 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.AADL_BOOLEAN:
                sequence_TypeRef(context, (AadlBoolean) semanticObject);
                return;
            case Aadl2Package.AADL_INTEGER:
                sequence_TypeRef(context, (AadlInteger) semanticObject);
                return;
            case Aadl2Package.AADL_REAL:
                sequence_TypeRef(context, (AadlReal) semanticObject);
                return;
            case Aadl2Package.AADL_STRING:
                sequence_TypeRef(context, (AadlString) semanticObject);
                return;
            case Aadl2Package.BOOLEAN_LITERAL:
                sequence_ABooleanLiteral(context, (BooleanLiteral) semanticObject);
                return;
            case Aadl2Package.INTEGER_LITERAL:
                sequence_AIntegerTerm(context, (IntegerLiteral) semanticObject);
                return;
            case Aadl2Package.REAL_LITERAL:
                sequence_ARealTerm(context, (RealLiteral) semanticObject);
                return;
            case Aadl2Package.STRING_LITERAL:
                sequence_StringTerm(context, (StringLiteral) semanticObject);
                return;
        }
    else if (epackage == CommonPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case CommonPackage.ABINARY_OPERATION:
                sequence_AAdditiveExpression_AAndExpression_AEqualityExpression_AMultiplicativeExpression_AOrExpression_ARelationalExpression(context, (ABinaryOperation) semanticObject);
                return;
            case CommonPackage.ACONDITIONAL:
                sequence_AIfExpression(context, (AConditional) semanticObject);
                return;
            case CommonPackage.AFUNCTION_CALL:
                sequence_AFunctionCall(context, (AFunctionCall) semanticObject);
                return;
            case CommonPackage.AMODEL_REFERENCE:
                sequence_AModelReference(context, (AModelReference) semanticObject);
                return;
            case CommonPackage.APROPERTY_REFERENCE:
                if (rule == grammarAccess.getAModelOrPropertyReferenceRule() || rule == grammarAccess.getAExpressionRule() || rule == grammarAccess.getAOrExpressionRule() || action == grammarAccess.getAOrExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAAndExpressionRule() || action == grammarAccess.getAAndExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAEqualityExpressionRule() || action == grammarAccess.getAEqualityExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getARelationalExpressionRule() || action == grammarAccess.getARelationalExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAAdditiveExpressionRule() || action == grammarAccess.getAAdditiveExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAMultiplicativeExpressionRule() || action == grammarAccess.getAMultiplicativeExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAUnaryOperationRule() || rule == grammarAccess.getAUnitExpressionRule() || action == grammarAccess.getAUnitExpressionAccess().getAUnitExpressionExpressionAction_1_0() || rule == grammarAccess.getAPrimaryExpressionRule() || rule == grammarAccess.getAParenthesizedExpressionRule()) {
                    sequence_AModelOrPropertyReference_APropertyReference(context, (APropertyReference) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAPropertyReferenceRule()) {
                    sequence_APropertyReference(context, (APropertyReference) semanticObject);
                    return;
                } else
                    break;
            case CommonPackage.ARANGE:
                sequence_ARangeExpression(context, (ARange) semanticObject);
                return;
            case CommonPackage.AUNARY_OPERATION:
                sequence_AUnaryOperation(context, (AUnaryOperation) semanticObject);
                return;
            case CommonPackage.AUNIT_EXPRESSION:
                if (rule == grammarAccess.getAExpressionRule() || rule == grammarAccess.getAOrExpressionRule() || action == grammarAccess.getAOrExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAAndExpressionRule() || action == grammarAccess.getAAndExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAEqualityExpressionRule() || action == grammarAccess.getAEqualityExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getARelationalExpressionRule() || action == grammarAccess.getARelationalExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAAdditiveExpressionRule() || action == grammarAccess.getAAdditiveExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAMultiplicativeExpressionRule() || action == grammarAccess.getAMultiplicativeExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAUnaryOperationRule() || rule == grammarAccess.getAUnitExpressionRule() || action == grammarAccess.getAUnitExpressionAccess().getAUnitExpressionExpressionAction_1_0() || rule == grammarAccess.getAPrimaryExpressionRule() || rule == grammarAccess.getAParenthesizedExpressionRule()) {
                    sequence_AUnitExpression(context, (AUnitExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getShowValueRule()) {
                    sequence_ShowValue(context, (AUnitExpression) semanticObject);
                    return;
                } else
                    break;
            case CommonPackage.AVARIABLE_REFERENCE:
                sequence_AVariableReference(context, (AVariableReference) semanticObject);
                return;
            case CommonPackage.COMPUTE_DECLARATION:
                sequence_ComputeDeclaration(context, (ComputeDeclaration) semanticObject);
                return;
            case CommonPackage.DESCRIPTION:
                sequence_Description(context, (Description) semanticObject);
                return;
            case CommonPackage.DESCRIPTION_ELEMENT:
                sequence_DescriptionElement(context, (DescriptionElement) semanticObject);
                return;
            case CommonPackage.IMAGE_REFERENCE:
                sequence_ImageReference(context, (ImageReference) semanticObject);
                return;
            case CommonPackage.MODEL_REF:
                sequence_TypeRef(context, (ModelRef) semanticObject);
                return;
            case CommonPackage.PROPERTY_REF:
                sequence_PropertyRef(context, (PropertyRef) semanticObject);
                return;
            case CommonPackage.RATIONALE:
                sequence_Rationale(context, (Rationale) semanticObject);
                return;
            case CommonPackage.TYPE_REF:
                sequence_TypeRef(context, (TypeRef) semanticObject);
                return;
            case CommonPackage.UNCERTAINTY:
                sequence_Uncertainty(context, (Uncertainty) semanticObject);
                return;
            case CommonPackage.VAL_DECLARATION:
                sequence_ValDeclaration(context, (ValDeclaration) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : AadlReal(org.osate.aadl2.AadlReal) ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) APropertyReference(org.osate.alisa.common.common.APropertyReference) BooleanLiteral(org.osate.aadl2.BooleanLiteral) AUnitExpression(org.osate.alisa.common.common.AUnitExpression) EPackage(org.eclipse.emf.ecore.EPackage) RealLiteral(org.osate.aadl2.RealLiteral) AadlBoolean(org.osate.aadl2.AadlBoolean) StringLiteral(org.osate.aadl2.StringLiteral) Parameter(org.eclipse.xtext.Parameter) AadlInteger(org.osate.aadl2.AadlInteger) AadlString(org.osate.aadl2.AadlString) IntegerLiteral(org.osate.aadl2.IntegerLiteral)

Example 2 with APropertyReference

use of org.osate.alisa.common.common.APropertyReference in project osate2 by osate.

the class ReqSpecSemanticSequencer 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.AADL_BOOLEAN:
                sequence_TypeRef(context, (AadlBoolean) semanticObject);
                return;
            case Aadl2Package.AADL_INTEGER:
                sequence_TypeRef(context, (AadlInteger) semanticObject);
                return;
            case Aadl2Package.AADL_REAL:
                sequence_TypeRef(context, (AadlReal) semanticObject);
                return;
            case Aadl2Package.AADL_STRING:
                sequence_TypeRef(context, (AadlString) semanticObject);
                return;
            case Aadl2Package.BOOLEAN_LITERAL:
                sequence_ABooleanLiteral(context, (BooleanLiteral) semanticObject);
                return;
            case Aadl2Package.INTEGER_LITERAL:
                sequence_AIntegerTerm(context, (IntegerLiteral) semanticObject);
                return;
            case Aadl2Package.REAL_LITERAL:
                sequence_ARealTerm(context, (RealLiteral) semanticObject);
                return;
            case Aadl2Package.STRING_LITERAL:
                sequence_StringTerm(context, (StringLiteral) semanticObject);
                return;
        }
    else if (epackage == CommonPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case CommonPackage.ABINARY_OPERATION:
                sequence_AAdditiveExpression_AAndExpression_AEqualityExpression_AMultiplicativeExpression_AOrExpression_ARelationalExpression(context, (ABinaryOperation) semanticObject);
                return;
            case CommonPackage.ACONDITIONAL:
                sequence_AIfExpression(context, (AConditional) semanticObject);
                return;
            case CommonPackage.AFUNCTION_CALL:
                sequence_AFunctionCall(context, (AFunctionCall) semanticObject);
                return;
            case CommonPackage.AMODEL_REFERENCE:
                sequence_AModelReference(context, (AModelReference) semanticObject);
                return;
            case CommonPackage.APROPERTY_REFERENCE:
                if (rule == grammarAccess.getAModelOrPropertyReferenceRule() || rule == grammarAccess.getAExpressionRule() || rule == grammarAccess.getAOrExpressionRule() || action == grammarAccess.getAOrExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAAndExpressionRule() || action == grammarAccess.getAAndExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAEqualityExpressionRule() || action == grammarAccess.getAEqualityExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getARelationalExpressionRule() || action == grammarAccess.getARelationalExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAAdditiveExpressionRule() || action == grammarAccess.getAAdditiveExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAMultiplicativeExpressionRule() || action == grammarAccess.getAMultiplicativeExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAUnaryOperationRule() || rule == grammarAccess.getAUnitExpressionRule() || action == grammarAccess.getAUnitExpressionAccess().getAUnitExpressionExpressionAction_1_0() || rule == grammarAccess.getAPrimaryExpressionRule() || rule == grammarAccess.getAParenthesizedExpressionRule()) {
                    sequence_AModelOrPropertyReference_APropertyReference(context, (APropertyReference) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAPropertyReferenceRule()) {
                    sequence_APropertyReference(context, (APropertyReference) semanticObject);
                    return;
                } else
                    break;
            case CommonPackage.ARANGE:
                sequence_ARangeExpression(context, (ARange) semanticObject);
                return;
            case CommonPackage.AUNARY_OPERATION:
                sequence_AUnaryOperation(context, (AUnaryOperation) semanticObject);
                return;
            case CommonPackage.AUNIT_EXPRESSION:
                if (rule == grammarAccess.getAExpressionRule() || rule == grammarAccess.getAOrExpressionRule() || action == grammarAccess.getAOrExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAAndExpressionRule() || action == grammarAccess.getAAndExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAEqualityExpressionRule() || action == grammarAccess.getAEqualityExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getARelationalExpressionRule() || action == grammarAccess.getARelationalExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAAdditiveExpressionRule() || action == grammarAccess.getAAdditiveExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAMultiplicativeExpressionRule() || action == grammarAccess.getAMultiplicativeExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAUnaryOperationRule() || rule == grammarAccess.getAUnitExpressionRule() || action == grammarAccess.getAUnitExpressionAccess().getAUnitExpressionExpressionAction_1_0() || rule == grammarAccess.getAPrimaryExpressionRule() || rule == grammarAccess.getAParenthesizedExpressionRule()) {
                    sequence_AUnitExpression(context, (AUnitExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getShowValueRule()) {
                    sequence_ShowValue(context, (AUnitExpression) semanticObject);
                    return;
                } else
                    break;
            case CommonPackage.AVARIABLE_REFERENCE:
                sequence_AVariableReference(context, (AVariableReference) semanticObject);
                return;
            case CommonPackage.COMPUTE_DECLARATION:
                sequence_ComputeDeclaration(context, (ComputeDeclaration) semanticObject);
                return;
            case CommonPackage.DESCRIPTION:
                sequence_Description(context, (Description) semanticObject);
                return;
            case CommonPackage.DESCRIPTION_ELEMENT:
                sequence_DescriptionElement(context, (DescriptionElement) semanticObject);
                return;
            case CommonPackage.IMAGE_REFERENCE:
                sequence_ImageReference(context, (ImageReference) semanticObject);
                return;
            case CommonPackage.MODEL_REF:
                sequence_TypeRef(context, (ModelRef) semanticObject);
                return;
            case CommonPackage.PROPERTY_REF:
                sequence_PropertyRef(context, (PropertyRef) semanticObject);
                return;
            case CommonPackage.RATIONALE:
                sequence_Rationale(context, (Rationale) semanticObject);
                return;
            case CommonPackage.TYPE_REF:
                sequence_TypeRef(context, (TypeRef) semanticObject);
                return;
            case CommonPackage.UNCERTAINTY:
                sequence_Uncertainty(context, (Uncertainty) semanticObject);
                return;
        }
    else if (epackage == ReqSpecPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case ReqSpecPackage.DESIRED_VALUE:
                sequence_DesiredValue(context, (DesiredValue) semanticObject);
                return;
            case ReqSpecPackage.DOCUMENT_SECTION:
                sequence_DocumentSection(context, (DocumentSection) semanticObject);
                return;
            case ReqSpecPackage.EXTERNAL_DOCUMENT:
                sequence_ExternalDocument(context, (ExternalDocument) semanticObject);
                return;
            case ReqSpecPackage.GLOBAL_CONSTANTS:
                sequence_GlobalConstants(context, (GlobalConstants) semanticObject);
                return;
            case ReqSpecPackage.GLOBAL_REQUIREMENT_SET:
                sequence_GlobalRequirementSet(context, (GlobalRequirementSet) semanticObject);
                return;
            case ReqSpecPackage.GOAL:
                if (rule == grammarAccess.getDocGoalRule()) {
                    sequence_DocGoal(context, (Goal) semanticObject);
                    return;
                } else if (rule == grammarAccess.getContractualElementRule() || rule == grammarAccess.getGoalRule()) {
                    sequence_Goal(context, (Goal) semanticObject);
                    return;
                } else
                    break;
            case ReqSpecPackage.INCLUDE_GLOBAL_REQUIREMENT:
                sequence_IncludeGlobalRequirement(context, (IncludeGlobalRequirement) semanticObject);
                return;
            case ReqSpecPackage.INFORMAL_PREDICATE:
                sequence_InformalPredicate(context, (InformalPredicate) semanticObject);
                return;
            case ReqSpecPackage.REQ_DOCUMENT:
                sequence_ReqDocument(context, (ReqDocument) semanticObject);
                return;
            case ReqSpecPackage.REQ_SPEC:
                sequence_ReqSpec(context, (ReqSpec) semanticObject);
                return;
            case ReqSpecPackage.REQ_VAL_DECLARATION:
                sequence_ValDeclaration(context, (ReqValDeclaration) semanticObject);
                return;
            case ReqSpecPackage.REQUIREMENT:
                if (rule == grammarAccess.getDocRequirementRule()) {
                    sequence_DocRequirement(context, (Requirement) semanticObject);
                    return;
                } else if (rule == grammarAccess.getGlobalRequirementRule()) {
                    sequence_GlobalRequirement(context, (Requirement) semanticObject);
                    return;
                } else if (rule == grammarAccess.getContractualElementRule() || rule == grammarAccess.getSystemRequirementRule()) {
                    sequence_SystemRequirement(context, (Requirement) semanticObject);
                    return;
                } else
                    break;
            case ReqSpecPackage.STAKEHOLDER_GOALS:
                sequence_StakeholderGoals(context, (StakeholderGoals) semanticObject);
                return;
            case ReqSpecPackage.SYSTEM_REQUIREMENT_SET:
                sequence_SystemRequirementSet(context, (SystemRequirementSet) semanticObject);
                return;
            case ReqSpecPackage.VALUE_PREDICATE:
                sequence_ValuePredicate(context, (ValuePredicate) semanticObject);
                return;
            case ReqSpecPackage.WHEN_CONDITION:
                sequence_WhenCondition(context, (WhenCondition) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) ExternalDocument(org.osate.reqspec.reqSpec.ExternalDocument) APropertyReference(org.osate.alisa.common.common.APropertyReference) BooleanLiteral(org.osate.aadl2.BooleanLiteral) EPackage(org.eclipse.emf.ecore.EPackage) InformalPredicate(org.osate.reqspec.reqSpec.InformalPredicate) RealLiteral(org.osate.aadl2.RealLiteral) Goal(org.osate.reqspec.reqSpec.Goal) IncludeGlobalRequirement(org.osate.reqspec.reqSpec.IncludeGlobalRequirement) ValuePredicate(org.osate.reqspec.reqSpec.ValuePredicate) AadlInteger(org.osate.aadl2.AadlInteger) AadlString(org.osate.aadl2.AadlString) IntegerLiteral(org.osate.aadl2.IntegerLiteral) ReqDocument(org.osate.reqspec.reqSpec.ReqDocument) ReqValDeclaration(org.osate.reqspec.reqSpec.ReqValDeclaration) AadlReal(org.osate.aadl2.AadlReal) ReqSpec(org.osate.reqspec.reqSpec.ReqSpec) GlobalRequirementSet(org.osate.reqspec.reqSpec.GlobalRequirementSet) DocumentSection(org.osate.reqspec.reqSpec.DocumentSection) GlobalConstants(org.osate.reqspec.reqSpec.GlobalConstants) AUnitExpression(org.osate.alisa.common.common.AUnitExpression) Requirement(org.osate.reqspec.reqSpec.Requirement) IncludeGlobalRequirement(org.osate.reqspec.reqSpec.IncludeGlobalRequirement) AadlBoolean(org.osate.aadl2.AadlBoolean) StakeholderGoals(org.osate.reqspec.reqSpec.StakeholderGoals) StringLiteral(org.osate.aadl2.StringLiteral) DesiredValue(org.osate.reqspec.reqSpec.DesiredValue) SystemRequirementSet(org.osate.reqspec.reqSpec.SystemRequirementSet) WhenCondition(org.osate.reqspec.reqSpec.WhenCondition) Parameter(org.eclipse.xtext.Parameter)

Example 3 with APropertyReference

use of org.osate.alisa.common.common.APropertyReference in project osate2 by osate.

the class VerifySemanticSequencer 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.AADL_BOOLEAN:
                sequence_TypeRef(context, (AadlBoolean) semanticObject);
                return;
            case Aadl2Package.AADL_INTEGER:
                sequence_TypeRef(context, (AadlInteger) semanticObject);
                return;
            case Aadl2Package.AADL_REAL:
                sequence_TypeRef(context, (AadlReal) semanticObject);
                return;
            case Aadl2Package.AADL_STRING:
                sequence_TypeRef(context, (AadlString) semanticObject);
                return;
            case Aadl2Package.BOOLEAN_LITERAL:
                sequence_ABooleanLiteral(context, (BooleanLiteral) semanticObject);
                return;
            case Aadl2Package.INTEGER_LITERAL:
                sequence_AIntegerTerm(context, (IntegerLiteral) semanticObject);
                return;
            case Aadl2Package.REAL_LITERAL:
                sequence_ARealTerm(context, (RealLiteral) semanticObject);
                return;
            case Aadl2Package.STRING_LITERAL:
                sequence_StringTerm(context, (StringLiteral) semanticObject);
                return;
        }
    else if (epackage == CommonPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case CommonPackage.ABINARY_OPERATION:
                sequence_AAdditiveExpression_AAndExpression_AEqualityExpression_AMultiplicativeExpression_AOrExpression_ARelationalExpression(context, (ABinaryOperation) semanticObject);
                return;
            case CommonPackage.ACONDITIONAL:
                sequence_AIfExpression(context, (AConditional) semanticObject);
                return;
            case CommonPackage.AFUNCTION_CALL:
                sequence_AFunctionCall(context, (AFunctionCall) semanticObject);
                return;
            case CommonPackage.AMODEL_REFERENCE:
                sequence_AModelReference(context, (AModelReference) semanticObject);
                return;
            case CommonPackage.APROPERTY_REFERENCE:
                if (rule == grammarAccess.getAModelOrPropertyReferenceRule() || rule == grammarAccess.getAExpressionRule() || rule == grammarAccess.getAOrExpressionRule() || action == grammarAccess.getAOrExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAAndExpressionRule() || action == grammarAccess.getAAndExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAEqualityExpressionRule() || action == grammarAccess.getAEqualityExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getARelationalExpressionRule() || action == grammarAccess.getARelationalExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAAdditiveExpressionRule() || action == grammarAccess.getAAdditiveExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAMultiplicativeExpressionRule() || action == grammarAccess.getAMultiplicativeExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAUnaryOperationRule() || rule == grammarAccess.getAUnitExpressionRule() || action == grammarAccess.getAUnitExpressionAccess().getAUnitExpressionExpressionAction_1_0() || rule == grammarAccess.getAPrimaryExpressionRule() || rule == grammarAccess.getAParenthesizedExpressionRule()) {
                    sequence_AModelOrPropertyReference_APropertyReference(context, (APropertyReference) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAPropertyReferenceRule()) {
                    sequence_APropertyReference(context, (APropertyReference) semanticObject);
                    return;
                } else
                    break;
            case CommonPackage.ARANGE:
                sequence_ARangeExpression(context, (ARange) semanticObject);
                return;
            case CommonPackage.AUNARY_OPERATION:
                sequence_AUnaryOperation(context, (AUnaryOperation) semanticObject);
                return;
            case CommonPackage.AUNIT_EXPRESSION:
                if (rule == grammarAccess.getAExpressionRule() || rule == grammarAccess.getAOrExpressionRule() || action == grammarAccess.getAOrExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAAndExpressionRule() || action == grammarAccess.getAAndExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAEqualityExpressionRule() || action == grammarAccess.getAEqualityExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getARelationalExpressionRule() || action == grammarAccess.getARelationalExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAAdditiveExpressionRule() || action == grammarAccess.getAAdditiveExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAMultiplicativeExpressionRule() || action == grammarAccess.getAMultiplicativeExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAUnaryOperationRule() || rule == grammarAccess.getAUnitExpressionRule() || action == grammarAccess.getAUnitExpressionAccess().getAUnitExpressionExpressionAction_1_0() || rule == grammarAccess.getAPrimaryExpressionRule() || rule == grammarAccess.getAParenthesizedExpressionRule()) {
                    sequence_AUnitExpression(context, (AUnitExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getShowValueRule()) {
                    sequence_ShowValue(context, (AUnitExpression) semanticObject);
                    return;
                } else
                    break;
            case CommonPackage.AVARIABLE_REFERENCE:
                sequence_AVariableReference(context, (AVariableReference) semanticObject);
                return;
            case CommonPackage.COMPUTE_DECLARATION:
                sequence_ComputeDeclaration(context, (ComputeDeclaration) semanticObject);
                return;
            case CommonPackage.DESCRIPTION:
                sequence_Description(context, (Description) semanticObject);
                return;
            case CommonPackage.DESCRIPTION_ELEMENT:
                sequence_DescriptionElement(context, (DescriptionElement) semanticObject);
                return;
            case CommonPackage.IMAGE_REFERENCE:
                sequence_ImageReference(context, (ImageReference) semanticObject);
                return;
            case CommonPackage.MODEL_REF:
                sequence_TypeRef(context, (ModelRef) semanticObject);
                return;
            case CommonPackage.PROPERTY_REF:
                sequence_PropertyRef(context, (PropertyRef) semanticObject);
                return;
            case CommonPackage.RATIONALE:
                sequence_Rationale(context, (Rationale) semanticObject);
                return;
            case CommonPackage.TYPE_REF:
                sequence_TypeRef(context, (TypeRef) semanticObject);
                return;
            case CommonPackage.UNCERTAINTY:
                sequence_Uncertainty(context, (Uncertainty) semanticObject);
                return;
            case CommonPackage.VAL_DECLARATION:
                sequence_ValDeclaration(context, (ValDeclaration) semanticObject);
                return;
        }
    else if (epackage == VerifyPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case VerifyPackage.AGREE_METHOD:
                sequence_AgreeMethod(context, (AgreeMethod) semanticObject);
                return;
            case VerifyPackage.ALL_EXPR:
                sequence_QuantifiedEvidenceExpr(context, (AllExpr) semanticObject);
                return;
            case VerifyPackage.CLAIM:
                sequence_Claim(context, (Claim) semanticObject);
                return;
            case VerifyPackage.COMPUTE_REF:
                sequence_ComputeRef(context, (ComputeRef) semanticObject);
                return;
            case VerifyPackage.ELSE_EXPR:
                if (rule == grammarAccess.getArgumentExprRule() || rule == grammarAccess.getThenEvidenceExprRule() || action == grammarAccess.getThenEvidenceExprAccess().getThenExprLeftAction_1_0_0_0() || rule == grammarAccess.getElseEvidenceExprRule() || rule == grammarAccess.getCompositeElseEvidenceExprRule() || action == grammarAccess.getCompositeElseEvidenceExprAccess().getElseExprLeftAction_1_0_0_0() || rule == grammarAccess.getCompositeEvidenceExprRule()) {
                    sequence_CompositeElseEvidenceExpr_SingleElseEvidenceExpr(context, (ElseExpr) semanticObject);
                    return;
                } else if (rule == grammarAccess.getSingleElseEvidenceExprRule() || action == grammarAccess.getSingleElseEvidenceExprAccess().getElseExprLeftAction_1_0_0_0()) {
                    sequence_SingleElseEvidenceExpr(context, (ElseExpr) semanticObject);
                    return;
                } else
                    break;
            case VerifyPackage.FORMAL_PARAMETER:
                sequence_FormalParameter(context, (FormalParameter) semanticObject);
                return;
            case VerifyPackage.JUNIT4_METHOD:
                sequence_JUnit4Method(context, (JUnit4Method) semanticObject);
                return;
            case VerifyPackage.JAVA_METHOD:
                sequence_JavaMethod(context, (JavaMethod) semanticObject);
                return;
            case VerifyPackage.JAVA_PARAMETER:
                sequence_JavaParameter(context, (JavaParameter) semanticObject);
                return;
            case VerifyPackage.MANUAL_METHOD:
                sequence_ManualMethod(context, (ManualMethod) semanticObject);
                return;
            case VerifyPackage.PLUGIN_METHOD:
                sequence_PluginMethod(context, (PluginMethod) semanticObject);
                return;
            case VerifyPackage.PYTHON_METHOD:
                sequence_PythonMethod(context, (PythonMethod) semanticObject);
                return;
            case VerifyPackage.REF_EXPR:
                sequence_VAReference(context, (RefExpr) semanticObject);
                return;
            case VerifyPackage.RESOLUTE_METHOD:
                sequence_ResoluteMethod(context, (ResoluteMethod) semanticObject);
                return;
            case VerifyPackage.THEN_EXPR:
                sequence_ThenEvidenceExpr(context, (ThenExpr) semanticObject);
                return;
            case VerifyPackage.VERIFICATION:
                sequence_Verification(context, (Verification) semanticObject);
                return;
            case VerifyPackage.VERIFICATION_ACTIVITY:
                sequence_VerificationActivity(context, (VerificationActivity) semanticObject);
                return;
            case VerifyPackage.VERIFICATION_METHOD:
                sequence_VerificationMethod(context, (VerificationMethod) semanticObject);
                return;
            case VerifyPackage.VERIFICATION_METHOD_REGISTRY:
                sequence_VerificationMethodRegistry(context, (VerificationMethodRegistry) semanticObject);
                return;
            case VerifyPackage.VERIFICATION_PLAN:
                sequence_VerificationPlan(context, (VerificationPlan) semanticObject);
                return;
            case VerifyPackage.VERIFICATION_PRECONDITION:
                sequence_VerificationPrecondition(context, (VerificationPrecondition) semanticObject);
                return;
            case VerifyPackage.VERIFICATION_VALIDATION:
                sequence_VerificationValidation(context, (VerificationValidation) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) APropertyReference(org.osate.alisa.common.common.APropertyReference) AllExpr(org.osate.verify.verify.AllExpr) BooleanLiteral(org.osate.aadl2.BooleanLiteral) VerificationValidation(org.osate.verify.verify.VerificationValidation) ComputeRef(org.osate.verify.verify.ComputeRef) EPackage(org.eclipse.emf.ecore.EPackage) RealLiteral(org.osate.aadl2.RealLiteral) ElseExpr(org.osate.verify.verify.ElseExpr) VerificationPlan(org.osate.verify.verify.VerificationPlan) PythonMethod(org.osate.verify.verify.PythonMethod) ResoluteMethod(org.osate.verify.verify.ResoluteMethod) PluginMethod(org.osate.verify.verify.PluginMethod) JavaMethod(org.osate.verify.verify.JavaMethod) JavaParameter(org.osate.verify.verify.JavaParameter) VerificationActivity(org.osate.verify.verify.VerificationActivity) AadlInteger(org.osate.aadl2.AadlInteger) AadlString(org.osate.aadl2.AadlString) IntegerLiteral(org.osate.aadl2.IntegerLiteral) RefExpr(org.osate.verify.verify.RefExpr) AadlReal(org.osate.aadl2.AadlReal) FormalParameter(org.osate.verify.verify.FormalParameter) ThenExpr(org.osate.verify.verify.ThenExpr) VerificationPrecondition(org.osate.verify.verify.VerificationPrecondition) AgreeMethod(org.osate.verify.verify.AgreeMethod) JUnit4Method(org.osate.verify.verify.JUnit4Method) Verification(org.osate.verify.verify.Verification) AUnitExpression(org.osate.alisa.common.common.AUnitExpression) ManualMethod(org.osate.verify.verify.ManualMethod) VerificationMethodRegistry(org.osate.verify.verify.VerificationMethodRegistry) AadlBoolean(org.osate.aadl2.AadlBoolean) StringLiteral(org.osate.aadl2.StringLiteral) VerificationMethod(org.osate.verify.verify.VerificationMethod) JavaParameter(org.osate.verify.verify.JavaParameter) FormalParameter(org.osate.verify.verify.FormalParameter) Parameter(org.eclipse.xtext.Parameter) Claim(org.osate.verify.verify.Claim)

Example 4 with APropertyReference

use of org.osate.alisa.common.common.APropertyReference in project osate2 by osate.

the class AlisaSemanticSequencer 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.AADL_BOOLEAN:
                sequence_TypeRef(context, (AadlBoolean) semanticObject);
                return;
            case Aadl2Package.AADL_INTEGER:
                sequence_TypeRef(context, (AadlInteger) semanticObject);
                return;
            case Aadl2Package.AADL_REAL:
                sequence_TypeRef(context, (AadlReal) semanticObject);
                return;
            case Aadl2Package.AADL_STRING:
                sequence_TypeRef(context, (AadlString) semanticObject);
                return;
            case Aadl2Package.BOOLEAN_LITERAL:
                sequence_ABooleanLiteral(context, (BooleanLiteral) semanticObject);
                return;
            case Aadl2Package.INTEGER_LITERAL:
                sequence_AIntegerTerm(context, (IntegerLiteral) semanticObject);
                return;
            case Aadl2Package.REAL_LITERAL:
                sequence_ARealTerm(context, (RealLiteral) semanticObject);
                return;
            case Aadl2Package.STRING_LITERAL:
                sequence_StringTerm(context, (StringLiteral) semanticObject);
                return;
        }
    else if (epackage == AlisaPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case AlisaPackage.ASSURANCE_CASE:
                sequence_AssuranceCase(context, (AssuranceCase) semanticObject);
                return;
            case AlisaPackage.ASSURANCE_PLAN:
                sequence_AssurancePlan(context, (AssurancePlan) semanticObject);
                return;
            case AlisaPackage.ASSURANCE_TASK:
                sequence_AssuranceTask(context, (AssuranceTask) semanticObject);
                return;
        }
    else if (epackage == CommonPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case CommonPackage.ABINARY_OPERATION:
                sequence_AAdditiveExpression_AAndExpression_AEqualityExpression_AMultiplicativeExpression_AOrExpression_ARelationalExpression(context, (ABinaryOperation) semanticObject);
                return;
            case CommonPackage.ACONDITIONAL:
                sequence_AIfExpression(context, (AConditional) semanticObject);
                return;
            case CommonPackage.AFUNCTION_CALL:
                sequence_AFunctionCall(context, (AFunctionCall) semanticObject);
                return;
            case CommonPackage.AMODEL_REFERENCE:
                sequence_AModelReference(context, (AModelReference) semanticObject);
                return;
            case CommonPackage.APROPERTY_REFERENCE:
                if (rule == grammarAccess.getAModelOrPropertyReferenceRule() || rule == grammarAccess.getAExpressionRule() || rule == grammarAccess.getAOrExpressionRule() || action == grammarAccess.getAOrExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAAndExpressionRule() || action == grammarAccess.getAAndExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAEqualityExpressionRule() || action == grammarAccess.getAEqualityExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getARelationalExpressionRule() || action == grammarAccess.getARelationalExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAAdditiveExpressionRule() || action == grammarAccess.getAAdditiveExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAMultiplicativeExpressionRule() || action == grammarAccess.getAMultiplicativeExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAUnaryOperationRule() || rule == grammarAccess.getAUnitExpressionRule() || action == grammarAccess.getAUnitExpressionAccess().getAUnitExpressionExpressionAction_1_0() || rule == grammarAccess.getAPrimaryExpressionRule() || rule == grammarAccess.getAParenthesizedExpressionRule()) {
                    sequence_AModelOrPropertyReference_APropertyReference(context, (APropertyReference) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAPropertyReferenceRule()) {
                    sequence_APropertyReference(context, (APropertyReference) semanticObject);
                    return;
                } else
                    break;
            case CommonPackage.ARANGE:
                sequence_ARangeExpression(context, (ARange) semanticObject);
                return;
            case CommonPackage.AUNARY_OPERATION:
                sequence_AUnaryOperation(context, (AUnaryOperation) semanticObject);
                return;
            case CommonPackage.AUNIT_EXPRESSION:
                if (rule == grammarAccess.getAExpressionRule() || rule == grammarAccess.getAOrExpressionRule() || action == grammarAccess.getAOrExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAAndExpressionRule() || action == grammarAccess.getAAndExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAEqualityExpressionRule() || action == grammarAccess.getAEqualityExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getARelationalExpressionRule() || action == grammarAccess.getARelationalExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAAdditiveExpressionRule() || action == grammarAccess.getAAdditiveExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAMultiplicativeExpressionRule() || action == grammarAccess.getAMultiplicativeExpressionAccess().getABinaryOperationLeftAction_1_0_0_0() || rule == grammarAccess.getAUnaryOperationRule() || rule == grammarAccess.getAUnitExpressionRule() || action == grammarAccess.getAUnitExpressionAccess().getAUnitExpressionExpressionAction_1_0() || rule == grammarAccess.getAPrimaryExpressionRule() || rule == grammarAccess.getAParenthesizedExpressionRule()) {
                    sequence_AUnitExpression(context, (AUnitExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getShowValueRule()) {
                    sequence_ShowValue(context, (AUnitExpression) semanticObject);
                    return;
                } else
                    break;
            case CommonPackage.AVARIABLE_REFERENCE:
                sequence_AVariableReference(context, (AVariableReference) semanticObject);
                return;
            case CommonPackage.COMPUTE_DECLARATION:
                sequence_ComputeDeclaration(context, (ComputeDeclaration) semanticObject);
                return;
            case CommonPackage.DESCRIPTION:
                sequence_Description(context, (Description) semanticObject);
                return;
            case CommonPackage.DESCRIPTION_ELEMENT:
                sequence_DescriptionElement(context, (DescriptionElement) semanticObject);
                return;
            case CommonPackage.IMAGE_REFERENCE:
                sequence_ImageReference(context, (ImageReference) semanticObject);
                return;
            case CommonPackage.MODEL_REF:
                sequence_TypeRef(context, (ModelRef) semanticObject);
                return;
            case CommonPackage.PROPERTY_REF:
                sequence_PropertyRef(context, (PropertyRef) semanticObject);
                return;
            case CommonPackage.RATIONALE:
                sequence_Rationale(context, (Rationale) semanticObject);
                return;
            case CommonPackage.TYPE_REF:
                sequence_TypeRef(context, (TypeRef) semanticObject);
                return;
            case CommonPackage.UNCERTAINTY:
                sequence_Uncertainty(context, (Uncertainty) semanticObject);
                return;
            case CommonPackage.VAL_DECLARATION:
                sequence_ValDeclaration(context, (ValDeclaration) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) AConditional(org.osate.alisa.common.common.AConditional) Uncertainty(org.osate.alisa.common.common.Uncertainty) Description(org.osate.alisa.common.common.Description) APropertyReference(org.osate.alisa.common.common.APropertyReference) BooleanLiteral(org.osate.aadl2.BooleanLiteral) AFunctionCall(org.osate.alisa.common.common.AFunctionCall) TypeRef(org.osate.alisa.common.common.TypeRef) AUnaryOperation(org.osate.alisa.common.common.AUnaryOperation) PropertyRef(org.osate.alisa.common.common.PropertyRef) EPackage(org.eclipse.emf.ecore.EPackage) RealLiteral(org.osate.aadl2.RealLiteral) AVariableReference(org.osate.alisa.common.common.AVariableReference) AadlInteger(org.osate.aadl2.AadlInteger) Rationale(org.osate.alisa.common.common.Rationale) AadlString(org.osate.aadl2.AadlString) IntegerLiteral(org.osate.aadl2.IntegerLiteral) AadlReal(org.osate.aadl2.AadlReal) AModelReference(org.osate.alisa.common.common.AModelReference) ARange(org.osate.alisa.common.common.ARange) ComputeDeclaration(org.osate.alisa.common.common.ComputeDeclaration) ValDeclaration(org.osate.alisa.common.common.ValDeclaration) DescriptionElement(org.osate.alisa.common.common.DescriptionElement) ABinaryOperation(org.osate.alisa.common.common.ABinaryOperation) AUnitExpression(org.osate.alisa.common.common.AUnitExpression) ImageReference(org.osate.alisa.common.common.ImageReference) AadlBoolean(org.osate.aadl2.AadlBoolean) StringLiteral(org.osate.aadl2.StringLiteral) Parameter(org.eclipse.xtext.Parameter) ModelRef(org.osate.alisa.common.common.ModelRef)

Aggregations

EPackage (org.eclipse.emf.ecore.EPackage)4 Action (org.eclipse.xtext.Action)4 Parameter (org.eclipse.xtext.Parameter)4 ParserRule (org.eclipse.xtext.ParserRule)4 AadlBoolean (org.osate.aadl2.AadlBoolean)4 AadlInteger (org.osate.aadl2.AadlInteger)4 AadlReal (org.osate.aadl2.AadlReal)4 AadlString (org.osate.aadl2.AadlString)4 BooleanLiteral (org.osate.aadl2.BooleanLiteral)4 IntegerLiteral (org.osate.aadl2.IntegerLiteral)4 RealLiteral (org.osate.aadl2.RealLiteral)4 StringLiteral (org.osate.aadl2.StringLiteral)4 APropertyReference (org.osate.alisa.common.common.APropertyReference)4 AUnitExpression (org.osate.alisa.common.common.AUnitExpression)4 ABinaryOperation (org.osate.alisa.common.common.ABinaryOperation)1 AConditional (org.osate.alisa.common.common.AConditional)1 AFunctionCall (org.osate.alisa.common.common.AFunctionCall)1 AModelReference (org.osate.alisa.common.common.AModelReference)1 ARange (org.osate.alisa.common.common.ARange)1 AUnaryOperation (org.osate.alisa.common.common.AUnaryOperation)1