Protocols

The following protocols are available globally.

  • Information about the right-hand side of a rule that has successfully completed parsing. This information is used when constructing the result of a successful parse.

    Seealso

    ConstructResult
    See more

    Declaration

    Swift

    public protocol CompletedRightHandSide : GrammarComponent
  • A ConstructResult is a specification for how to compute the result of a successful parse.

    See more

    Declaration

    Swift

    public protocol ConstructResult : GrammarComponent
  • An environment which an EvalFunc can use to store information needed during evaluation.

    See more

    Declaration

    Swift

    public protocol EvalEnv
  • Hosts the associated types Param amd Result which are needed throughout the grammar specification.

    See more

    Declaration

    Swift

    public protocol GrammarComponent
  • A Lexer manages the custom parsing of terminals.

    Given a position in some input, and a given terminal with given associated input parameter, the lexer returns a set of tokens.

    Note

    Terminals can not only be parsed via the lexer, but also via rules, therefore enabling scannerless parsing. In those cases the returned set of tokens will typically be empty, but does not have to be, thus making it possible to mix scannerless and scannerful parsing of terminals. Nevertheless, even in a fully scannerless parser, there needs to be one terminal parsed via the lexer, representing a general character.

    Seealso

    Rule
    See more

    Declaration

    Swift

    public protocol Lexer : GrammarComponent
  • A Selector selects a subset of tokens from those tokens which have been successfully parsed at at particular position.

    See more

    Declaration

    Swift

    public protocol Selector : GrammarComponent