Search in sources :

Example 1 with EnumLiteralDeclaration

use of org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.EnumLiteralDeclaration in project xtext-core by eclipse.

the class XtextGrammarTestLanguageSemanticSequencer 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 == XtextGrammarTestPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case XtextGrammarTestPackage.ACTION:
                if (rule == grammarAccess.getAlternativesRule() || action == grammarAccess.getAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getGroupRule() || action == grammarAccess.getGroupAccess().getGroupTokensAction_1_0() || rule == grammarAccess.getAbstractTokenRule() || rule == grammarAccess.getAbstractTokenWithCardinalityRule() || rule == grammarAccess.getAbstractTerminalRule() || rule == grammarAccess.getParenthesizedElementRule()) {
                    sequence_AbstractTokenWithCardinality_Action(context, (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.Action) semanticObject);
                    return;
                } else if (rule == grammarAccess.getActionRule()) {
                    sequence_Action(context, (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.Action) semanticObject);
                    return;
                } else
                    break;
            case XtextGrammarTestPackage.ALTERNATIVES:
                if (rule == grammarAccess.getAlternativesRule() || action == grammarAccess.getAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getGroupRule() || action == grammarAccess.getGroupAccess().getGroupTokensAction_1_0() || rule == grammarAccess.getAbstractTokenRule() || rule == grammarAccess.getAbstractTokenWithCardinalityRule() || rule == grammarAccess.getAbstractTerminalRule() || rule == grammarAccess.getParenthesizedElementRule()) {
                    sequence_AbstractTokenWithCardinality_Alternatives(context, (Alternatives) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAssignableTerminalRule() || rule == grammarAccess.getParenthesizedAssignableElementRule() || rule == grammarAccess.getAssignableAlternativesRule() || action == grammarAccess.getAssignableAlternativesAccess().getAlternativesGroupsAction_1_0()) {
                    sequence_AssignableAlternatives(context, (Alternatives) semanticObject);
                    return;
                } else if (rule == grammarAccess.getCrossReferenceableTerminalRule() || rule == grammarAccess.getParenthesizedCrossReferenceableElementRule() || rule == grammarAccess.getCrossReferenceableAlternativesRule() || action == grammarAccess.getCrossReferenceableAlternativesAccess().getAlternativesGroupsAction_1_0()) {
                    sequence_CrossReferenceableAlternatives(context, (Alternatives) semanticObject);
                    return;
                } else if (rule == grammarAccess.getEnumLiteralsRule()) {
                    sequence_EnumLiterals(context, (Alternatives) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupTokensAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_TerminalAlternatives_TerminalToken(context, (Alternatives) semanticObject);
                    return;
                } else
                    break;
            case XtextGrammarTestPackage.ASSIGNMENT:
                if (rule == grammarAccess.getAlternativesRule() || action == grammarAccess.getAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getGroupRule() || action == grammarAccess.getGroupAccess().getGroupTokensAction_1_0() || rule == grammarAccess.getAbstractTokenRule() || rule == grammarAccess.getAbstractTokenWithCardinalityRule() || rule == grammarAccess.getAbstractTerminalRule() || rule == grammarAccess.getParenthesizedElementRule()) {
                    sequence_AbstractTokenWithCardinality_Assignment(context, (Assignment) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAssignmentRule()) {
                    sequence_Assignment(context, (Assignment) semanticObject);
                    return;
                } else
                    break;
            case XtextGrammarTestPackage.CHARACTER_RANGE:
                if (rule == grammarAccess.getCharacterRangeRule()) {
                    sequence_CharacterRange(context, (CharacterRange) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupTokensAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_CharacterRange_TerminalToken(context, (CharacterRange) semanticObject);
                    return;
                } else
                    break;
            case XtextGrammarTestPackage.CROSS_REFERENCE:
                sequence_CrossReference(context, (CrossReference) semanticObject);
                return;
            case XtextGrammarTestPackage.ENUM_LITERAL_DECLARATION:
                sequence_EnumLiteralDeclaration(context, (EnumLiteralDeclaration) semanticObject);
                return;
            case XtextGrammarTestPackage.ENUM_RULE:
                sequence_EnumRule(context, (EnumRule) semanticObject);
                return;
            case XtextGrammarTestPackage.GENERATED_METAMODEL:
                sequence_GeneratedMetamodel(context, (GeneratedMetamodel) semanticObject);
                return;
            case XtextGrammarTestPackage.GRAMMAR:
                sequence_Grammar(context, (Grammar) semanticObject);
                return;
            case XtextGrammarTestPackage.GROUP:
                if (rule == grammarAccess.getAlternativesRule() || action == grammarAccess.getAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getGroupRule() || action == grammarAccess.getGroupAccess().getGroupTokensAction_1_0() || rule == grammarAccess.getAbstractTokenRule() || rule == grammarAccess.getAbstractTokenWithCardinalityRule() || rule == grammarAccess.getAbstractTerminalRule() || rule == grammarAccess.getParenthesizedElementRule()) {
                    sequence_AbstractTokenWithCardinality_Group(context, (Group) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupTokensAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_TerminalGroup_TerminalToken(context, (Group) semanticObject);
                    return;
                } else
                    break;
            case XtextGrammarTestPackage.KEYWORD:
                if (rule == grammarAccess.getAlternativesRule() || action == grammarAccess.getAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getGroupRule() || action == grammarAccess.getGroupAccess().getGroupTokensAction_1_0() || rule == grammarAccess.getAbstractTokenRule() || rule == grammarAccess.getAbstractTokenWithCardinalityRule() || rule == grammarAccess.getAbstractTerminalRule() || rule == grammarAccess.getParenthesizedElementRule()) {
                    sequence_AbstractTokenWithCardinality_Keyword(context, (Keyword) semanticObject);
                    return;
                } else if (rule == grammarAccess.getKeywordRule() || rule == grammarAccess.getAssignableTerminalRule() || rule == grammarAccess.getParenthesizedAssignableElementRule() || rule == grammarAccess.getAssignableAlternativesRule() || action == grammarAccess.getAssignableAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getCrossReferenceableTerminalRule() || rule == grammarAccess.getParenthesizedCrossReferenceableElementRule() || rule == grammarAccess.getCrossReferenceableAlternativesRule() || action == grammarAccess.getCrossReferenceableAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getCharacterRangeRule() || action == grammarAccess.getCharacterRangeAccess().getCharacterRangeLeftAction_1_0()) {
                    sequence_Keyword(context, (Keyword) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupTokensAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_Keyword_TerminalToken(context, (Keyword) semanticObject);
                    return;
                } else
                    break;
            case XtextGrammarTestPackage.NEGATED_TOKEN:
                if (rule == grammarAccess.getAbstractNegatedTokenRule() || rule == grammarAccess.getNegatedTokenRule()) {
                    sequence_NegatedToken(context, (NegatedToken) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupTokensAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_NegatedToken_TerminalToken(context, (NegatedToken) semanticObject);
                    return;
                } else
                    break;
            case XtextGrammarTestPackage.PARSER_RULE:
                sequence_ParserRule(context, (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.ParserRule) semanticObject);
                return;
            case XtextGrammarTestPackage.REFERENCED_METAMODEL:
                sequence_ReferencedMetamodel(context, (ReferencedMetamodel) semanticObject);
                return;
            case XtextGrammarTestPackage.RULE_CALL:
                if (rule == grammarAccess.getAlternativesRule() || action == grammarAccess.getAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getGroupRule() || action == grammarAccess.getGroupAccess().getGroupTokensAction_1_0() || rule == grammarAccess.getAbstractTokenRule() || rule == grammarAccess.getAbstractTokenWithCardinalityRule() || rule == grammarAccess.getAbstractTerminalRule() || rule == grammarAccess.getParenthesizedElementRule()) {
                    sequence_AbstractTokenWithCardinality_RuleCall(context, (RuleCall) semanticObject);
                    return;
                } else if (rule == grammarAccess.getRuleCallRule() || rule == grammarAccess.getAssignableTerminalRule() || rule == grammarAccess.getParenthesizedAssignableElementRule() || rule == grammarAccess.getAssignableAlternativesRule() || action == grammarAccess.getAssignableAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getCrossReferenceableTerminalRule() || rule == grammarAccess.getParenthesizedCrossReferenceableElementRule() || rule == grammarAccess.getCrossReferenceableAlternativesRule() || action == grammarAccess.getCrossReferenceableAlternativesAccess().getAlternativesGroupsAction_1_0()) {
                    sequence_RuleCall(context, (RuleCall) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupTokensAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_RuleCall_TerminalToken(context, (RuleCall) semanticObject);
                    return;
                } else
                    break;
            case XtextGrammarTestPackage.TERMINAL_RULE:
                sequence_TerminalRule(context, (TerminalRule) semanticObject);
                return;
            case XtextGrammarTestPackage.TYPE_REF:
                sequence_TypeRef(context, (TypeRef) semanticObject);
                return;
            case XtextGrammarTestPackage.UNTIL_TOKEN:
                if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupTokensAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_TerminalToken_UntilToken(context, (UntilToken) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAbstractNegatedTokenRule() || rule == grammarAccess.getUntilTokenRule()) {
                    sequence_UntilToken(context, (UntilToken) semanticObject);
                    return;
                } else
                    break;
            case XtextGrammarTestPackage.WILDCARD:
                if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesGroupsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupTokensAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_TerminalToken_Wildcard(context, (Wildcard) semanticObject);
                    return;
                } else if (rule == grammarAccess.getWildcardRule()) {
                    sequence_Wildcard(context, (Wildcard) semanticObject);
                    return;
                } else
                    break;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Group(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.Group) Action(org.eclipse.xtext.Action) EnumLiteralDeclaration(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.EnumLiteralDeclaration) TypeRef(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.TypeRef) RuleCall(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.RuleCall) EPackage(org.eclipse.emf.ecore.EPackage) Assignment(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.Assignment) EnumRule(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.EnumRule) GeneratedMetamodel(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.GeneratedMetamodel) Wildcard(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.Wildcard) ReferencedMetamodel(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.ReferencedMetamodel) Keyword(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.Keyword) Grammar(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.Grammar) Alternatives(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.Alternatives) Parameter(org.eclipse.xtext.Parameter) CrossReference(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.CrossReference) CharacterRange(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.CharacterRange) UntilToken(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.UntilToken) NegatedToken(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.NegatedToken) TerminalRule(org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.TerminalRule)

Aggregations

EPackage (org.eclipse.emf.ecore.EPackage)1 Action (org.eclipse.xtext.Action)1 Parameter (org.eclipse.xtext.Parameter)1 ParserRule (org.eclipse.xtext.ParserRule)1 Alternatives (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.Alternatives)1 Assignment (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.Assignment)1 CharacterRange (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.CharacterRange)1 CrossReference (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.CrossReference)1 EnumLiteralDeclaration (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.EnumLiteralDeclaration)1 EnumRule (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.EnumRule)1 GeneratedMetamodel (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.GeneratedMetamodel)1 Grammar (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.Grammar)1 Group (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.Group)1 Keyword (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.Keyword)1 NegatedToken (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.NegatedToken)1 ReferencedMetamodel (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.ReferencedMetamodel)1 RuleCall (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.RuleCall)1 TerminalRule (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.TerminalRule)1 TypeRef (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.TypeRef)1 UntilToken (org.eclipse.xtext.testlanguages.xtextgrammar.xtextGrammarTest.UntilToken)1