use of org.eclipse.xtext.enumrules.enumAndReferenceTestLanguage.EntityWithEnumAndReference in project xtext-core by eclipse.
the class EnumAndReferenceTestLanguageSemanticSequencer 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 == EnumAndReferenceTestLanguagePackage.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case EnumAndReferenceTestLanguagePackage.ENTITY_WITH_ENUM_AND_REFERENCE:
sequence_EntityWithEnumAndReference(context, (EntityWithEnumAndReference) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of org.eclipse.xtext.enumrules.enumAndReferenceTestLanguage.EntityWithEnumAndReference in project xtext-core by eclipse.
the class EntityWithEnumAndReferenceImpl method setRef.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRef(EntityWithEnumAndReference newRef) {
EntityWithEnumAndReference oldRef = ref;
ref = newRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EnumAndReferenceTestLanguagePackage.ENTITY_WITH_ENUM_AND_REFERENCE__REF, oldRef, ref));
}
use of org.eclipse.xtext.enumrules.enumAndReferenceTestLanguage.EntityWithEnumAndReference in project xtext-core by eclipse.
the class EnumAndReferenceTest method testNodes.
@Test
public void testNodes() throws Exception {
String modelAsString = "kindOfKeyword Hoo reference Hoo";
EntityWithEnumAndReference model = (EntityWithEnumAndReference) helper.getModel(modelAsString);
ICompositeNode node = NodeModelUtils.getNode(model);
assertNotNull(node);
// 3 hidden WS + 4 visible LeafNodes
assertTrue(Iterables.size(node.getChildren()) == 7);
}
use of org.eclipse.xtext.enumrules.enumAndReferenceTestLanguage.EntityWithEnumAndReference in project xtext-core by eclipse.
the class EnumAndReferenceTest method testSemantic.
@Test
public void testSemantic() throws Exception {
String modelAsString = "kindOfKeyword Hoo reference Hoo";
EntityWithEnumAndReference model = (EntityWithEnumAndReference) helper.getModel(modelAsString);
assertNotNull(model);
assertEquals("Hoo", model.getName());
assertNotNull(model.getRef());
assertEquals(model, model.getRef());
}
Aggregations