Search in sources :

Example 66 with Parameter

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

the class Bug302128TestLanguageSemanticSequencer 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 == Bug302128Package.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug302128Package.ELEMENT:
                sequence_Element(context, (Element) semanticObject);
                return;
            case Bug302128Package.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Element(org.eclipse.xtext.parsetree.reconstr.bug302128.Element) Model(org.eclipse.xtext.parsetree.reconstr.bug302128.Model) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage)

Example 67 with Parameter

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

the class ComplexReconstrTestLanguageSemanticSequencer 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 == ComplexrewritetestPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case ComplexrewritetestPackage.ADD:
                sequence_Op_Parens(context, (Add) semanticObject);
                return;
            case ComplexrewritetestPackage.ATOM:
                if (rule == grammarAccess.getAtomRule()) {
                    sequence_Atom(context, (Atom) semanticObject);
                    return;
                } else if (rule == grammarAccess.getRootRule() || rule == grammarAccess.getOpRule() || action == grammarAccess.getOpAccess().getAddAddOperandsAction_1_0_0() || action == grammarAccess.getOpAccess().getMinusMinusOperandsAction_1_1_0() || rule == grammarAccess.getTermRule() || rule == grammarAccess.getParensRule()) {
                    sequence_Atom_Parens(context, (Atom) semanticObject);
                    return;
                } else
                    break;
            case ComplexrewritetestPackage.C1:
                sequence_TrickyC(context, (C1) semanticObject);
                return;
            case ComplexrewritetestPackage.C2:
                sequence_TrickyC(context, (C2) semanticObject);
                return;
            case ComplexrewritetestPackage.C3:
                sequence_TrickyC(context, (C3) semanticObject);
                return;
            case ComplexrewritetestPackage.MINUS:
                sequence_Op_Parens(context, (Minus) semanticObject);
                return;
            case ComplexrewritetestPackage.TRICKY_B:
                sequence_TrickyB(context, (TrickyB) semanticObject);
                return;
            case ComplexrewritetestPackage.TRICKY_C:
                sequence_TrickyC(context, (TrickyC) semanticObject);
                return;
            case ComplexrewritetestPackage.TRICKY_D:
                sequence_TrickyD(context, (TrickyD) semanticObject);
                return;
            case ComplexrewritetestPackage.TRICKY_E:
                sequence_TrickyE(context, (TrickyE) semanticObject);
                return;
            case ComplexrewritetestPackage.TRICKY_F:
                sequence_TrickyF(context, (TrickyF) semanticObject);
                return;
            case ComplexrewritetestPackage.TRICKY_G:
                sequence_TrickyG(context, (TrickyG) semanticObject);
                return;
            case ComplexrewritetestPackage.TRICKY_G1:
                sequence_TrickyG1(context, (TrickyG1) semanticObject);
                return;
            case ComplexrewritetestPackage.TRICKY_G2:
                sequence_TrickyG2(context, (TrickyG2) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : Add(org.eclipse.xtext.parsetree.reconstr.complexrewritetest.Add) ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) TrickyF(org.eclipse.xtext.parsetree.reconstr.complexrewritetest.TrickyF) TrickyG2(org.eclipse.xtext.parsetree.reconstr.complexrewritetest.TrickyG2) TrickyG(org.eclipse.xtext.parsetree.reconstr.complexrewritetest.TrickyG) TrickyG1(org.eclipse.xtext.parsetree.reconstr.complexrewritetest.TrickyG1) Atom(org.eclipse.xtext.parsetree.reconstr.complexrewritetest.Atom) C1(org.eclipse.xtext.parsetree.reconstr.complexrewritetest.C1) EPackage(org.eclipse.emf.ecore.EPackage) C2(org.eclipse.xtext.parsetree.reconstr.complexrewritetest.C2) C3(org.eclipse.xtext.parsetree.reconstr.complexrewritetest.C3) TrickyD(org.eclipse.xtext.parsetree.reconstr.complexrewritetest.TrickyD) TrickyE(org.eclipse.xtext.parsetree.reconstr.complexrewritetest.TrickyE) TrickyB(org.eclipse.xtext.parsetree.reconstr.complexrewritetest.TrickyB) TrickyC(org.eclipse.xtext.parsetree.reconstr.complexrewritetest.TrickyC) Parameter(org.eclipse.xtext.Parameter) Minus(org.eclipse.xtext.parsetree.reconstr.complexrewritetest.Minus)

