ProtocolGrammar
ParsingRule
A structured parsing rule.
protocol ParsingRule<Terminal>
A structured parsing rule.
protocol ParsingRule<Terminal>
associatedtype Construction
The type of the constructions produced by a successful application of this parsing rule.
associatedtype Location
The index type of the ParsingInput.source
this rule expects.
associatedtype Terminal
The element type of the ParsingInput.source
this rule expects.
static func parse<Diagnostics>(inout ParsingInput<Diagnostics>) throws -> Self.Construction
Attempts to parse an instance of Construction
from the given parsing input.
static func parse<Source>(Source) throws -> Self.Construction
Attempts to parse the given input completely.
static func parse<Source, Vector>(Source, into: Vector.Type) throws -> Vector
Attempts to parse the given input completely by applying this rule repeatedly.
static func parse<Source>(diagnosing: Source) throws -> Self.Construction
Attempts to parse the given input completely, emitting diagnostics if parsing failed.