2019-06-11
Practical general top-down parsers
Publication
Publication
We propose data-dependent grammars as an abstract intermediate language for implementing various disambiguation constructs without knowledge of a specific parsing technology. As data-dependent grammars are rather low-level, we also provide high-level disambiguation constructs, e.g., for operator precedence and indentation-sensitivity, that desugar to data-dependent grammars. A significant part of this thesis is dedicated to the semantics and implementation of disambiguation rules for operator precedence. We introduce a derivation-based semantics for operator precedence disambiguation that is independent of the underlying parsing technique, and is safe, i.e., does not remove sentences from the language when there is no ambiguity. We propose an implementation of our operator precedence semantics using data-dependent grammars. In the course of this thesis, we have developed Iguana, our GLL-based data-dependent parsing framework. The results of our performance evaluation show that Iguana is practical for parsing real programming languages, and in terms of performance, is comparable to a mature parsing tool such as ANTLR.
Finally, based on Johnson's CPS recognizers, we present general parser combinators that can deal with all context-free grammars and produce an SPPF in cubic time and space. Our general parser combinators have the flexibility and expressiveness of traditional parser combinators, and the performance guarantee of general parsing algorithms. We used our general parser combinators as the basis for Meerkat, a general parser combinator library in Scala.
Additional Metadata | |
---|---|
P. Klint (Paul) , J.J. Vinju (Jurgen) | |
Universiteit van Amsterdam | |
hdl.handle.net/11245.1/7f1bf220-8a2d-45ba-8402-a66f6c18a860 | |
IPA dissertation series | |
Organisation | CWI management |
Afroozeh, A., & Izmaylova, A. (2019, June 11). Practical general top-down parsers. IPA dissertation series. Retrieved from http://hdl.handle.net/11245.1/7f1bf220-8a2d-45ba-8402-a66f6c18a860 |