An open API service indexing awesome lists of open source software.

https://github.com/epfl-lara/scallion

LL(1) parser combinators in Scala
https://github.com/epfl-lara/scallion

ll1 ll1-grammar ll1-parser parser parser-combinators parsing parsing-combinators pretty-print pretty-printer scala

Last synced: 1 day ago
JSON representation

LL(1) parser combinators in Scala

Awesome Lists containing this project

README

          

[![Compile and run sbt test](https://github.com/epfl-lara/scallion/actions/workflows/CI.yml/badge.svg)](https://github.com/epfl-lara/scallion/actions/workflows/CI.yml)


SCALL1ON

# Overview

Scallion is a library for writing parsers and pretty printers for LL(1) languages in Scala.

# Documentation

A comprehensive Scaladoc API is [available online](https://epfl-lara.github.io/scallion/).

# Parsing Algorithm

Scallion uses a novel parsing algorithm that we have described in the PLDI'20 paper: [Zippy LL(1) Parsing with Derivatives](paper/PLDI20_ZippyLL1PWD.pdf).
The algorithm has been [formally proven correct in Coq](https://github.com/epfl-lara/scallion-proofs/).

# Examples

* [JSON](example/json/JSON.scala): This example showcases how to build a basic JSON parser using Scallion.
* [Lambda Calculus](example/lambda/Lambda.scala): This example shows how to get a pretty printer *almost for free* alongside your parser.
* [Calculator](example/calculator/Calculator.scala): This example shows how to use the `operators` combinator to easily handle operators with various associativities and priorities.
* [Roman Numerals](example/roman/Roman.scala): This example presents a simple parser and pretty printer for roman numerals.