Search in sources :

Example 1 with ORing

use of org.eclipse.xtext.testlanguages.actionLang2.ORing in project xtext-core by eclipse.

the class ActionLanguage2Test method testCorrectReferenceType.

/**
 * see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=390326
 */
@Test
public void testCorrectReferenceType() {
    ORing oRing = ActionLang2Factory.eINSTANCE.createORing();
    ORing oRing2 = ActionLang2Factory.eINSTANCE.createORing();
    oRing.getDisjuncts().add(oRing2);
    assertSame(oRing2, oRing.getDisjuncts().get(0));
}
Also used : ORing(org.eclipse.xtext.testlanguages.actionLang2.ORing) Test(org.junit.Test)

Example 2 with ORing

use of org.eclipse.xtext.testlanguages.actionLang2.ORing in project xtext-core by eclipse.

the class ActionTestLanguage2SemanticSequencer 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 == ActionLang2Package.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case ActionLang2Package.ORING:
                sequence_ORing(context, (ORing) semanticObject);
                return;
            case ActionLang2Package.VALUE:
                sequence_Value(context, (Value) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Value(org.eclipse.xtext.testlanguages.actionLang2.Value) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage) ORing(org.eclipse.xtext.testlanguages.actionLang2.ORing)

Aggregations

ORing (org.eclipse.xtext.testlanguages.actionLang2.ORing)2 EPackage (org.eclipse.emf.ecore.EPackage)1 Action (org.eclipse.xtext.Action)1 Parameter (org.eclipse.xtext.Parameter)1 ParserRule (org.eclipse.xtext.ParserRule)1 Value (org.eclipse.xtext.testlanguages.actionLang2.Value)1 Test (org.junit.Test)1