Reference. Adaptive LL(*) parsing: the power of dynamic analysis

Cite

Cite as @parr-2014-adaptive (helia, typst) · \cite{parr-2014-adaptive} (LaTeX)
BibTeX
bibtex · 1 line
@inproceedings{parr-2014-adaptive, series={SPLASH ’14}, title={Adaptive LL(*) parsing: the power of dynamic analysis}, url={http://dx.doi.org/10.1145/2660193.2660202}, DOI={10.1145/2660193.2660202}, booktitle={Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications}, publisher={ACM}, author={Parr, Terence and Harwell, Sam and Fisher, Kathleen}, year={2014}, month=Oct, pages={579–598}, collection={SPLASH ’14} }
hayagriva YAML (typst)
yaml · 19 lines
parr-2014-adaptive:
  type: article
  title: 'Adaptive LL(*) parsing: the power of dynamic analysis'
  author:
  - Parr, Terence
  - Harwell, Sam
  - Fisher, Kathleen
  date: 2014-10
  page-range: 579-598
  url: http://dx.doi.org/10.1145/2660193.2660202
  serial-number:
    doi: 10.1145/2660193.2660202
  parent:
    type: proceedings
    title: Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications
    publisher: ACM
    parent:
      type: proceedings
      title: SPLASH ’14
Cited by (5)

flap: A Deterministic Parser with Fused Lexing yallop-2023-flap

Lexers and parsers are typically defined separately and connected by a token stream. This separate definition is important for modularity and reduces the potential for parsing ambiguity. However, materializing tokens as data structures and case-switching on tokens comes with a cost. We show how to fuse separately-defined lexers and parsers, drastically improving performance without compromising modularity or increasing ambiguity. We propose a deterministic variant of Greibach Normal Form that ensures deterministic parsing with a single token of lookahead and makes fusion strikingly simple, and prove that normalizing context free expressions into the deterministic normal form is semantics-preserving. Our staged parser combinator library, flap, provides a standard interface, but generates specialized token-free code that runs two to six times faster than ocamlyacc on a range of benchmarks.
PDF · DOI · arXiv · pldb

Interval Parsing Grammars for File Format Parsing zhangIntervalParsingGrammars2023

File formats specify how data is encoded for persistent storage. They cannot be formalized as context-free grammars since their specifications include context-sensitive patterns such as the random access pattern and the type-length-value pattern. We propose a new grammar mechanism called Interval Parsing Grammars IPGs) for file format specifications. An IPG attaches to every nonterminal/terminal an interval, which specifies the range of input the nonterminal/terminal consumes. By connecting intervals and attributes, the context-sensitive patterns in file formats can be well handled. In this paper, we formalize IPGs’ syntax as well as its semantics, and its semantics naturally leads to a parser generator that generates a recursive-descent parser from an IPG. In general, IPGs are declarative, modular, and enable termination checking. We have used IPGs to specify a number of file formats including ZIP, ELF, GIF, PE, and part of PDF; we have also evaluated the performance of the generated parsers.
PDF · DOI · pldb

Verified ALL(*) Parsing with Semantic Actions and Dynamic Input Validation lasserCoStar2023

Follow up to CoStar.

DOI

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

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
Cites 25 works (2 here)
With notes (2)

LL(*): the foundation of the ANTLR parser generator parr-2011-ll

PDF · DOI · pldb

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-2014-adaptive reference entries/refs/parr-2014-adaptive/parr-2014-adaptive.hel