SPLASH 2019
Sun 20 - Fri 25 October 2019 Athens, Greece
Thu 24 Oct 2019 15:00 - 15:30 at Room 1 - DSLs and Parsing Chair(s): Eric Van Wyk

We present a novel approach to context-free grammar parsing that is
based on generating a sequence of grammars called \emph{derivative grammars}
from a given context-free grammar and input string. The generation of the derivative grammars is described by a few simple inference rules. We present an $O(n^2)$ space and $O(n^3)$ time recognition algorithm, which can be extended to generate parse trees in $O(n^3)$ time and $O(n^2\log{n})$ space. Derivative grammars can be viewed as a \emph{symbolic} approach to implementing the notion of \emph{derivative languages}, which was introduced by Brzozowski.

Might and others have explored an \emph{operational} approach to implementing derivative languages in which the context-free grammar is encoded as a collection of recursive algebraic data types in a functional language like Haskell. Functional language implementation features like knot-tying and lazy evaluation are exploited to ensure that parsing is done correctly and efficiently in spite of complications like left-recursion. In contrast, our symbolic approach using inference rules can be implemented easily in any programming language and we obtain better space bounds for parsing.

Reifying derivative languages by encoding them symbolically as grammars also enables formal connections to be made for the first time between the derivatives approach and classical parsing methods like the Earley and LL/LR parsers.
In particular, we show that the sets of Earley items maintained by the Earley parser implicitly encode derivative grammars and we give a procedure for producing derivative grammars from these sets. Conversely, we show that our derivative grammar recognizer can be transformed into the Earley recognizer by optimizing some of its bookkeeping. These results suggest that derivative grammars may provide a new foundation for context-free grammar recognition and parsing.

#### Thu 24 OctDisplayed time zone: Beirut change

 14:00 - 15:30 DSLs and Parsing OOPSLA at Room 1 Chair(s): Eric Van Wyk University of Minnesota, USA 14:0030mTalk Seq: A High-Performance Language for BioinformaticsOOPSLAAriya Shajii MIT, Ibrahim Numanagić MIT, Riyadh Baghdadi MIT, Bonnie Berger MIT, Saman Amarasinghe MIT DOI 14:3030mTalk Generating a Fluent API with Syntax Checking from an LR GrammarOOPSLATetsuro Yamazaki Graduate School of Information Science and Technology, The University of Tokyo, Tomoki Nakamaru Graduate School of Information Science and Technology, The University of Tokyo, Kazuhiro Ichikawa Graduate School of Information Science and Technology, The University of Tokyo, Shigeru Chiba Graduate School of Information Science and Technology, The University of Tokyo DOI 15:0030mTalk Derivative Grammars: A Symbolic Approach to Parsing with DerivativesOOPSLAIan Henriksen The University of Texas at Austin, Gianfranco Bilardi University of Padova, Italy, Keshav Pingali The University of Texas at Austin DOI