Search in sources :

Example 1 with FacetContribution

use of org.metaborg.core.language.FacetContribution in project spoofax by metaborg.

the class ActionService method actionContributions.

@Override
public Collection<TransformActionContrib> actionContributions(ILanguageImpl language, ITransformGoal goal) {
    final Iterable<FacetContribution<ActionFacet>> facetsContributions = language.facetContributions(ActionFacet.class);
    final Collection<TransformActionContrib> actionContributions = Lists.newLinkedList();
    for (FacetContribution<ActionFacet> facetContribution : facetsContributions) {
        final ActionFacet facet = facetContribution.facet;
        final ILanguageComponent component = facetContribution.contributor;
        for (ITransformAction action : facet.actions(goal)) {
            actionContributions.add(new TransformActionContrib(action, component));
        }
    }
    return actionContributions;
}
Also used : TransformActionContrib(org.metaborg.core.action.TransformActionContrib) FacetContribution(org.metaborg.core.language.FacetContribution) ITransformAction(org.metaborg.core.action.ITransformAction) ILanguageComponent(org.metaborg.core.language.ILanguageComponent)

Aggregations

ITransformAction (org.metaborg.core.action.ITransformAction)1 TransformActionContrib (org.metaborg.core.action.TransformActionContrib)1 FacetContribution (org.metaborg.core.language.FacetContribution)1 ILanguageComponent (org.metaborg.core.language.ILanguageComponent)1