├── .gitignore ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.idea/ 3 | /lib/ 4 | /out/ 5 | /pages/ 6 | /kotlinc/ 7 | /bench_deps/ 8 | /.idea/workspace.xml 9 | /.idea/uiDesigner.xml 10 | /local.mk 11 | /java.hprof.txt 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Nicolas LAURENT 2 | All rights reserved. 3 | 4 | The BSD 3-Clause License 5 | 6 | Redistribution and use in source and binary forms, with or without modification, 7 | are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its contributors 17 | may be used to endorse or promote products derived from this software without 18 | specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 24 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 27 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Autumn Parsing Library 2 | 3 | ## Autumn has moved to https://github.com/norswap/autumn 4 | 5 | ## Legacy Versions 6 | 7 | - **v1** - https://github.com/ncellar/autumn_v1 8 | 9 | The initial version of Autumn is an extensible parser-combinator library built 10 | upon the PEG formalism. It was the first general PEG parsing library to support 11 | left recursion with both left- and right-associative interpretations. It also 12 | includes support for precedence and associativity. 13 | 14 | It was the object 15 | of [a paper (Parsing Expression Grammars Made Practical)][SLE2015] at the SLE 16 | (Software Language Engineering) in 2015. 17 | 18 | [SLE2015]: http://norswap.com/pubs/sle2015.pdf 19 | 20 | - **v2** - https://github.com/ncellar/autumn_v2 21 | 22 | v2 is a considerably simplified rewrite of v1 in the Kotlin programming 23 | language. 24 | 25 | It was the object of 26 | [a paper (Taming Context-Sensitive Languages with Principled Stateful Parsing)][SLE2016] at 27 | the SLE (Software Language Engineering) in 2016. 28 | 29 | [SLE2016]: http://norswap.com/pubs/sle2016.pdf 30 | 31 | - **v3** - https://github.com/ncellar/whimsy 32 | 33 | v3 is a rewrite of v2, still in Kotlin. It was part of the Whimsy compiler framework project, whose 34 | other component (a reactive middle-end compiler library) never fuly materialized. 35 | 36 | v3 features two significant changes: first the context-sensitive parsing mechanism now uses a log of 37 | undoable changes instead of relying on state snapshots. Second, the framework uses Kotlin's `inline` 38 | keyword pervasively in order to avoid megamorphic call sites overheads, and enable additional 39 | optimization. This works well in practice, and performance are greatly improved. 40 | 41 | ## Current Version 42 | 43 | - **v4** - https://github.com/norswap/autumn 44 | 45 | The current (and hopefully final major revision) of Autumn. 46 | 47 | This version underpins my 2019 PhD thesis. 48 | 49 | This is a full rewrite in Java. It keeps v3's way of handling the context, but reverts back to using 50 | a graph of parser objects to represent a grammar — the reason being that these graphs can be 51 | traversed by walkers and visitors to achieve all kind of things. 52 | 53 | It adds many many useful features, and performance are on par with v3 despite the lack of inlining. 54 | The best Autumn has to offer! 55 | 56 | --------------------------------------------------------------------------------