use of org.eclipse.xtext.xtext.ecoreInference.unassignedRuleCallTestLanguage.ModelFeatures in project xtext-core by eclipse.
the class UnassignedRuleCallTestLanguageSemanticSequencer 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 == UnassignedRuleCallTestLanguagePackage.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case UnassignedRuleCallTestLanguagePackage.MODEL:
sequence_Model(context, (Model) semanticObject);
return;
case UnassignedRuleCallTestLanguagePackage.MODEL_FEATURES:
sequence_ModelFeatures(context, (ModelFeatures) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of org.eclipse.xtext.xtext.ecoreInference.unassignedRuleCallTestLanguage.ModelFeatures in project xtext-core by eclipse.
the class UnassignedRuleCallTest method testNodeModel_02.
@Test
public void testNodeModel_02() throws Exception {
String modelAsText = "model 7 13 137 feature Foo 1 keyword 1 'bar';";
Model model = (Model) getModel(modelAsText);
ICompositeNode node = NodeModelUtils.getNode(model);
assertEquals(8, Iterables.size(node.getChildren()));
ModelFeatures modelFeatures = model.getModelFeatures();
ICompositeNode featuresNode = NodeModelUtils.getNode(modelFeatures);
assertSame(featuresNode, Iterables.get(node.getChildren(), 7));
assertEquals(6, Iterables.size(featuresNode.getChildren()));
ICompositeNode dataTypeNode = (ICompositeNode) Iterables.get(featuresNode.getChildren(), 4);
assertEquals(8, Iterables.size(dataTypeNode.getChildren()));
}
use of org.eclipse.xtext.xtext.ecoreInference.unassignedRuleCallTestLanguage.ModelFeatures in project xtext-core by eclipse.
the class ModelImpl method basicSetModelFeatures.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetModelFeatures(ModelFeatures newModelFeatures, NotificationChain msgs) {
ModelFeatures oldModelFeatures = modelFeatures;
modelFeatures = newModelFeatures;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, UnassignedRuleCallTestLanguagePackage.MODEL__MODEL_FEATURES, oldModelFeatures, newModelFeatures);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.eclipse.xtext.xtext.ecoreInference.unassignedRuleCallTestLanguage.ModelFeatures in project xtext-core by eclipse.
the class UnassignedRuleCallTest method testNodeModel_01.
@Test
public void testNodeModel_01() throws Exception {
String modelAsText = "model 7 feature Zonk 1 keyword 1;";
Model model = (Model) getModel(modelAsText);
ICompositeNode node = NodeModelUtils.getNode(model);
assertEquals(4, Iterables.size(node.getChildren()));
ModelFeatures modelFeatures = model.getModelFeatures();
ICompositeNode featuresNode = NodeModelUtils.getNode(modelFeatures);
assertSame(featuresNode, Iterables.get(node.getChildren(), 3));
assertEquals(6, Iterables.size(featuresNode.getChildren()));
ICompositeNode dataTypeNode = (ICompositeNode) Iterables.get(featuresNode.getChildren(), 4);
assertEquals(6, Iterables.size(dataTypeNode.getChildren()));
}
Aggregations