Search in sources :

Example 91 with ParserRule

use of org.eclipse.xtext.ParserRule in project xtext-core by eclipse.

the class FowlerDslTestLanguageSemanticSequencer 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 == FowlerdslPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case FowlerdslPackage.COMMAND:
                sequence_Command(context, (Command) semanticObject);
                return;
            case FowlerdslPackage.EVENT:
                sequence_Event(context, (Event) semanticObject);
                return;
            case FowlerdslPackage.STATE:
                sequence_State(context, (State) semanticObject);
                return;
            case FowlerdslPackage.STATEMACHINE:
                sequence_Statemachine(context, (Statemachine) semanticObject);
                return;
            case FowlerdslPackage.TRANSITION:
                sequence_Transition(context, (Transition) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Statemachine(org.eclipse.xtext.testlanguages.fowlerdsl.Statemachine) Action(org.eclipse.xtext.Action) Command(org.eclipse.xtext.testlanguages.fowlerdsl.Command) State(org.eclipse.xtext.testlanguages.fowlerdsl.State) Transition(org.eclipse.xtext.testlanguages.fowlerdsl.Transition) Parameter(org.eclipse.xtext.Parameter) Event(org.eclipse.xtext.testlanguages.fowlerdsl.Event) EPackage(org.eclipse.emf.ecore.EPackage)

Example 92 with ParserRule

use of org.eclipse.xtext.ParserRule in project xtext-core by eclipse.

the class OptionalEmptyTestLanguageSemanticSequencer 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 == OptionalEmptyPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case OptionalEmptyPackage.GREETING:
                sequence_Greeting(context, (Greeting) semanticObject);
                return;
            case OptionalEmptyPackage.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Greeting(org.eclipse.xtext.testlanguages.optionalEmpty.Greeting) Action(org.eclipse.xtext.Action) Model(org.eclipse.xtext.testlanguages.optionalEmpty.Model) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage)

Example 93 with ParserRule

use of org.eclipse.xtext.ParserRule in project xtext-core by eclipse.

