Selector

public protocol Selector : GrammarComponent

A Selector selects a subset of tokens from those tokens which have been successfully parsed at at particular position.

  • Selects a subset of tokens from those tokens which have been successfully parsed at a particular position. Selection happens in iterative phases, which correspond to a discovery process of which terminals could possibly occur at the current position based on the current parsing progress. Tokens already selected in previous phases cannot be deselected in later phases.

    Declaration

    Swift

    func select(from: Tokens<Param, Result>, alreadySelected: Tokens<Param, Result>) -> Tokens<Param, Result>

    Parameters

    from

    Those tokens which have been parsed in the current selection phase. (that is not true anymore, I think: The terminal keys in from are guaranteed to be different from those in alreadySelected.)

    alreadySelected

    The tokens which have been selected in earlier phases.

    Return Value

    The selected tokens, which must be contained in from.