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
- Host: GitHub
- URL: https://github.com/epfl-lara/scallion
- Owner: epfl-lara
- License: apache-2.0
- Created: 2019-05-24T20:22:52.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-09-02T08:43:03.000Z (5 months ago)
- Last Synced: 2025-09-02T09:31:47.693Z (5 months ago)
- Topics: ll1, ll1-grammar, ll1-parser, parser, parser-combinators, parsing, parsing-combinators, pretty-print, pretty-printer, scala
- Language: Scala
- Size: 10.2 MB
- Stars: 60
- Watchers: 11
- Forks: 15
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/epfl-lara/scallion/actions/workflows/CI.yml)
# 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.