the class PartialParserTestLanguageSemanticSequencer 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 == PartialParserTestLanguagePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case PartialParserTestLanguagePackage.ABSTRACT_CHILDREN:
                sequence_AbstractChildren(context, (AbstractChildren) semanticObject);
                return;
            case PartialParserTestLanguagePackage.CHILD:
                sequence_Child(context, (Child) semanticObject);
                return;
            case PartialParserTestLanguagePackage.CHILDREN:
                sequence_Children(context, (Children) semanticObject);
                return;
            case PartialParserTestLanguagePackage.FIRST_CONCRETE:
                sequence_FirstConcrete(context, (FirstConcrete) semanticObject);
                return;
            case PartialParserTestLanguagePackage.NAMED:
                sequence_Named(context, (Named) semanticObject);
                return;
            case PartialParserTestLanguagePackage.NESTED:
                sequence_Nested(context, (Nested) semanticObject);
                return;
            case PartialParserTestLanguagePackage.SECOND_CONCRETE:
                sequence_SecondConcrete(context, (SecondConcrete) semanticObject);
                return;
            case PartialParserTestLanguagePackage.SOME_CONTAINER:
                sequence_SomeContainer(context, (SomeContainer) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Named(org.eclipse.xtext.testlanguages.partialParserTestLanguage.Named) Action(org.eclipse.xtext.Action) SomeContainer(org.eclipse.xtext.testlanguages.partialParserTestLanguage.SomeContainer) Nested(org.eclipse.xtext.testlanguages.partialParserTestLanguage.Nested) EPackage(org.eclipse.emf.ecore.EPackage) AbstractChildren(org.eclipse.xtext.testlanguages.partialParserTestLanguage.AbstractChildren) Parameter(org.eclipse.xtext.Parameter) SecondConcrete(org.eclipse.xtext.testlanguages.partialParserTestLanguage.SecondConcrete) Children(org.eclipse.xtext.testlanguages.partialParserTestLanguage.Children) AbstractChildren(org.eclipse.xtext.testlanguages.partialParserTestLanguage.AbstractChildren) Child(org.eclipse.xtext.testlanguages.partialParserTestLanguage.Child) FirstConcrete(org.eclipse.xtext.testlanguages.partialParserTestLanguage.FirstConcrete)

Example 94 with ParserRule

use of org.eclipse.xtext.ParserRule in project xtext-core by eclipse.

the class ReferenceGrammarTestLanguageSemanticSequencer 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 == ReferenceGrammarPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case ReferenceGrammarPackage.ERWACHSENER:
                sequence_Erwachsener(context, (Erwachsener) semanticObject);
                return;
            case ReferenceGrammarPackage.FAMILIE:
                sequence_Familie(context, (Familie) semanticObject);
                return;
            case ReferenceGrammarPackage.FARBE:
                sequence_Farbe(context, (Farbe) semanticObject);
                return;
            case ReferenceGrammarPackage.KIND:
                sequence_Kind(context, (Kind) semanticObject);
                return;
            case ReferenceGrammarPackage.SPIELPLATZ:
                sequence_Spielplatz(context, (Spielplatz) semanticObject);
                return;
            case ReferenceGrammarPackage.SPIELZEUG:
                sequence_Spielzeug(context, (Spielzeug) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Spielplatz(org.eclipse.xtext.testlanguages.referenceGrammar.Spielplatz) Action(org.eclipse.xtext.Action) Erwachsener(org.eclipse.xtext.testlanguages.referenceGrammar.Erwachsener) Farbe(org.eclipse.xtext.testlanguages.referenceGrammar.Farbe) Spielzeug(org.eclipse.xtext.testlanguages.referenceGrammar.Spielzeug) Kind(org.eclipse.xtext.testlanguages.referenceGrammar.Kind) Parameter(org.eclipse.xtext.Parameter) Familie(org.eclipse.xtext.testlanguages.referenceGrammar.Familie) EPackage(org.eclipse.emf.ecore.EPackage)

Example 95 with ParserRule

use of org.eclipse.xtext.ParserRule in project xtext-core by eclipse.

the class TestLanguageSemanticSequencer 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 == TestLangPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case TestLangPackage.CHOICE_ELEMENT:
                sequence_ChoiceRule(context, (ChoiceElement) semanticObject);
                return;
            case TestLangPackage.MODEL:
                sequence_EntryRule(context, (Model) semanticObject);
                return;
            case TestLangPackage.REDUCIBLE_COMPOSITE:
                sequence_ReducibleRule(context, (ReducibleComposite) semanticObject);
                return;
            case TestLangPackage.TERMINAL_ELEMENT:
                sequence_TerminalRule(context, (TerminalElement) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : TerminalElement(org.eclipse.xtext.testlanguages.testLang.TerminalElement) ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) ChoiceElement(org.eclipse.xtext.testlanguages.testLang.ChoiceElement) Model(org.eclipse.xtext.testlanguages.testLang.Model) Parameter(org.eclipse.xtext.Parameter) ReducibleComposite(org.eclipse.xtext.testlanguages.testLang.ReducibleComposite) EPackage(org.eclipse.emf.ecore.EPackage)

Aggregations

ParserRule (org.eclipse.xtext.ParserRule)380 Test (org.junit.Test)172 Grammar (org.eclipse.xtext.Grammar)151 Action (org.eclipse.xtext.Action)144 Parameter (org.eclipse.xtext.Parameter)137 EPackage (org.eclipse.emf.ecore.EPackage)126 AbstractRule (org.eclipse.xtext.AbstractRule)94 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)74 AbstractXtextRuleInspectorTest (org.eclipse.xtext.xtext.AbstractXtextRuleInspectorTest)49 RuleCall (org.eclipse.xtext.RuleCall)41 EObject (org.eclipse.emf.ecore.EObject)27 EnumRule (org.eclipse.xtext.EnumRule)21 TerminalRule (org.eclipse.xtext.TerminalRule)21 AbstractElement (org.eclipse.xtext.AbstractElement)18 Assignment (org.eclipse.xtext.Assignment)15 UnorderedGroup (org.eclipse.xtext.UnorderedGroup)12 EClass (org.eclipse.emf.ecore.EClass)11 Group (org.eclipse.xtext.Group)11 NamedArgument (org.eclipse.xtext.NamedArgument)11 TypeRef (org.eclipse.xtext.TypeRef)11