Search in sources :

Example 51 with Parameter

use of org.eclipse.xtext.Parameter 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 52 with Parameter

use of org.eclipse.xtext.Parameter 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 53 with Parameter

use of org.eclipse.xtext.Parameter 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)

Example 54 with Parameter

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

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

Example 55 with Parameter

use of org.eclipse.xtext.Parameter 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));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) GroupMultiplicities(org.eclipse.xtext.validation.csvalidationtest.GroupMultiplicities) Action(org.eclipse.xtext.Action) UnassignedRuleCall2SubAction(org.eclipse.xtext.validation.csvalidationtest.UnassignedRuleCall2SubAction) AssignedAction(org.eclipse.xtext.validation.csvalidationtest.AssignedAction) TransientSerializeables1(org.eclipse.xtext.validation.csvalidationtest.TransientSerializeables1) Heuristic1(org.eclipse.xtext.validation.csvalidationtest.Heuristic1) SimpleGroup(org.eclipse.xtext.validation.csvalidationtest.SimpleGroup) AlternativeMultiplicities(org.eclipse.xtext.validation.csvalidationtest.AlternativeMultiplicities) TransientObjectSub(org.eclipse.xtext.validation.csvalidationtest.TransientObjectSub) EPackage(org.eclipse.emf.ecore.EPackage) AssignedAction(org.eclipse.xtext.validation.csvalidationtest.AssignedAction) List1(org.eclipse.xtext.validation.csvalidationtest.List1) AltList1(org.eclipse.xtext.validation.csvalidationtest.AltList1) AltList2(org.eclipse.xtext.validation.csvalidationtest.AltList2) List2(org.eclipse.xtext.validation.csvalidationtest.List2) AltList2(org.eclipse.xtext.validation.csvalidationtest.AltList2) AltList1(org.eclipse.xtext.validation.csvalidationtest.AltList1) List3(org.eclipse.xtext.validation.csvalidationtest.List3) List4(org.eclipse.xtext.validation.csvalidationtest.List4) List5(org.eclipse.xtext.validation.csvalidationtest.List5) TransientObject(org.eclipse.xtext.validation.csvalidationtest.TransientObject) SimpleAlternative(org.eclipse.xtext.validation.csvalidationtest.SimpleAlternative) Combination1(org.eclipse.xtext.validation.csvalidationtest.Combination1) Combination2(org.eclipse.xtext.validation.csvalidationtest.Combination2) UnassignedRuleCall2SubAction(org.eclipse.xtext.validation.csvalidationtest.UnassignedRuleCall2SubAction) Combination3(org.eclipse.xtext.validation.csvalidationtest.Combination3) UnassignedAction1(org.eclipse.xtext.validation.csvalidationtest.UnassignedAction1) Combination4(org.eclipse.xtext.validation.csvalidationtest.Combination4) UnassignedAction2Sub(org.eclipse.xtext.validation.csvalidationtest.UnassignedAction2Sub) UnassignedRuleCall1Sub(org.eclipse.xtext.validation.csvalidationtest.UnassignedRuleCall1Sub) EmptyAlternativeSub(org.eclipse.xtext.validation.csvalidationtest.EmptyAlternativeSub) TwoVersion(org.eclipse.xtext.validation.csvalidationtest.TwoVersion) SimpleMultiplicities(org.eclipse.xtext.validation.csvalidationtest.SimpleMultiplicities) Model(org.eclipse.xtext.validation.csvalidationtest.Model) UnassignedAction2Sub2(org.eclipse.xtext.validation.csvalidationtest.UnassignedAction2Sub2) Parameter(org.eclipse.xtext.Parameter) UnassignedAction2Sub1(org.eclipse.xtext.validation.csvalidationtest.UnassignedAction2Sub1) StaticSimplification(org.eclipse.xtext.validation.csvalidationtest.StaticSimplification)

Aggregations

Parameter (org.eclipse.xtext.Parameter)146 ParserRule (org.eclipse.xtext.ParserRule)137 Action (org.eclipse.xtext.Action)127 EPackage (org.eclipse.emf.ecore.EPackage)123 NamedArgument (org.eclipse.xtext.NamedArgument)7 EClass (org.eclipse.emf.ecore.EClass)6 ISerializationContext (org.eclipse.xtext.serializer.ISerializationContext)6 AbstractElement (org.eclipse.xtext.AbstractElement)5 AbstractRule (org.eclipse.xtext.AbstractRule)5 RuleCall (org.eclipse.xtext.RuleCall)5 EObject (org.eclipse.emf.ecore.EObject)4 ParserRuleParameters (org.eclipse.xtext.parser.parameters.parametersTestLanguage.ParserRuleParameters)4 Scenario (org.eclipse.xtext.parser.parameters.parametersTestLanguage.Scenario)4 ImmutableSet (com.google.common.collect.ImmutableSet)3 Group (org.eclipse.xtext.Group)3 ConditionEvaluator (org.eclipse.xtext.xtext.ConditionEvaluator)3 Set (java.util.Set)2 Assignment (org.eclipse.xtext.Assignment)2 EnumRule (org.eclipse.xtext.EnumRule)2 Grammar (org.eclipse.xtext.Grammar)2