Search in sources :

Example 1 with PRFNamed

use of org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed in project xtext-core by eclipse.

the class PRFNamedImpl method setRef.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setRef(PRFNamed newRef) {
    PRFNamed oldRef = ref;
    ref = newRef;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, FragmentTestLanguagePackage.PRF_NAMED__REF, oldRef, ref));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) PRFNamed(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed)

Example 2 with PRFNamed

use of org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed in project xtext-core by eclipse.

the class ParserRuleFragmentsImpl method basicSetElement.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetElement(PRFNamed newElement, NotificationChain msgs) {
    PRFNamed oldElement = element;
    element = newElement;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FragmentTestLanguagePackage.PARSER_RULE_FRAGMENTS__ELEMENT, oldElement, newElement);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) PRFNamed(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed)

Example 3 with PRFNamed

use of org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed in project xtext-core by eclipse.

the class ParserRuleFragmentsImpl method setRef.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setRef(PRFNamed newRef) {
    PRFNamed oldRef = ref;
    ref = newRef;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, FragmentTestLanguagePackage.PARSER_RULE_FRAGMENTS__REF, oldRef, ref));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) PRFNamed(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed)

Example 4 with PRFNamed

use of org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed in project xtext-core by eclipse.

the class AbstractFragmentTestLanguageExSemanticSequencer 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 == FragmentTestLanguagePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case FragmentTestLanguagePackage.PRF_NAMED:
                if (rule == grammarAccess.getNamedByActionRule()) {
                    sequence_NamedByAction(context, (PRFNamed) semanticObject);
                    return;
                } else if (rule == grammarAccess.getNamedInParenthesesRule()) {
                    sequence_NamedInParentheses(context, (PRFNamed) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPRFNamedRefFirstRule()) {
                    sequence_PRFNamedFragment_PRFNamedRefFirst(context, (PRFNamed) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPRFWithPredicateRule()) {
                    sequence_PRFNamedFragment_PRFNamedRef(context, (PRFNamed) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPRFNamedWithFQNRule()) {
                    sequence_PRFNamedWithFQN(context, (PRFNamed) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPRFNamedRule() || action == grammarAccess.getPRFNamedWithActionAccess().getPRFNamedWithActionPrevAction_1()) {
                    sequence_PRFNamed_PRFNamedFragment_PRFNamedRef(context, (PRFNamed) semanticObject);
                    return;
                } else
                    break;
            case FragmentTestLanguagePackage.PRF_NAMED_WITH_ACTION:
                if (rule == grammarAccess.getPRFNamedRecursiveFragmentRule()) {
                    sequence_PRFNamedRecursiveFragment_RecursiveFragment(context, (PRFNamedWithAction) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPRFNamedRecursiveRule()) {
                    sequence_PRFNamedRecursive_RecursiveFromFragment(context, (PRFNamedWithAction) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPRFNamedWithActionRule()) {
                    sequence_PRFNamedWithAction(context, (PRFNamedWithAction) semanticObject);
                    return;
                } else
                    break;
            case FragmentTestLanguagePackage.PARSER_RULE_FRAGMENTS:
                sequence_ParserRuleFragments(context, (ParserRuleFragments) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) PRFNamedWithAction(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamedWithAction) Action(org.eclipse.xtext.Action) PRFNamedWithAction(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamedWithAction) ParserRuleFragments(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.ParserRuleFragments) Parameter(org.eclipse.xtext.Parameter) PRFNamed(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed) EPackage(org.eclipse.emf.ecore.EPackage)

Example 5 with PRFNamed

use of org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed in project xtext-core by eclipse.

the class AbstractFragmentTestLanguageSemanticSequencer 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 == FragmentTestLanguagePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case FragmentTestLanguagePackage.PRF_NAMED:
                if (rule == grammarAccess.getNamedByActionRule()) {
                    sequence_NamedByAction(context, (PRFNamed) semanticObject);
                    return;
                } else if (rule == grammarAccess.getNamedInParenthesesRule()) {
                    sequence_NamedInParentheses(context, (PRFNamed) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPRFNamedRefFirstRule()) {
                    sequence_PRFNamedFragment_PRFNamedRefFirst(context, (PRFNamed) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPRFWithPredicateRule()) {
                    sequence_PRFNamedFragment_PRFNamedRef(context, (PRFNamed) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPRFNamedWithFQNRule()) {
                    sequence_PRFNamedWithFQN(context, (PRFNamed) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPRFNamedRule() || action == grammarAccess.getPRFNamedWithActionAccess().getPRFNamedWithActionPrevAction_1()) {
                    sequence_PRFNamed_PRFNamedFragment_PRFNamedRef(context, (PRFNamed) semanticObject);
                    return;
                } else
                    break;
            case FragmentTestLanguagePackage.PRF_NAMED_WITH_ACTION:
                if (rule == grammarAccess.getPRFNamedRecursiveFragmentRule()) {
                    sequence_PRFNamedRecursiveFragment_RecursiveFragment(context, (PRFNamedWithAction) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPRFNamedRecursiveRule()) {
                    sequence_PRFNamedRecursive_RecursiveFromFragment(context, (PRFNamedWithAction) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPRFNamedWithActionRule()) {
                    sequence_PRFNamedWithAction(context, (PRFNamedWithAction) semanticObject);
                    return;
                } else
                    break;
            case FragmentTestLanguagePackage.PARSER_RULE_FRAGMENTS:
                sequence_ParserRuleFragments(context, (ParserRuleFragments) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) PRFNamedWithAction(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamedWithAction) Action(org.eclipse.xtext.Action) PRFNamedWithAction(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamedWithAction) ParserRuleFragments(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.ParserRuleFragments) Parameter(org.eclipse.xtext.Parameter) PRFNamed(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed) EPackage(org.eclipse.emf.ecore.EPackage)

Aggregations

PRFNamed (org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed)21 ParserRuleFragments (org.eclipse.xtext.parser.fragments.fragmentTestLanguage.ParserRuleFragments)16 Test (org.junit.Test)14 PRFNamedWithAction (org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamedWithAction)13 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)5 Ignore (org.junit.Ignore)5 EObject (org.eclipse.emf.ecore.EObject)4 ICompositeNode (org.eclipse.xtext.nodemodel.ICompositeNode)4 EPackage (org.eclipse.emf.ecore.EPackage)2 Action (org.eclipse.xtext.Action)2 Parameter (org.eclipse.xtext.Parameter)2 ParserRule (org.eclipse.xtext.ParserRule)2