antlr-haskell: A Haskell implementation of the ANTLR top-down parser generator

[ bsd3, library ] [ Propose Tags ] [ Report a vulnerability ]

Modules

[Index]

  • Language
    • Language.ANTLR4
      • Boot
        • Language.ANTLR4.Boot.Quote
        • Language.ANTLR4.Boot.Syntax
      • Language.ANTLR4.FileOpener
      • Language.ANTLR4.G4
      • Language.ANTLR4.Syntax
  • Text
    • ANTLR
      • Text.ANTLR.Allstar
        • Text.ANTLR.Allstar.ATN
        • Text.ANTLR.Allstar.ParserGenerator
        • Text.ANTLR.Allstar.Stacks
      • Text.ANTLR.Grammar
      • Text.ANTLR.LL1
      • Text.ANTLR.LR
      • Text.ANTLR.Lex
        • Text.ANTLR.Lex.Automata
        • Text.ANTLR.Lex.DFA
        • Text.ANTLR.Lex.NFA
        • Text.ANTLR.Lex.Regex
        • Text.ANTLR.Lex.Tokenizer
      • Text.ANTLR.MultiMap
      • Text.ANTLR.Parser
      • Text.ANTLR.Pretty
      • Text.ANTLR.Set

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.0.1
Change log ChangeLog.md
Dependencies base (>=4.11 && <5), containers (>=0.6 && <0.7), deepseq (>=1.4 && <1.5), hashable (>=1.2 && <1.4), haskell-src-meta (>=0.8 && <0.9), mtl (>=2.2 && <2.3), template-haskell (>=2.14 && <2.16), text (>=1.2 && <1.3), th-lift (>=0.7.11 && <0.9), transformers (>=0.5 && <0.6), unordered-containers (>=0.2 && <0.3) [details]
License BSD-3-Clause
Copyright MIT
Author Karl Cronburg & Matthew Ahrens
Maintainer karl@cs.tufts.edu
Category Library
Home page https://github.com/cronburg/antlr-haskell#readme
Bug tracker https://github.com/cronburg/antlr-haskell/issues
Source repo head: git clone https://github.com/cronburg/antlr-haskell
Uploaded by KarlCronburg at 2020-09-25T04:36:06Z
Distributions
Downloads 967 total (2 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for antlr-haskell-0.1.0.1

[back to package description]

antlr-haskell

A Haskell implementation of ANTLR.

In implementing ANTLR we referenced the behavior of the original Java version (ANTLR4): The definitive ANTLR4 Reference. However we have taken much liberty in the design of this library compared to the workflow of the original Java version. In particular in implementing ANTLR for Haskell we have followed the following principles:

  • Parsing backends should be interchangeable
    • GLR, LR, SLR, LL, ALL(*)
  • Code should be first class and declarative
    • The implementation of G4 is metacircular
    • Regular expressions are interpreted
  • Implement algorithms from first principles
    • Set notation is used in implementing LL and LR algorithms.
    • Pure functional implementations of parsing algorithms can eventually support embedding of arbitrary (including IO) actions without breaking the predictive parsing abstraction.

More info can be found here: [https://www.cronburg.com/2018/antlr-haskell-project/](https://www.cronburg.com/2018/antlr-haskell-project/)

Build instructions

The library can be built with:

stack build # stack version 2.3.3
stack test :simple

Or with cabal-3.0.1.0 like:

cabal configure
cabal install --only-dependencies --enable-tests
cabal build
cabal test sexpression

Here's a good one to run when making changes to the library, and you're unsure of what may become affected by those changes:

stack test :simple :atn :ll :lr :sexpression :allstar :c

And then compare the results with that of this upstream branch. Some of the GLR features (incremental and partial tokenization, notably) are still experimental, and so there are known test cases which currently fail.

Version History

  • September 25th, 2020. Released version 0.1.0.1: bug fixes, documentation, and library versioning updates.