Skip to content

tayloraswift/swift-grammar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grammar

Tests Documentation

High-performance constructive parsing, in pure Swift. This module powers the swift-json library!

Importing this module will expose the following top-level symbols:

  • enum Pattern

  • enum UnicodeDigit

  • enum UnicodeEncoding

  • protocol TraceableError

  • protocol TraceableErrorRoot

  • struct ParsingError<Index>

  • struct ParsingInput<Diagnostics>

  • struct NoDiagnostics<Source>

  • struct DefaultDiagnostics<Source>

  • protocol ParsingDiagnostics

  • protocol ParsingRule

  • protocol TerminalRule

  • protocol LiteralRule

  • protocol DigitRule

  • protocol ASCIITerminal

  • protocol UTF8Terminal

  • protocol UTF16Terminal

  • protocol UnicodeTerminal

  • protocol CharacterTerminal

adding swift-grammar as a dependency

To use swift-grammar in a project, add the following to your Package.swift file:

let package = Package(
    ...
    dependencies: [
        // other dependencies
        .package(url: "https://github.com/tayloraswift/swift-grammar", from: "0.4.0"),
    ],
    targets: [
        .target(name: "example",
            dependencies: [
                .product(name: "Grammar", package: "swift-grammar"),
                // other dependencies
            ]),
        // other targets
    ]
)

Requirements

The swift-grammar library requires Swift 5.8 or later.

Platform Status
🐧 Linux Tests
🍏 Darwin Tests
🍏 Darwin (iOS) iOS
🍏 Darwin (tvOS) tvOS
🍏 Darwin (visionOS) visionOS
🍏 Darwin (watchOS) watchOS