Search in sources :

Example 41 with Parameter

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

the class PartialSerializationTestLanguageSemanticSequencer 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 == EcorePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case EcorePackage.ECLASS:
                sequence_EClassDecl(context, (EClass) semanticObject);
                return;
        }
    else if (epackage == PartialSerializationTestLanguagePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case PartialSerializationTestLanguagePackage.ECLASS_REF:
                sequence_EClassRef(context, (EClassRef) semanticObject);
                return;
            case PartialSerializationTestLanguagePackage.IMPORT:
                sequence_Import(context, (Import) semanticObject);
                return;
            case PartialSerializationTestLanguagePackage.MANDATORY_CHILD:
                sequence_MandatoryChild(context, (MandatoryChild) semanticObject);
                return;
            case PartialSerializationTestLanguagePackage.MANDATORY_CHILD_LIST:
                sequence_MandatoryChildList(context, (MandatoryChildList) semanticObject);
                return;
            case PartialSerializationTestLanguagePackage.MANDATORY_VALUE:
                sequence_MandatoryValue(context, (MandatoryValue) semanticObject);
                return;
            case PartialSerializationTestLanguagePackage.MANY_MANDATORY_VALUES:
                sequence_ManyMandatoryValues(context, (ManyMandatoryValues) semanticObject);
                return;
            case PartialSerializationTestLanguagePackage.MANY_VALUES:
                sequence_ManyOptionalValues(context, (ManyValues) semanticObject);
                return;
            case PartialSerializationTestLanguagePackage.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
            case PartialSerializationTestLanguagePackage.NODE:
                sequence_Node(context, (Node) semanticObject);
                return;
            case PartialSerializationTestLanguagePackage.OPTIONAL_CHILD:
                sequence_OptionalChild(context, (OptionalChild) semanticObject);
                return;
            case PartialSerializationTestLanguagePackage.OPTIONAL_CHILD_LIST:
                sequence_OptionalChildList(context, (OptionalChildList) semanticObject);
                return;
            case PartialSerializationTestLanguagePackage.OPTIONAL_VALUE:
                sequence_OptionalValue(context, (OptionalValue) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) EClass(org.eclipse.emf.ecore.EClass) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage)

Example 42 with Parameter

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

the class Bug385636SemanticSequencer 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 == Bug385636Package.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug385636Package.DEFINE_VARIABLE:
                sequence_DefineVariable(context, (DefineVariable) semanticObject);
                return;
            case Bug385636Package.DEFINE_VARIABLES:
                sequence_DefineVariables(context, (DefineVariables) semanticObject);
                return;
            case Bug385636Package.EXPRESSION_EQUAL:
                sequence_Statement(context, (Expression_Equal) semanticObject);
                return;
            case Bug385636Package.EXPRESSION_LARGER_EQUAL:
                sequence_Statement(context, (Expression_Larger_Equal) semanticObject);
                return;
            case Bug385636Package.EXPRESSION_NOT_EQUAL:
                sequence_Statement(context, (Expression_Not_Equal) semanticObject);
                return;
            case Bug385636Package.EXPRESSION_NOT_GREATER:
                sequence_Statement(context, (Expression_Not_Greater) semanticObject);
                return;
            case Bug385636Package.EXPRESSION_NOT_LESS:
                sequence_Statement(context, (Expression_Not_Less) semanticObject);
                return;
            case Bug385636Package.EXPRESSION_SMALLER:
                sequence_Statement(context, (Expression_Smaller) semanticObject);
                return;
            case Bug385636Package.EXPRESSION_SMALLER_EQUAL:
                sequence_Statement(context, (Expression_Smaller_Equal) semanticObject);
                return;
            case Bug385636Package.EXPRESSION_VARIABLE_NAME:
                sequence_Expression_VariableName(context, (Expression_VariableName) semanticObject);
                return;
            case Bug385636Package.NVARIABLE_ACCESS:
                sequence_NVariableAccess(context, (NVariableAccess) semanticObject);
                return;
            case Bug385636Package.PROGRAM:
                sequence_Program(context, (Program) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : Expression_Smaller(org.eclipse.xtext.resource.bug385636.Expression_Smaller) ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Expression_VariableName(org.eclipse.xtext.resource.bug385636.Expression_VariableName) Program(org.eclipse.xtext.resource.bug385636.Program) Expression_Larger_Equal(org.eclipse.xtext.resource.bug385636.Expression_Larger_Equal) DefineVariable(org.eclipse.xtext.resource.bug385636.DefineVariable) Expression_Not_Equal(org.eclipse.xtext.resource.bug385636.Expression_Not_Equal) Expression_Not_Greater(org.eclipse.xtext.resource.bug385636.Expression_Not_Greater) EPackage(org.eclipse.emf.ecore.EPackage) Expression_Smaller_Equal(org.eclipse.xtext.resource.bug385636.Expression_Smaller_Equal) Expression_Not_Less(org.eclipse.xtext.resource.bug385636.Expression_Not_Less) Expression_Equal(org.eclipse.xtext.resource.bug385636.Expression_Equal) Parameter(org.eclipse.xtext.Parameter) DefineVariables(org.eclipse.xtext.resource.bug385636.DefineVariables) NVariableAccess(org.eclipse.xtext.resource.bug385636.NVariableAccess)

Example 43 with Parameter

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

the class LiveContainerTestLanguageSemanticSequencer 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 == LiveContainerTestLanguagePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case LiveContainerTestLanguagePackage.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.resource.liveContainerTestLanguage.Model) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage)

