use of org.eclipse.xtext.validation.csvalidationtest.GroupMultiplicities in project xtext-core by eclipse.
the class ConcreteSyntaxValidationTestLanguageSemanticSequencer 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 == CsvalidationtestPackage.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case CsvalidationtestPackage.ALT_LIST1:
sequence_AltList1(context, (AltList1) semanticObject);
return;
case CsvalidationtestPackage.ALT_LIST2:
sequence_AltList2(context, (AltList2) semanticObject);
return;
case CsvalidationtestPackage.ALTERNATIVE_MULTIPLICITIES:
sequence_AlternativeMultiplicities(context, (AlternativeMultiplicities) semanticObject);
return;
case CsvalidationtestPackage.ASSIGNED_ACTION:
if (rule == grammarAccess.getAssignedActionSecondRule()) {
sequence_AssignedActionSecond(context, (AssignedAction) semanticObject);
return;
} else if (rule == grammarAccess.getAssignedActionRule()) {
sequence_AssignedAction(context, (AssignedAction) semanticObject);
return;
} else if (action == grammarAccess.getAssignedActionAccess().getAssignedActionChildAction_2_0()) {
sequence_AssignedAction_AssignedAction_2_0(context, (AssignedAction) semanticObject);
return;
} else
break;
case CsvalidationtestPackage.COMBINATION1:
sequence_Combination1(context, (Combination1) semanticObject);
return;
case CsvalidationtestPackage.COMBINATION2:
sequence_Combination2(context, (Combination2) semanticObject);
return;
case CsvalidationtestPackage.COMBINATION3:
sequence_Combination3(context, (Combination3) semanticObject);
return;
case CsvalidationtestPackage.COMBINATION4:
sequence_Combination4(context, (Combination4) semanticObject);
return;
case CsvalidationtestPackage.EMPTY_ALTERNATIVE_SUB:
sequence_StaticSimplification(context, (EmptyAlternativeSub) semanticObject);
return;
case CsvalidationtestPackage.GROUP_MULTIPLICITIES:
sequence_GroupMultiplicities(context, (GroupMultiplicities) semanticObject);
return;
case CsvalidationtestPackage.HEURISTIC1:
sequence_Heuristic1(context, (Heuristic1) semanticObject);
return;
case CsvalidationtestPackage.LIST1:
sequence_List1(context, (List1) semanticObject);
return;
case CsvalidationtestPackage.LIST2:
sequence_List2(context, (List2) semanticObject);
return;
case CsvalidationtestPackage.LIST3:
sequence_List3(context, (List3) semanticObject);
return;
case CsvalidationtestPackage.LIST4:
sequence_List4(context, (List4) semanticObject);
return;
case CsvalidationtestPackage.LIST5:
sequence_List5(context, (List5) semanticObject);
return;
case CsvalidationtestPackage.MODEL:
sequence_Model(context, (Model) semanticObject);
return;
case CsvalidationtestPackage.SIMPLE_ALTERNATIVE:
sequence_SimpleAlternative(context, (SimpleAlternative) semanticObject);
return;
case CsvalidationtestPackage.SIMPLE_GROUP:
sequence_SimpleGroup(context, (SimpleGroup) semanticObject);
return;
case CsvalidationtestPackage.SIMPLE_MULTIPLICITIES:
sequence_SimpleMultiplicities(context, (SimpleMultiplicities) semanticObject);
return;
case CsvalidationtestPackage.STATIC_SIMPLIFICATION:
sequence_StaticSimplification(context, (StaticSimplification) semanticObject);
return;
case CsvalidationtestPackage.TRANSIENT_OBJECT:
sequence_TransientObject(context, (TransientObject) semanticObject);
return;
case CsvalidationtestPackage.TRANSIENT_OBJECT_SUB:
sequence_TransientObjectSub(context, (TransientObjectSub) semanticObject);
return;
case CsvalidationtestPackage.TRANSIENT_SERIALIZEABLES1:
sequence_TransientSerializeables1(context, (TransientSerializeables1) semanticObject);
return;
case CsvalidationtestPackage.TWO_VERSION:
if (rule == grammarAccess.getTwoVersionNo1Rule()) {
sequence_TwoVersionNo1(context, (TwoVersion) semanticObject);
return;
} else if (rule == grammarAccess.getTwoVersionRule()) {
sequence_TwoVersionNo1_TwoVersionNo2(context, (TwoVersion) semanticObject);
return;
} else if (rule == grammarAccess.getTwoVersionNo2Rule()) {
sequence_TwoVersionNo2(context, (TwoVersion) semanticObject);
return;
} else
break;
case CsvalidationtestPackage.UNASSIGNED_ACTION1:
sequence_UnassignedAction1(context, (UnassignedAction1) semanticObject);
return;
case CsvalidationtestPackage.UNASSIGNED_ACTION2_SUB:
sequence_UnassignedAction2(context, (UnassignedAction2Sub) semanticObject);
return;
case CsvalidationtestPackage.UNASSIGNED_ACTION2_SUB1:
sequence_UnassignedAction3(context, (UnassignedAction2Sub1) semanticObject);
return;
case CsvalidationtestPackage.UNASSIGNED_ACTION2_SUB2:
sequence_UnassignedAction3(context, (UnassignedAction2Sub2) semanticObject);
return;
case CsvalidationtestPackage.UNASSIGNED_RULE_CALL1_SUB:
if (rule == grammarAccess.getUnassignedRuleCall1SubRule()) {
sequence_UnassignedRuleCall1Sub(context, (UnassignedRuleCall1Sub) semanticObject);
return;
} else if (rule == grammarAccess.getUnassignedRuleCall1Rule()) {
sequence_UnassignedRuleCall1_UnassignedRuleCall1Sub(context, (UnassignedRuleCall1Sub) semanticObject);
return;
} else
break;
case CsvalidationtestPackage.UNASSIGNED_RULE_CALL2_SUB_ACTION:
if (rule == grammarAccess.getUnassignedRuleCall2SubRule()) {
sequence_UnassignedRuleCall2Sub(context, (UnassignedRuleCall2SubAction) semanticObject);
return;
} else if (rule == grammarAccess.getUnassignedRuleCall2Rule()) {
sequence_UnassignedRuleCall2_UnassignedRuleCall2Sub(context, (UnassignedRuleCall2SubAction) semanticObject);
return;
} else
break;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of org.eclipse.xtext.validation.csvalidationtest.GroupMultiplicities in project xtext-core by eclipse.
the class ModelImpl method basicSetX4.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetX4(GroupMultiplicities newX4, NotificationChain msgs) {
GroupMultiplicities oldX4 = x4;
x4 = newX4;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CsvalidationtestPackage.MODEL__X4, oldX4, newX4);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.eclipse.xtext.validation.csvalidationtest.GroupMultiplicities in project xtext-core by eclipse.
the class ConcreteSyntaxValidationTest method testGroupMultiplicities1.
@Test
public void testGroupMultiplicities1() throws Exception {
GroupMultiplicities m = (GroupMultiplicities) getModel2("#4 abc kw1 def def kw2 fgh ijk kw3 lmn opq");
validate(m).assertOK();
GroupMultiplicities copy = EcoreUtil.copy(m);
copy.setVal2(null);
copy.setVal3(null);
copy.getVal6().clear();
copy.getVal7().clear();
validate(copy).assertOK();
copy = EcoreUtil.copy(m);
copy.setVal2(null);
validate(copy).assertAll(err(p.getGroupMultiplicities_Val2(), ERROR_VALUE_REQUIRED, 1, null, "(val2 val3)?"), err(p.getGroupMultiplicities_Val3(), ERROR_VALUE_PROHIBITED, null, 0, "(val2 val3)?"));
copy = EcoreUtil.copy(m);
copy.getVal5().clear();
validate(copy).assertAll(err(p.getGroupMultiplicities_Val5(), ERROR_LIST_TOO_FEW, 1, null, "(val4 val5)+"));
copy = EcoreUtil.copy(m);
copy.getVal4().clear();
copy.getVal5().clear();
validate(copy).assertAll(err(p.getGroupMultiplicities_Val4(), ERROR_LIST_TOO_FEW, 1, null, "(val4 val5)+"), err(p.getGroupMultiplicities_Val5(), ERROR_LIST_TOO_FEW, 1, null, "(val4 val5)+"));
copy = EcoreUtil.copy(m);
copy.getVal5().add("sdlasjdk");
validate(copy).assertAll(err(p.getGroupMultiplicities_Val4(), ERROR_LIST_TOO_FEW, 2, null, "(val4 val5)+"), err(p.getGroupMultiplicities_Val5(), ERROR_LIST_TOO_MANY, null, 1, "(val4 val5)+"));
copy = EcoreUtil.copy(m);
copy.getVal6().clear();
validate(copy).assertAll(err(p.getGroupMultiplicities_Val6(), ERROR_LIST_TOO_FEW, 1, 1, "(val6 val7)*"), err(p.getGroupMultiplicities_Val7(), ERROR_LIST_TOO_MANY, 0, 0, "(val6 val7)*"));
copy = EcoreUtil.copy(m);
copy.getVal7().add("test");
validate(copy).assertAll(err(p.getGroupMultiplicities_Val6(), ERROR_LIST_TOO_FEW, 2, null, "(val6 val7)*"), err(p.getGroupMultiplicities_Val7(), ERROR_LIST_TOO_MANY, 1, 1, "(val6 val7)*"));
}
Aggregations