Search in sources :

Example 11 with PRFNamed

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

the class AbstractFragmentsTest method testDatatypeRule_01.

@Test
public void testDatatypeRule_01() {
    final ParserRuleFragments fragments = this.parseAndValidate("#8 a - a");
    Assert.assertNotNull(fragments);
    PRFNamed element = fragments.getElement();
    Assert.assertEquals(element, element.getRef());
}
Also used : ParserRuleFragments(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.ParserRuleFragments) PRFNamed(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed) Test(org.junit.Test)

Example 12 with PRFNamed

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

the class AbstractFragmentsTest method testDatatypeRule_02.

@Test
public void testDatatypeRule_02() {
    final ParserRuleFragments fragments = this.parseAndValidate("#8 a.b.c.d");
    Assert.assertNotNull(fragments);
    PRFNamed element = fragments.getElement();
    Assert.assertEquals("a.b.c.d", element.getName());
}
Also used : ParserRuleFragments(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.ParserRuleFragments) PRFNamed(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed) Test(org.junit.Test)

Example 13 with PRFNamed

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

the class PRFNamedWithActionImpl method basicSetPrev.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetPrev(PRFNamed newPrev, NotificationChain msgs) {
    PRFNamed oldPrev = prev;
    prev = newPrev;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FragmentTestLanguagePackage.PRF_NAMED_WITH_ACTION__PREV, oldPrev, newPrev);
        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 14 with PRFNamed

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

the class PRFNamedWithActionImpl method setRef2.

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

Example 15 with PRFNamed

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

the class AbstractFragmentsTest method testActionInFragmentAndReference_01.

@Test
@Ignore("Actions are currently not supported in fragments")
public void testActionInFragmentAndReference_01() {
    final ParserRuleFragments fragments = this.parseAndValidate("#5 prev current current - prev");
    Assert.assertNotNull(fragments);
    final PRFNamed element = fragments.getElement();
    Assert.assertEquals("current", element.getName());
    final PRFNamed prev = ((PRFNamedWithAction) element).getPrev();
    Assert.assertEquals("prev", prev.getName());
    Assert.assertEquals(prev, element.getRef());
    Assert.assertEquals(element, ((PRFNamedWithAction) element).getRef2());
}
Also used : ParserRuleFragments(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.ParserRuleFragments) PRFNamedWithAction(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamedWithAction) PRFNamed(org.eclipse.xtext.parser.fragments.fragmentTestLanguage.PRFNamed) Ignore(org.junit.Ignore) Test(org.junit.Test)

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