Example 44 with Parameter

use of org.eclipse.xtext.Parameter 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 == XtextTestPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case XtextTestPackage.ACTION:
                if (rule == grammarAccess.getActionRule()) {
                    sequence_Action(context, (org.eclipse.xtext.xtextTest.Action) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAlternativesRule() || action == grammarAccess.getAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getConditionalBranchRule() || rule == grammarAccess.getUnorderedGroupRule() || action == grammarAccess.getUnorderedGroupAccess().getUnorderedGroupElementsAction_1_0() || rule == grammarAccess.getGroupRule() || action == grammarAccess.getGroupAccess().getGroupElementsAction_1_0() || rule == grammarAccess.getAbstractTokenRule() || rule == grammarAccess.getAbstractTokenWithCardinalityRule() || rule == grammarAccess.getAbstractTerminalRule() || rule == grammarAccess.getParenthesizedElementRule()) {
                    sequence_Action_Cardinalities(context, (org.eclipse.xtext.xtextTest.Action) semanticObject);
                    return;
                } else
                    break;
            case XtextTestPackage.ALTERNATIVES:
                if (rule == grammarAccess.getAlternativesRule() || action == grammarAccess.getAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getConditionalBranchRule() || rule == grammarAccess.getUnorderedGroupRule() || action == grammarAccess.getUnorderedGroupAccess().getUnorderedGroupElementsAction_1_0() || rule == grammarAccess.getGroupRule() || action == grammarAccess.getGroupAccess().getGroupElementsAction_1_0() || rule == grammarAccess.getAbstractTokenRule() || rule == grammarAccess.getAbstractTokenWithCardinalityRule() || rule == grammarAccess.getAbstractTerminalRule() || rule == grammarAccess.getParenthesizedElementRule()) {
                    sequence_Alternatives_Cardinalities(context, (Alternatives) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAssignableTerminalRule() || rule == grammarAccess.getParenthesizedAssignableElementRule() || rule == grammarAccess.getAssignableAlternativesRule() || action == grammarAccess.getAssignableAlternativesAccess().getAlternativesElementsAction_1_0()) {
                    sequence_AssignableAlternatives(context, (Alternatives) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupElementsAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_Cardinalities_TerminalAlternatives(context, (Alternatives) semanticObject);
                    return;
                } else if (rule == grammarAccess.getEnumLiteralsRule()) {
                    sequence_EnumLiterals(context, (Alternatives) semanticObject);
                    return;
                } else
                    break;
            case XtextTestPackage.ASSIGNMENT:
                if (rule == grammarAccess.getAlternativesRule() || action == grammarAccess.getAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getConditionalBranchRule() || rule == grammarAccess.getUnorderedGroupRule() || action == grammarAccess.getUnorderedGroupAccess().getUnorderedGroupElementsAction_1_0() || rule == grammarAccess.getGroupRule() || action == grammarAccess.getGroupAccess().getGroupElementsAction_1_0() || rule == grammarAccess.getAbstractTokenRule() || rule == grammarAccess.getAbstractTokenWithCardinalityRule() || rule == grammarAccess.getAbstractTerminalRule() || rule == grammarAccess.getParenthesizedElementRule()) {
                    sequence_Assignment_Cardinalities_Predicate(context, (Assignment) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAssignmentRule()) {
                    sequence_Assignment_Predicate(context, (Assignment) semanticObject);
                    return;
                } else
                    break;
            case XtextTestPackage.CHARACTER_RANGE:
                if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupElementsAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_Cardinalities_CharacterRange(context, (CharacterRange) semanticObject);
                    return;
                } else if (rule == grammarAccess.getCharacterRangeRule()) {
                    sequence_CharacterRange(context, (CharacterRange) semanticObject);
                    return;
                } else
                    break;
            case XtextTestPackage.CONDITIONAL_BRANCH:
                sequence_Cardinalities_ConditionalBranch(context, (ConditionalBranch) semanticObject);
                return;
            case XtextTestPackage.CROSS_REFERENCE:
                sequence_CrossReference(context, (CrossReference) semanticObject);
                return;
            case XtextTestPackage.EOF:
                if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupElementsAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_Cardinalities_EOF(context, (EOF) semanticObject);
                    return;
                } else if (rule == grammarAccess.getEOFRule()) {
                    sequence_EOF(context, (EOF) semanticObject);
                    return;
                } else
                    break;
            case XtextTestPackage.ENUM_LITERAL_DECLARATION:
                sequence_EnumLiteralDeclaration(context, (EnumLiteralDeclaration) semanticObject);
                return;
            case XtextTestPackage.ENUM_RULE:
                sequence_EnumRule_ReturnsClause(context, (EnumRule) semanticObject);
                return;
            case XtextTestPackage.GENERATED_METAMODEL:
                sequence_GeneratedMetamodel(context, (GeneratedMetamodel) semanticObject);
                return;
            case XtextTestPackage.GRAMMAR:
                sequence_Grammar_HiddenClause(context, (Grammar) semanticObject);
                return;
            case XtextTestPackage.GROUP:
                if (rule == grammarAccess.getAlternativesRule() || action == grammarAccess.getAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getConditionalBranchRule() || rule == grammarAccess.getUnorderedGroupRule() || action == grammarAccess.getUnorderedGroupAccess().getUnorderedGroupElementsAction_1_0() || rule == grammarAccess.getGroupRule() || action == grammarAccess.getGroupAccess().getGroupElementsAction_1_0() || rule == grammarAccess.getAbstractTokenRule() || rule == grammarAccess.getAbstractTokenWithCardinalityRule() || rule == grammarAccess.getAbstractTerminalRule() || rule == grammarAccess.getParenthesizedElementRule()) {
                    sequence_Cardinalities_Group_Predicate_PredicatedGroup(context, (Group) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupElementsAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_Cardinalities_TerminalGroup(context, (Group) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPredicatedGroupRule()) {
                    sequence_Predicate_PredicatedGroup(context, (Group) semanticObject);
                    return;
                } else
                    break;
            case XtextTestPackage.KEYWORD:
                if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupElementsAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_Cardinalities_Keyword(context, (Keyword) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAlternativesRule() || action == grammarAccess.getAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getConditionalBranchRule() || rule == grammarAccess.getUnorderedGroupRule() || action == grammarAccess.getUnorderedGroupAccess().getUnorderedGroupElementsAction_1_0() || rule == grammarAccess.getGroupRule() || action == grammarAccess.getGroupAccess().getGroupElementsAction_1_0() || rule == grammarAccess.getAbstractTokenRule() || rule == grammarAccess.getAbstractTokenWithCardinalityRule() || rule == grammarAccess.getAbstractTerminalRule() || rule == grammarAccess.getParenthesizedElementRule()) {
                    sequence_Cardinalities_Keyword_Predicate_PredicatedKeyword(context, (Keyword) semanticObject);
                    return;
                } else if (rule == grammarAccess.getKeywordRule() || rule == grammarAccess.getAssignableTerminalRule() || rule == grammarAccess.getParenthesizedAssignableElementRule() || rule == grammarAccess.getAssignableAlternativesRule() || action == grammarAccess.getAssignableAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getCrossReferenceableTerminalRule() || rule == grammarAccess.getCharacterRangeRule() || action == grammarAccess.getCharacterRangeAccess().getCharacterRangeLeftAction_1_0()) {
                    sequence_Keyword(context, (Keyword) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPredicatedKeywordRule()) {
                    sequence_Predicate_PredicatedKeyword(context, (Keyword) semanticObject);
                    return;
                } else
                    break;
            case XtextTestPackage.NAMED_ARGUMENT:
                sequence_NamedArgument(context, (NamedArgument) semanticObject);
                return;
            case XtextTestPackage.NEGATED_TOKEN:
                if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupElementsAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_Cardinalities_NegatedToken(context, (NegatedToken) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAbstractNegatedTokenRule() || rule == grammarAccess.getNegatedTokenRule()) {
                    sequence_NegatedToken(context, (NegatedToken) semanticObject);
                    return;
                } else
                    break;
            case XtextTestPackage.PARAMETER:
                sequence_Parameter(context, (org.eclipse.xtext.xtextTest.Parameter) semanticObject);
                return;
            case XtextTestPackage.PARSER_RULE:
                sequence_HiddenClause_ParserRule_ReturnsClause_RuleNameAndParams(context, (org.eclipse.xtext.xtextTest.ParserRule) semanticObject);
                return;
            case XtextTestPackage.REFERENCED_METAMODEL:
                sequence_ReferencedMetamodel(context, (ReferencedMetamodel) semanticObject);
                return;
            case XtextTestPackage.RULE_CALL:
                if (rule == grammarAccess.getAlternativesRule() || action == grammarAccess.getAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getConditionalBranchRule() || rule == grammarAccess.getUnorderedGroupRule() || action == grammarAccess.getUnorderedGroupAccess().getUnorderedGroupElementsAction_1_0() || rule == grammarAccess.getGroupRule() || action == grammarAccess.getGroupAccess().getGroupElementsAction_1_0() || rule == grammarAccess.getAbstractTokenRule() || rule == grammarAccess.getAbstractTokenWithCardinalityRule() || rule == grammarAccess.getAbstractTerminalRule() || rule == grammarAccess.getParenthesizedElementRule()) {
                    sequence_Cardinalities_Predicate_PredicatedRuleCall_RuleCall(context, (RuleCall) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupElementsAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_Cardinalities_TerminalRuleCall(context, (RuleCall) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPredicatedRuleCallRule()) {
                    sequence_Predicate_PredicatedRuleCall(context, (RuleCall) semanticObject);
                    return;
                } else if (rule == grammarAccess.getRuleCallRule() || rule == grammarAccess.getAssignableTerminalRule() || rule == grammarAccess.getParenthesizedAssignableElementRule() || rule == grammarAccess.getAssignableAlternativesRule() || action == grammarAccess.getAssignableAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getCrossReferenceableTerminalRule()) {
                    sequence_RuleCall(context, (RuleCall) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTerminalRuleCallRule()) {
                    sequence_TerminalRuleCall(context, (RuleCall) semanticObject);
                    return;
                } else
                    break;
            case XtextTestPackage.TERMINAL_RULE:
                sequence_ReturnsClause_TerminalRule(context, (TerminalRule) semanticObject);
                return;
            case XtextTestPackage.TYPE_REF:
                sequence_TypeRef(context, (TypeRef) semanticObject);
                return;
            case XtextTestPackage.UNORDERED_GROUP:
                sequence_Cardinalities_UnorderedGroup(context, (UnorderedGroup) semanticObject);
                return;
            case XtextTestPackage.UNTIL_TOKEN:
                if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupElementsAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_Cardinalities_UntilToken(context, (UntilToken) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAbstractNegatedTokenRule() || rule == grammarAccess.getUntilTokenRule()) {
                    sequence_UntilToken(context, (UntilToken) semanticObject);
                    return;
                } else
                    break;
            case XtextTestPackage.WILDCARD:
                if (rule == grammarAccess.getTerminalAlternativesRule() || action == grammarAccess.getTerminalAlternativesAccess().getAlternativesElementsAction_1_0() || rule == grammarAccess.getTerminalGroupRule() || action == grammarAccess.getTerminalGroupAccess().getGroupElementsAction_1_0() || rule == grammarAccess.getTerminalTokenRule() || rule == grammarAccess.getTerminalTokenElementRule() || rule == grammarAccess.getParenthesizedTerminalElementRule()) {
                    sequence_Cardinalities_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.xtextTest.Group) UnorderedGroup(org.eclipse.xtext.xtextTest.UnorderedGroup) Action(org.eclipse.xtext.Action) EnumLiteralDeclaration(org.eclipse.xtext.xtextTest.EnumLiteralDeclaration) TypeRef(org.eclipse.xtext.xtextTest.TypeRef) ConditionalBranch(org.eclipse.xtext.xtextTest.ConditionalBranch) RuleCall(org.eclipse.xtext.xtextTest.RuleCall) EPackage(org.eclipse.emf.ecore.EPackage) Assignment(org.eclipse.xtext.xtextTest.Assignment) EnumRule(org.eclipse.xtext.xtextTest.EnumRule) GeneratedMetamodel(org.eclipse.xtext.xtextTest.GeneratedMetamodel) Wildcard(org.eclipse.xtext.xtextTest.Wildcard) UnorderedGroup(org.eclipse.xtext.xtextTest.UnorderedGroup) NamedArgument(org.eclipse.xtext.xtextTest.NamedArgument) EOF(org.eclipse.xtext.xtextTest.EOF) ReferencedMetamodel(org.eclipse.xtext.xtextTest.ReferencedMetamodel) Keyword(org.eclipse.xtext.xtextTest.Keyword) Grammar(org.eclipse.xtext.xtextTest.Grammar) Alternatives(org.eclipse.xtext.xtextTest.Alternatives) Parameter(org.eclipse.xtext.Parameter) CrossReference(org.eclipse.xtext.xtextTest.CrossReference) CharacterRange(org.eclipse.xtext.xtextTest.CharacterRange) UntilToken(org.eclipse.xtext.xtextTest.UntilToken) NegatedToken(org.eclipse.xtext.xtextTest.NegatedToken) TerminalRule(org.eclipse.xtext.xtextTest.TerminalRule)

Example 45 with Parameter

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

the class ParameterConfigHelper method getAssignedParameters.

public static Set<Parameter> getAssignedParameters(AbstractElement element, int parameterConfig) {
    if (parameterConfig != 0) {
        ParserRule parserRule = GrammarUtil.containingParserRule(element);
        Set<Parameter> allParameters = ImmutableSet.copyOf(parserRule.getParameters());
        int seen = 0;
        for (Set<Parameter> candidate : Sets.powerSet(allParameters)) {
            if (seen == parameterConfig) {
                return candidate;
            }
            seen++;
        }
    }
    return Collections.emptySet();
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Parameter(org.eclipse.xtext.Parameter)

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