Reference. LL(*): the foundation of the ANTLR parser generator

Cite

Cite as @parr-2011-ll (helia, typst) · \cite{parr-2011-ll} (LaTeX)
BibTeX
bibtex · 1 line
@inproceedings{parr-2011-ll, series={PLDI ’11}, title={LL(*): the foundation of the ANTLR parser generator}, url={http://dx.doi.org/10.1145/1993498.1993548}, DOI={10.1145/1993498.1993548}, booktitle={Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation}, publisher={ACM}, author={Parr, Terence and Fisher, Kathleen}, year={2011}, month=June, pages={425–436}, collection={PLDI ’11} }
hayagriva YAML (typst)
yaml · 14 lines
parr-2011-ll:
  type: article
  title: 'LL(*): the foundation of the ANTLR parser generator'
  author:
  - Parr, Terence
  - Fisher, Kathleen
  date: 2011-06
  page-range: 425-436
  serial-number:
    doi: 10.1145/1993498.1993548
  parent:
    type: proceedings
    title: Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation
    publisher: ACM
Cited by (4)

CoStar: A verified ALL(*) parser lasserCoStarVerifiedALL2021

Parsers are security-critical components of many software systems, and verified parsing therefore has a key role to play in secure software design. However, existing verified parsers for context-free grammars are limited in their expressiveness, termination properties, or performance characteristics. They are only compatible with a restricted class of grammars, they are not guaranteed to terminate on all inputs, or they are not designed to be performant on grammars for real-world programming languages and data formats. In this work, we present CoStar, a verified parser that addresses these limitations. The parser is implemented with the Coq Proof Assistant and is based on the ALL(*) parsing algorithm. CoStar is sound and complete for all non-left-recursive grammars; it produces a correct parse tree for its input whenever such a tree exists, and it correctly detects ambiguous inputs. CoStar also provides strong termination guarantees; it terminates without error on all inputs when applied to a non-left-recursive grammar. Finally, CoStar achieves linear-time performance on a range of unambiguous grammars for commonly used languages and data formats.
PDF · DOI · pldb

Zippy LL(1) parsing with derivatives EdelmannZippy2020

In this paper, we present an efficient, functional, and formally verified parsing algorithm for LL(1) context-free expressions based on the concept of derivatives of formal languages. Parsing with derivatives is an elegant parsing technique, which, in the general case, suffers from cubic worst-case time complexity and slow performance in practice. We specialise the parsing with derivatives algorithm to LL(1) context-free expressions, where alternatives can be chosen given a single token of lookahead. We formalise the notion of LL(1) expressions and show how to efficiently check the LL(1) property. Next, we present a novel linear-time parsing with derivatives algorithm for LL(1) expressions operating on a zipper-inspired data structure. We prove the algorithm correct in Coq and present an implementation as a part of Scallion, a parser combinators framework in Scala with enumeration and pretty printing capabilities.
DOI · pldb

A Verified LL(1) Parser Generator lasserLL1_2019

An LL(1) parser is a recursive descent algorithm that uses a single token of lookahead to build a grammatical derivation for an input sequence. We present an LL(1) parser generator that, when applied to grammar G, produces an LL(1) parser for G if such a parser exists. We use the Coq Proof Assistant to verify that the generator and the parsers that it produces are sound and complete, and that they terminate on all inputs without using fuel parameters. As a case study, we extract the tool’s source code and use it to generate a JSON parser. The generated parser runs in linear time; it is two to four times slower than an unverified parser for the same grammar.

Predecessor to CoStar and CoStar++.

DOI

Adaptive LL(*) parsing: the power of dynamic analysis parr-2014-adaptive

PDF · DOI · pldb
Cites 18 works (1 here)
With notes (1)

An efficient context-free parsing algorithm Earley1970

A parsing algorithm which seems to be the most efficient general context-free algorithm known is described. It is similar to both Knuth’s LR(k) algorithm and the familiar top-down algorithm. It has a time bound proportional to n3 (where n is the length of the string being parsed) in general; it has an n2 bound for unambiguous grammars; and it runs in linear time on a large class of grammars, which seems to include most practical context-free programming language grammars. In an empirical comparison it appears to be superior to the top-down and bottom-up algorithms studied by Griffiths and Petrick.
DOI
parr-2011-ll reference entries/refs/parr-2011-ll/parr-2011-ll.hel