Search in sources :

Example 1 with NestedModel

use of org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.NestedModel in project xtext-core by eclipse.

the class ExUnorderedGroupsTestLanguageSemanticSequencer 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 == UnorderedGroupsTestLanguagePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case UnorderedGroupsTestLanguagePackage.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
            case UnorderedGroupsTestLanguagePackage.NESTED_MODEL:
                sequence_NestedModel(context, (NestedModel) semanticObject);
                return;
            case UnorderedGroupsTestLanguagePackage.UNORDERED_SERIALIZATION:
                sequence_UnorderedSerialization(context, (UnorderedSerialization) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Model(org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.Model) NestedModel(org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.NestedModel) Parameter(org.eclipse.xtext.Parameter) UnorderedSerialization(org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.UnorderedSerialization) NestedModel(org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.NestedModel) EPackage(org.eclipse.emf.ecore.EPackage)

Example 2 with NestedModel

use of org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.NestedModel in project xtext-core by eclipse.

the class SimpleUnorderedGroupsTestLanguageSemanticSequencer 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 == UnorderedGroupsTestLanguagePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case UnorderedGroupsTestLanguagePackage.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
            case UnorderedGroupsTestLanguagePackage.NESTED_MODEL:
                sequence_NestedModel(context, (NestedModel) semanticObject);
                return;
            case UnorderedGroupsTestLanguagePackage.UNORDERED_SERIALIZATION:
                sequence_UnorderedSerialization(context, (UnorderedSerialization) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Model(org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.Model) NestedModel(org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.NestedModel) Parameter(org.eclipse.xtext.Parameter) UnorderedSerialization(org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.UnorderedSerialization) NestedModel(org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.NestedModel) EPackage(org.eclipse.emf.ecore.EPackage)

Example 3 with NestedModel

use of org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.NestedModel in project xtext-core by eclipse.

the class UnorderedGroupsTestLanguageSemanticSequencer 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 == UnorderedGroupsTestLanguagePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case UnorderedGroupsTestLanguagePackage.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
            case UnorderedGroupsTestLanguagePackage.NESTED_MODEL:
                sequence_NestedModel(context, (NestedModel) semanticObject);
                return;
            case UnorderedGroupsTestLanguagePackage.UNORDERED_SERIALIZATION:
                sequence_UnorderedSerialization(context, (UnorderedSerialization) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Model(org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.Model) NestedModel(org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.NestedModel) Parameter(org.eclipse.xtext.Parameter) UnorderedSerialization(org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.UnorderedSerialization) NestedModel(org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.NestedModel) EPackage(org.eclipse.emf.ecore.EPackage)

Example 4 with NestedModel

use of org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.NestedModel in project xtext-core by eclipse.

the class AbstractParserTest method internalTestNested.

public void internalTestNested(String input, int expected) throws Exception {
    Model model = (Model) getModel("bug302585 " + input);
    assertNotNull(model);
    List<NestedModel> nestedModels = model.getNestedModel();
    assertEquals(expected, nestedModels.size());
    for (NestedModel nested : nestedModels) {
        assertTrue(nested.isFirst());
        assertTrue(nested.isSecond());
    }
}
Also used : Model(org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.Model) NestedModel(org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.NestedModel) NestedModel(org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.NestedModel)

Aggregations

Model (org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.Model)4 NestedModel (org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.NestedModel)4 EPackage (org.eclipse.emf.ecore.EPackage)3 Action (org.eclipse.xtext.Action)3 Parameter (org.eclipse.xtext.Parameter)3 ParserRule (org.eclipse.xtext.ParserRule)3 UnorderedSerialization (org.eclipse.xtext.parser.unorderedGroups.unorderedGroupsTestLanguage.UnorderedSerialization)3