Example 68 with Parameter

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

the class SerializationBug269362TestLanguageSemanticSequencer 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 == SerializationBug269362TestLanguagePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case SerializationBug269362TestLanguagePackage.MODEL:
                sequence_Model(context, (Model) 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.parsetree.reconstr.serializationBug269362TestLanguage.Model) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage)

Example 69 with Parameter

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

the class SerializationErrorTestLanguageSemanticSequencer 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 == SerializationerrorPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case SerializationerrorPackage.INDENT:
                sequence_Indent(context, (Indent) semanticObject);
                return;
            case SerializationerrorPackage.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
            case SerializationerrorPackage.TWO_OPTIONS:
                sequence_TwoOptions(context, (TwoOptions) semanticObject);
                return;
            case SerializationerrorPackage.TWO_REQUIRED:
                sequence_TwoRequired(context, (TwoRequired) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Indent(org.eclipse.xtext.parsetree.reconstr.serializationerror.Indent) Model(org.eclipse.xtext.parsetree.reconstr.serializationerror.Model) TwoOptions(org.eclipse.xtext.parsetree.reconstr.serializationerror.TwoOptions) Parameter(org.eclipse.xtext.Parameter) TwoRequired(org.eclipse.xtext.parsetree.reconstr.serializationerror.TwoRequired) EPackage(org.eclipse.emf.ecore.EPackage)

Example 70 with Parameter

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

the class ContextFinderTestLanguageSemanticSequencer 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 == ContextFinderTestPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case ContextFinderTestPackage.ATTRIBUTE_EXCLUSION_TEST:
                if (rule == grammarAccess.getAttributeExclusionTest1Rule()) {
                    sequence_AttributeExclusionTest1(context, (AttributeExclusionTest) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAttributeExclusionTest2Rule()) {
                    sequence_AttributeExclusionTest2(context, (AttributeExclusionTest) semanticObject);
                    return;
                } else
                    break;
            case ContextFinderTestPackage.MODEL:
                if (rule == grammarAccess.getModel2Rule()) {
                    sequence_Model2(context, (Model) semanticObject);
                    return;
                } else if (rule == grammarAccess.getModelRule()) {
                    sequence_Model(context, (Model) semanticObject);
                    return;
                } else
                    break;
            case ContextFinderTestPackage.NESTED_TYPE_CHILD1:
                sequence_NestedTypeChild1(context, (NestedTypeChild1) semanticObject);
                return;
            case ContextFinderTestPackage.NESTED_TYPE_CHILD2:
                sequence_NestedTypeChild2(context, (NestedTypeChild2) semanticObject);
                return;
            case ContextFinderTestPackage.NESTED_TYPE_RECURSIVE_TEST:
                if (rule == grammarAccess.getNestedTypeRecursiveTest1Rule() || action == grammarAccess.getNestedTypeRecursiveTest1Access().getNestedTypeRecursiveTestLeftAction_2_0()) {
                    sequence_NestedTypeRecursiveTest1(context, (NestedTypeRecursiveTest) semanticObject);
                    return;
                } else if (rule == grammarAccess.getNestedTypeRecursiveTest2Rule() || action == grammarAccess.getNestedTypeRecursiveTest2Access().getNestedTypeRecursiveTestLeftAction_2_0()) {
                    sequence_NestedTypeRecursiveTest2(context, (NestedTypeRecursiveTest) semanticObject);
                    return;
                } else
                    break;
            case ContextFinderTestPackage.NESTED_TYPE_RECURSIVE_TEST1:
                sequence_NestedTypeRecursiveTest1_NestedTypeRecursiveTest_2_0(context, (NestedTypeRecursiveTest1) semanticObject);
                return;
            case ContextFinderTestPackage.NESTED_TYPE_RECURSIVE_TEST2:
                sequence_NestedTypeRecursiveTest2_NestedTypeRecursiveTest_2_0(context, (NestedTypeRecursiveTest2) semanticObject);
                return;
            case ContextFinderTestPackage.NESTED_TYPE_TEST:
                if (rule == grammarAccess.getNestedTypeTest1Rule()) {
                    sequence_NestedTypeTest1(context, (NestedTypeTest) semanticObject);
                    return;
                } else if (rule == grammarAccess.getNestedTypeTest2Rule()) {
                    sequence_NestedTypeTest2(context, (NestedTypeTest) semanticObject);
                    return;
                } else
                    break;
            case ContextFinderTestPackage.NODE_EXCLUSION:
                if (rule == grammarAccess.getNodeExclusion1Rule()) {
                    sequence_NodeExclusion1(context, (NodeExclusion) semanticObject);
                    return;
                } else if (rule == grammarAccess.getNodeExclusion2Rule()) {
                    sequence_NodeExclusion2(context, (NodeExclusion) semanticObject);
                    return;
                } else
                    break;
            case ContextFinderTestPackage.NODE_EXCLUSION_LIST:
                if (rule == grammarAccess.getNodeExclusion1ListRule()) {
                    sequence_NodeExclusion1List(context, (NodeExclusionList) semanticObject);
                    return;
                } else if (rule == grammarAccess.getNodeExclusion2ListRule()) {
                    sequence_NodeExclusion2List(context, (NodeExclusionList) semanticObject);
                    return;
                } else
                    break;
            case ContextFinderTestPackage.PARENT_REF_TEST1:
                sequence_ParentRefTest1(context, (ParentRefTest1) semanticObject);
                return;
            case ContextFinderTestPackage.PARENT_REF_TEST2:
                sequence_ParentRefTest2(context, (ParentRefTest2) semanticObject);
                return;
            case ContextFinderTestPackage.PARENT_REF_TEST_CHILD:
                if (rule == grammarAccess.getParentRefTestChild1Rule()) {
                    sequence_ParentRefTestChild1(context, (ParentRefTestChild) semanticObject);
                    return;
                } else if (rule == grammarAccess.getParentRefTestChild2Rule()) {
                    sequence_ParentRefTestChild2(context, (ParentRefTestChild) semanticObject);
                    return;
                } else
                    break;
            case ContextFinderTestPackage.QUANTITY_EXCLUSION_TEST:
                if (rule == grammarAccess.getQuantityExclusionTest1Rule()) {
                    sequence_QuantityExclusionTest1(context, (QuantityExclusionTest) semanticObject);
                    return;
                } else if (rule == grammarAccess.getQuantityExclusionTest2Rule()) {
                    sequence_QuantityExclusionTest2(context, (QuantityExclusionTest) semanticObject);
                    return;
                } else
                    break;
            case ContextFinderTestPackage.VALUE_EXCLUSION_TEST:
                if (rule == grammarAccess.getValueExclusionTest1Rule()) {
                    sequence_ValueExclusionTest1(context, (ValueExclusionTest) semanticObject);
                    return;
                } else if (rule == grammarAccess.getValueExclusionTest2Rule()) {
                    sequence_ValueExclusionTest2(context, (ValueExclusionTest) semanticObject);
                    return;
                } else
                    break;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ValueExclusionTest(org.eclipse.xtext.serializer.contextFinderTest.ValueExclusionTest) ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) NestedTypeRecursiveTest(org.eclipse.xtext.serializer.contextFinderTest.NestedTypeRecursiveTest) EPackage(org.eclipse.emf.ecore.EPackage) AttributeExclusionTest(org.eclipse.xtext.serializer.contextFinderTest.AttributeExclusionTest) NodeExclusion(org.eclipse.xtext.serializer.contextFinderTest.NodeExclusion) NestedTypeTest(org.eclipse.xtext.serializer.contextFinderTest.NestedTypeTest) QuantityExclusionTest(org.eclipse.xtext.serializer.contextFinderTest.QuantityExclusionTest) ParentRefTestChild(org.eclipse.xtext.serializer.contextFinderTest.ParentRefTestChild) NestedTypeRecursiveTest2(org.eclipse.xtext.serializer.contextFinderTest.NestedTypeRecursiveTest2) NestedTypeRecursiveTest1(org.eclipse.xtext.serializer.contextFinderTest.NestedTypeRecursiveTest1) Model(org.eclipse.xtext.serializer.contextFinderTest.Model) NodeExclusionList(org.eclipse.xtext.serializer.contextFinderTest.NodeExclusionList) ParentRefTest1(org.eclipse.xtext.serializer.contextFinderTest.ParentRefTest1) Parameter(org.eclipse.xtext.Parameter) ParentRefTest2(org.eclipse.xtext.serializer.contextFinderTest.ParentRefTest2) NestedTypeChild2(org.eclipse.xtext.serializer.contextFinderTest.NestedTypeChild2) NestedTypeChild1(org.eclipse.xtext.serializer.contextFinderTest.NestedTypeChild1)

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