Reference. Interval Parsing Grammars for File Format Parsing

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.

Cite

Cite as @zhangIntervalParsingGrammars2023 (helia, typst) · \cite{zhangIntervalParsingGrammars2023} (LaTeX)
BibTeX
bibtex · 16 lines
@article{zhangIntervalParsingGrammars2023,
 title = {Interval {Parsing} {Grammars} for {File} {Format} {Parsing}},
 author = {Zhang, Jialun and Morrisett, Greg and Tan, Gang},
 year = {2023},
 doi = {10.1145/3591264},
 url = {https://dl.acm.org/doi/10.1145/3591264},
 urldate = {2024-04-29},
 journal = {Proceedings of the ACM on Programming Languages},
 volume = {7},
 number = {PLDI},
 pages = {1073--1095},
 month = {June},
 language = {en},
 abstract = {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.},
 issn = {2475-1421}
}
hayagriva YAML (typst)
yaml · 21 lines
zhangIntervalParsingGrammars2023:
  type: article
  title: Interval {Parsing} {Grammars} for {File} {Format} {Parsing}
  author:
  - Zhang, Jialun
  - Morrisett, Greg
  - Tan, Gang
  date: 2023-06
  page-range: 1073-1095
  url:
    value: https://dl.acm.org/doi/10.1145/3591264
    date: 2024-04-29
  serial-number:
    doi: 10.1145/3591264
    issn: 2475-1421
  abstract: 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.
  parent:
    type: periodical
    title: Proceedings of the ACM on Programming Languages
    issue: PLDI
    volume: 7
Cites 24 works (3 here)
With notes (3)

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

PDF · DOI · pldb

The next 700 data description languages fisher-2006-the

PDF · DOI · pldb

PADS: a domain-specific language for processing ad hoc data fisher-2005-pads

PDF · DOI · pldb
External (21)
zhangIntervalParsingGrammars2023 reference entries/refs/zhangIntervalParsingGrammars2023/zhangIntervalParsingGrammars2023.hel