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
ConstructResultDeclaration
Swift
public protocol CompletedRightHandSide : GrammarComponent
-
A
See moreConstructResult
is a specification for how to compute the result of a successful parse.Declaration
Swift
public protocol ConstructResult : GrammarComponent
-
Hosts the associated types
See moreParam
amdResult
which are needed throughout the grammar specification.Declaration
Swift
public protocol GrammarComponent
-
A
Lexer
manages the custom parsing of terminals.Given a
position
in someinput
, 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
Declaration
Swift
public protocol Lexer : GrammarComponent
-
A
See moreSelector
selects a subset of tokens from those tokens which have been successfully parsed at at particular position.Declaration
Swift
public protocol Selector : GrammarComponent