Search in sources :

Example 1 with AModel

use of org.eclipse.xtext.grammarinheritance.ametamodel.AModel in project xtext-core by eclipse.

the class CallOverridenParserRuleImpl method basicSetCall.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetCall(AModel newCall, NotificationChain msgs) {
    AModel oldCall = call;
    call = newCall;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FooPackage.CALL_OVERRIDEN_PARSER_RULE__CALL, oldCall, newCall);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : AModel(org.eclipse.xtext.grammarinheritance.ametamodel.AModel) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 2 with AModel

use of org.eclipse.xtext.grammarinheritance.ametamodel.AModel in project xtext-core by eclipse.

the class AbstractAbstractTestLanguageSemanticSequencer 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 == AmetamodelPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case AmetamodelPackage.AMODEL:
                if (rule == grammarAccess.getAbstractCallExtendedParserRuleRule()) {
                    sequence_AbstractCallExtendedParserRule(context, (AModel) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAbstractCallOverridenParserRuleRule()) {
                    sequence_AbstractCallOverridenParserRule(context, (AModel) semanticObject);
                    return;
                } else
                    break;
            case AmetamodelPackage.ATYPE:
                if (rule == grammarAccess.getExtendableParserRuleRule()) {
                    sequence_ExtendableParserRule(context, (AType) semanticObject);
                    return;
                } else if (rule == grammarAccess.getInheritedParserRuleRule()) {
                    sequence_InheritedParserRule(context, (AType) semanticObject);
                    return;
                } else if (rule == grammarAccess.getOverridableParserRule2Rule()) {
                    sequence_OverridableParserRule2(context, (AType) semanticObject);
                    return;
                } else if (rule == grammarAccess.getOverridableParserRuleRule()) {
                    sequence_OverridableParserRule(context, (AType) semanticObject);
                    return;
                } else
                    break;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : AType(org.eclipse.xtext.grammarinheritance.ametamodel.AType) ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) AModel(org.eclipse.xtext.grammarinheritance.ametamodel.AModel) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage)

Example 3 with AModel

use of org.eclipse.xtext.grammarinheritance.ametamodel.AModel in project xtext-core by eclipse.

the class ConcreteTestLanguageSemanticSequencer 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 == AmetamodelPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case AmetamodelPackage.AMODEL:
                if (rule == grammarAccess.getAbstractCallExtendedParserRuleRule()) {
                    sequence_AbstractCallExtendedParserRule(context, (AModel) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAbstractCallOverridenParserRuleRule()) {
                    sequence_AbstractCallOverridenParserRule(context, (AModel) semanticObject);
                    return;
                } else
                    break;
            case AmetamodelPackage.ATYPE:
                if (rule == grammarAccess.getInheritedParserRuleRule()) {
                    sequence_InheritedParserRule(context, (AType) semanticObject);
                    return;
                } else if (rule == grammarAccess.getOverridableParserRuleRule()) {
                    sequence_OverridableParserRule(context, (AType) semanticObject);
                    return;
                } else
                    break;
        }
    else if (epackage == FooPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case FooPackage.ATYPE2:
                sequence_OverridableParserRule2(context, (AType2) semanticObject);
                return;
            case FooPackage.CALL_EXTENDED_PARSER_RULE:
                sequence_CallExtendedParserRule(context, (CallExtendedParserRule) semanticObject);
                return;
            case FooPackage.CALL_OVERRIDEN_PARSER_RULE:
                sequence_CallOverridenParserRule(context, (CallOverridenParserRule) semanticObject);
                return;
            case FooPackage.CONCRETE_PARSER_RULE:
                sequence_ConcreteParserRule(context, (ConcreteParserRule) semanticObject);
                return;
            case FooPackage.SUBRULE1:
                sequence_Subrule1(context, (Subrule1) semanticObject);
                return;
            case FooPackage.SUBRULE2:
                sequence_Subrule2(context, (Subrule2) semanticObject);
                return;
            case FooPackage.SUBRULE3:
                sequence_Subrule3(context, (Subrule3) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : AType(org.eclipse.xtext.grammarinheritance.ametamodel.AType) CallOverridenParserRule(org.eclipse.xtext.grammarinheritance.foo.CallOverridenParserRule) CallExtendedParserRule(org.eclipse.xtext.grammarinheritance.foo.CallExtendedParserRule) ParserRule(org.eclipse.xtext.ParserRule) ConcreteParserRule(org.eclipse.xtext.grammarinheritance.foo.ConcreteParserRule) Action(org.eclipse.xtext.Action) AModel(org.eclipse.xtext.grammarinheritance.ametamodel.AModel) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage)

Example 4 with AModel

use of org.eclipse.xtext.grammarinheritance.ametamodel.AModel in project xtext-core by eclipse.

the class CallExtendedParserRuleImpl method basicSetCall.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetCall(AModel newCall, NotificationChain msgs) {
    AModel oldCall = call;
    call = newCall;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FooPackage.CALL_EXTENDED_PARSER_RULE__CALL, oldCall, newCall);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : AModel(org.eclipse.xtext.grammarinheritance.ametamodel.AModel) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Aggregations

AModel (org.eclipse.xtext.grammarinheritance.ametamodel.AModel)4 EPackage (org.eclipse.emf.ecore.EPackage)2 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)2 Action (org.eclipse.xtext.Action)2 Parameter (org.eclipse.xtext.Parameter)2 ParserRule (org.eclipse.xtext.ParserRule)2 AType (org.eclipse.xtext.grammarinheritance.ametamodel.AType)2 CallExtendedParserRule (org.eclipse.xtext.grammarinheritance.foo.CallExtendedParserRule)1 CallOverridenParserRule (org.eclipse.xtext.grammarinheritance.foo.CallOverridenParserRule)1 ConcreteParserRule (org.eclipse.xtext.grammarinheritance.foo.ConcreteParserRule)1