Structures
The following structures are available globally.
-
HomogenousTree is used as the default form of AbstractSyntaxTree. Each node in the tree captures its
See moreTokenType
, theString
it mtached, and any children.Declaration
Swift
public struct HomogenousTree : AbstractSyntaxTree, CustomStringConvertible
-
A standard decoder that can use any supplied
Parser
to decodeData
into aDecodable
conforming type.do{ let command : Command = try ParsingDecoder().decode(Command.self, from: userInput.data(using: .utf8) ?? Data(), with: Bork.generatedLanguage) ... } catch { print("Something went wrong: \(error.localizedDescription)") }
The names of the
See moreToken
s generated by the suppliedParser
are used as keys into theDecodable
type being populated.Declaration
Swift
public struct ParsingDecoder
-
Represents the type of processing error.
See moreDeclaration
Swift
public struct ProcessingErrorType : OptionSet
-
See moreBehaviour
represents a complete description of the required behaviour of any given rule. This includes behaviours such as lookahead, negation, and cardinality. As well the scanning/parsing behaviour indicating whether or not the rule should create tokens (structural), is scanning (should be included in the match range, but creates no token) or skipping (must be matched, but is not included in the bounds of the match range).Declaration
Swift
public struct Behaviour
-
Represents the cardinality of a rule. It can be specified as a closed range, including those with no upper bound (
See morePartialRangeFrom
)Declaration
Swift
public struct Cardinality : Equatable