Search in sources :

Example 46 with ParserRule

use of org.eclipse.xtext.ParserRule 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 47 with ParserRule

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

the class ConcreteSyntaxConstraintProvider method getConstraints.

@Override
public Collection<ISyntaxConstraint> getConstraints(EClass cls) {
    List<ISyntaxConstraint> eles = type2Elements.get(cls);
    if (eles != null)
        return eles;
    eles = Lists.newArrayList();
    for (ParserRule r : getValidRules()) {
        if (((EClass) r.getType().getClassifier()).isSuperTypeOf(cls)) {
            ISyntaxConstraint e = getConstraint(r);
            if (e != null)
                eles.add(e);
            else {
                eles.clear();
                break;
            }
        }
    }
    type2Elements.put(cls, eles);
    return eles;
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) EClass(org.eclipse.emf.ecore.EClass)

Example 48 with ParserRule

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

the class ConcreteSyntaxConstraintProvider method getValidRules.

protected Set<ParserRule> getValidRules() {
    if (validRules != null)
        return validRules;
    validRules = Sets.newHashSet();
    ParserRule first = getFirstParserRule(grammar);
    validRules.add(first);
    collectReachableRules(first, validRules, new HashSet<ParserRule>());
    return validRules;
}
Also used : ParserRule(org.eclipse.xtext.ParserRule)

Example 49 with ParserRule

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

the class ConcreteSyntaxConstraintProvider method createElement.

protected ISyntaxConstraint createElement(EObject obj) {
    if (!(obj instanceof AbstractElement))
        return null;
    AbstractElement ele = (AbstractElement) obj;
    boolean multiple = false;
    boolean optional = false;
    EClass semanticType = null;
    while (true) {
        multiple = multiple || isMultipleCardinality(ele);
        optional = optional || isOptionalCardinality(ele);
        if (ele.eContainer() instanceof ParserRule && ((ParserRule) ele.eContainer()).getType().getClassifier() instanceof EClass)
            semanticType = (EClass) ((ParserRule) ele.eContainer()).getType().getClassifier();
        if (ele instanceof Assignment) {
            return createElement(ConstraintType.ASSIGNMENT, ele, semanticType, multiple, optional);
        } else if (ele instanceof Group || ele instanceof UnorderedGroup) {
            CompoundElement comp = (CompoundElement) ele;
            AbstractElement lastChild = null;
            for (AbstractElement o : comp.getElements()) if (containsRelevantElement(o)) {
                if (lastChild == null)
                    lastChild = o;
                else {
                    List<AbstractElement> c = new ArrayList<AbstractElement>(comp.getElements());
                    List<ISyntaxConstraint> e = createSummarizedAssignments(comp, c, semanticType, optional);
                    if (e.size() == 1 && c.size() == 0)
                        return e.get(0);
                    return createElement(ConstraintType.GROUP, ele, c, e, semanticType, multiple, optional);
                }
            }
            if (lastChild == null)
                return null;
            ele = lastChild;
            continue;
        } else if (ele instanceof Alternatives) {
            int relevantChildren = 0;
            AbstractElement lastChild = null;
            for (AbstractElement o : ((CompoundElement) ele).getElements()) if (containsRelevantElement(o)) {
                relevantChildren++;
                lastChild = o;
            }
            if (relevantChildren < ((CompoundElement) ele).getElements().size())
                optional = true;
            if (relevantChildren > 1)
                return createElement(ConstraintType.ALTERNATIVE, ele, semanticType, multiple, optional);
            if (lastChild == null)
                return null;
            ele = lastChild;
            continue;
        } else if (ele instanceof Action) {
            semanticType = (EClass) ((Action) ele).getType().getClassifier();
            return createElement(ConstraintType.ACTION, ele, semanticType, multiple, optional);
        } else if (ele instanceof RuleCall) {
            AbstractRule rule = ((RuleCall) ele).getRule();
            if (rule.getType().getClassifier() instanceof EClass) {
                ele = rule.getAlternatives();
                continue;
            }
        }
        return null;
    }
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) UnorderedGroup(org.eclipse.xtext.UnorderedGroup) Group(org.eclipse.xtext.Group) Action(org.eclipse.xtext.Action) AbstractElement(org.eclipse.xtext.AbstractElement) ArrayList(java.util.ArrayList) Alternatives(org.eclipse.xtext.Alternatives) RuleCall(org.eclipse.xtext.RuleCall) Assignment(org.eclipse.xtext.Assignment) EClass(org.eclipse.emf.ecore.EClass) UnorderedGroup(org.eclipse.xtext.UnorderedGroup) CompoundElement(org.eclipse.xtext.CompoundElement) AbstractRule(org.eclipse.xtext.AbstractRule)

Example 50 with ParserRule

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

the class OverriddenValueInspector method caseRuleCall.

@Override
public Boolean caseRuleCall(RuleCall object) {
    AbstractRule calledRule = object.getRule();
    if (calledRule == null || calledRule.eIsProxy() || calledRule instanceof TerminalRule || calledRule instanceof EnumRule)
        return Boolean.FALSE;
    ParserRule parserRule = (ParserRule) calledRule;
    if (GrammarUtil.isDatatypeRule(parserRule))
        return Boolean.FALSE;
    if (parserRule.isFragment()) {
        visitFragment(object);
        if (GrammarUtil.isMultipleCardinality(object))
            visitFragment(object);
    }
    if (!addVisited(parserRule))
        return Boolean.FALSE;
    Multimap<String, AbstractElement> prevAssignedFeatures = assignedFeatures;
    assignedFeatures = newMultimap();
    doSwitch(parserRule.getAlternatives());
    for (String feature : assignedFeatures.keySet()) prevAssignedFeatures.put(feature, object);
    assignedFeatures = prevAssignedFeatures;
    removeVisited(parserRule);
    return Boolean.FALSE;
}
Also used : EnumRule(org.eclipse.xtext.EnumRule) ParserRule(org.eclipse.xtext.ParserRule) AbstractElement(org.eclipse.xtext.AbstractElement) TerminalRule(org.eclipse.xtext.TerminalRule) AbstractRule(org.eclipse.xtext.AbstractRule)

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