ParserCombinator 2.1.0

ParserCombinator 2.1.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Sep 2019
SPMSupports SPM

Maintained by Tigerpixel.



  • By
  • Tigerpixel

ParserCombinator

Build Status Version Platform Carthage compatible License

A simple parser combinator, created in Swift.

ParserCombinator attempts to create a simple and user-friendly way to parse strings into objects and structures. Technical terms are largely avoided and convenience parsers are provided.

The parser can be enacted by calling the 'run' function:

myParser.run(on: "String to parse")

The unit tests provide examples of using the parser and creating your own parsing rules.

Pull requests for improvements are welcome.

Requirements

There are no external requirements for this project, just Swift.

  • iOS 8.0+ / macOS 10.9+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 11+
  • Swift 5.1+

For previous versions of Xcode and Swift please see prior releases.

Installation

Swift Package Manager

The Swift Package Manager is the official tool for managing the distribution of Swift code. It is currently available for all Apple platforms. It can also be used with Linux but this project does not fully support Linux at this point in time.

If you use it to manage your dependencies, simply add ParserCombinator to the dependencies value of your Package.swift file.

dependencies: [
    .package(url: "https://github.com/Tigerpixel/ParserCombinator.git", from: "2.1.0")
]

Cocoapods

ParserCombinator is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "ParserCombinator"

Carthage

If you use Carthage to manage your dependencies, simply add the following line to your Cartfile:

github "tigerpixel/ParserCombinator"

If you use Carthage to build your dependencies, make sure you have added ParserCombinator.framework to the "Linked Frameworks and Libraries" section of your target, and have included them in your Carthage framework copying build phase.

Git Submodule

  1. Add the ParserCombinator repository as a submodule of your application’s repository.
  2. Run git submodule update --init --recursive from within the ParserCombinator folder.
  3. Drag and drop ParserCombinator.xcodeproj into your application’s Xcode project or workspace.
  4. On the “General” tab of your application target’s settings, add ParserCombinator.framework. to the “Embedded Binaries” section.
  5. If your application target does not contain Swift code at all, you should also set the EMBEDDED_CONTENT_CONTAINS_SWIFT build setting to “Yes”.

MIT License

ParserCombinator is available under the MIT license. Details can be found within the LICENSE file.