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.


翻译:文件格式指定了数据加密的方式以用于持久化存储。它们不能被形式化为上下文自由文法,因为它们的规范包括上下文相关模式,例如随机访问模式和类型长度值模式。我们提出了一种称为区间语法分析器(IPG)的新型语法机制来处理文件格式规范。IPG会为每个非终端符/终端符附加一个区间,其中详细说明了该非终端符/终端符消耗的输入范围。通过连接区间和属性,可以很好地处理文件格式中的上下文相关模式。在本文中,我们将IPG的语法及语义形式正式化,其语义自然导致一个解析器生成器,它能够从IPG生成一个递归下降解析器。总体而言,IPG是声明式、模块化的并且能够实现终止检查。我们已经使用IPG指定了许多文件格式,包括ZIP、ELF、GIF、PE和部分PDF;我们还评估了生成的解析器的性能。

0
下载
关闭预览

相关内容

Python图像处理,366页pdf,Image Operators Image Processing in Python
ExBert — 可视化分析Transformer学到的表示
专知会员服务
32+阅读 · 2019年10月16日
一文读懂依存句法分析
AINLP
16+阅读 · 2019年4月28日
基于PyTorch/TorchText的自然语言处理库
专知
28+阅读 · 2019年4月22日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
【推荐】RNN/LSTM时序预测
机器学习研究会
25+阅读 · 2017年9月8日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
1+阅读 · 2008年12月31日
国家自然科学基金
0+阅读 · 2008年12月31日
Arxiv
0+阅读 · 2023年6月4日
Arxiv
0+阅读 · 2023年6月2日
VIP会员
相关资讯
一文读懂依存句法分析
AINLP
16+阅读 · 2019年4月28日
基于PyTorch/TorchText的自然语言处理库
专知
28+阅读 · 2019年4月22日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
【推荐】RNN/LSTM时序预测
机器学习研究会
25+阅读 · 2017年9月8日
相关基金
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
1+阅读 · 2008年12月31日
国家自然科学基金
0+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员