Search in sources :

Example 1 with UsedRulesFinder

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

the class XbaseUsageDetector method usesXImportSection.

public boolean usesXImportSection(final Grammar grammar) {
    final Set<AbstractRule> usedRules = CollectionLiterals.<AbstractRule>newHashSet();
    new UsedRulesFinder(usedRules).compute(grammar);
    final Function1<AbstractRule, Boolean> _function = (AbstractRule it) -> {
        return Boolean.valueOf((Objects.equal(it.getName(), "XImportSection") && Objects.equal(GrammarUtil.getGrammar(it).getName(), "org.eclipse.xtext.xbase.Xtype")));
    };
    return IterableExtensions.<AbstractRule>exists(usedRules, _function);
}
Also used : UsedRulesFinder(org.eclipse.xtext.xtext.UsedRulesFinder) AbstractRule(org.eclipse.xtext.AbstractRule)

Aggregations

AbstractRule (org.eclipse.xtext.AbstractRule)1 UsedRulesFinder (org.eclipse.xtext.xtext.UsedRulesFinder)1