Pure Swift 2.0 S-expression Parser

Related tags

Text SwiftExP
Overview

SwiftExP

License: MIT

This is an S-expression parser written in pure Swift 2.0, where pure means without making any necessary usage of Foundation APIs at its core. This means: neither NSScanner, nor NSRegularExpression, nor NSCharacterSet, not even NSString.

S-expressions is a notation format for nested list data on which Lisp languages are based.

Architectural / Paradigm Considerations

While S-expressions have a very simple base syntax and there are appealing approaches on using a functional-compositional style to implement a parser in general in Swift, this implementation goes a different way. It is imperative and makes intense usage of Swift specific features, in particular Optionals, the try/throw/do-catch error handling and mutating functions on value types.

The top-down Parser operates without prior Lexing directly on the String through Scanner, which is a minimalistic attempt to wrap access on a Character-oriented basis. The current state is given at any time through the call-stack, which also means that the implementation is heavily based on recursion.

You might also like...
Croc is a swift emoji string parsing library
Croc is a swift emoji string parsing library

Croc is a library for parsing emojis on iOS. It provides a simple and lightweight interface for detecting, generating, categorizing and managing emoji characters, making emoji-powered features an easy task for developers.

Fully open source text editor for iOS written in Swift.
Fully open source text editor for iOS written in Swift.

Edhita Fully open source text editor for iOS written in Swift. http://edhita.bornneet.com/ What Edhita means? Edhita (Romaji) == エディタ (Katakana) == Ed

Great Swift String Pluralize Extension

Pluralize.swift Great Swift String Pluralize Extension case-insensitive tons of rules for irregular nouns (plural form) supports uncountable nouns all

An NSPredicate DSL for iOS, OSX, tvOS, & watchOS. Inspired by SnapKit and lovingly written in Swift.
An NSPredicate DSL for iOS, OSX, tvOS, & watchOS. Inspired by SnapKit and lovingly written in Swift.

PrediKit A Swift NSPredicate DSL for iOS & OS X inspired by SnapKit, lovingly written in Swift, and created by that weird dude at KrakenDev. If you're

PySwiftyRegex - Easily deal with Regex in Swift in a Pythonic way

PySwiftyRegex Easily deal with Regex in Swift in a Pythonic way.

Regular expressions for swift
Regular expressions for swift

Regex Advanced regular expressions for Swift Goals Regex library was mainly introduced to fulfill the needs of Swift Express - web application server

👩‍🎨 Elegant Attributed String composition in Swift sauce
👩‍🎨 Elegant Attributed String composition in Swift sauce

Elegant Attributed String composition in Swift sauce SwiftRichString is a lightweight library which allows to create and manipulate attributed strings

SwiftVerbalExpressions is a Swift library that helps to construct difficult regular expressions

SwiftVerbalExpressions Swift Regular Expressions made easy SwiftVerbalExpressions is a Swift library that helps to construct difficult regular express

A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.
A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.

PhoneNumberKit Swift 5.3 framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber. Features F

Owner
Marius Rackwitz
Cofounder @nlbb, Developer, Swift Pioneer @CocoaPods Core team, Conference Speaker. Email me to: contact@$firstName$lastName.de
Marius Rackwitz
A simple and customizable Markdown Parser for Swift

MarkdownKit MarkdownKit is a customizable and extensible Markdown parser for iOS and macOS. It supports many of the standard Markdown elements through

Bruno Oliveira 687 Dec 18, 2022
Marky Mark is a parser written in Swift that converts markdown into native views.

Marky Mark is a parser written in Swift that converts markdown into native views. The way it looks it highly customizable and the supported markdown syntax is easy to extend.

M2mobi 287 Nov 29, 2022
Swift Parser Combinators

Parsey Swift Parser Combinator Framework In addition to simple combinators, Parsey supports source location/range tracking, backtracking prevention, a

Richard Wei 56 Jun 30, 2022
Leverages Apple's Swift-based Markdown parser to output NSAttributedString.

Markdownosaur ?? Markdownosaur uses Apple's excellent and relatively new Swift Markdown library to analyze a Markdown source, and then takes that anal

Christian Selig 232 Dec 20, 2022
A simple Cron Parser with Swift

A simplified cron parser Requirements Swift 5.5 Command line tools How to Run Cr

null 0 Dec 21, 2021
Markdown parser for iOS

Marky Mark Marky Mark is a parser written in Swift that converts markdown into native views. The way it looks it highly customizable and the supported

M2mobi 254 Jun 11, 2021
More powerful label, attributed string builder and text parser.

DDText More powerful label, attributed string builder and text parser. DDLabel More powerful label than UILabel, using TextKit. It supports features b

Daniel 16 Nov 8, 2022
Markdown parser for iOS

Marky Mark Marky Mark is a parser written in Swift that converts markdown into native views. The way it looks it highly customizable and the supported

M2mobi 262 Nov 23, 2021
A Pure Swift implementation of the markdown mark-up language

SmarkDown A pure Swift markdown implementation consistent with Gruber's 1.0.1 version. It is released under the BSD license so please feel free to use

Swift Studies 67 Jan 24, 2022
BonMot is a Swift attributed string library

BonMot (pronounced Bon Mo, French for good word) is a Swift attributed string library. It abstracts away the complexities of the iOS, macOS, tvOS, and

Rightpoint 3.4k Dec 30, 2022