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.


翻译:文件格式规定了数据如何编码以进行持久存储。由于文件格式的规范包含上下文相关的模式(如随机访问模式和类型-长度-值模式),因此无法将其形式化为上下文无关文法。本文提出了一种新的文法机制——区间解析文法(Interval Parsing Grammars, IPGs),用于文件格式的规范。IPG为每个非终结符/终结符附加一个区间,该区间指定了该非终结符/终结符所消耗的输入范围。通过连接区间与属性,文件格式中的上下文相关模式能够得到妥善处理。本文形式化了IPG的语法及其语义,其语义自然地引出一个解析器生成器,该生成器可根据IPG生成递归下降解析器。总体上,IPG具有声明性、模块化特性,并支持终止性检查。我们已使用IPG规范了多种文件格式,包括ZIP、ELF、GIF、PE以及部分PDF格式,并对所生成解析器的性能进行了评估。

0
下载
关闭预览

相关内容

NeurlPS 2022 | 自然语言处理相关论文分类整理
专知会员服务
51+阅读 · 2022年10月2日
专知会员服务
26+阅读 · 2021年4月2日
Python图像处理,366页pdf,Image Operators Image Processing in Python
【新书】Java企业微服务,Enterprise Java Microservices,272页pdf
【干货】用BRET进行多标签文本分类(附代码)
专知会员服务
85+阅读 · 2019年12月27日
ExBert — 可视化分析Transformer学到的表示
专知会员服务
32+阅读 · 2019年10月16日
Java8 Lambda实现源码解析
阿里技术
2+阅读 · 2022年11月22日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
一文读懂依存句法分析
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日
命名实体识别从数据集到算法实现
专知
56+阅读 · 2018年6月28日
上百份文字的检测与识别资源,包含数据集、code和paper
数据挖掘入门与实战
17+阅读 · 2017年12月7日
【推荐】RNN/LSTM时序预测
机器学习研究会
25+阅读 · 2017年9月8日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
1+阅读 · 2008年12月31日
国家自然科学基金
1+阅读 · 2008年12月31日
国家自然科学基金
0+阅读 · 2008年12月31日
Arxiv
0+阅读 · 2023年6月4日
Arxiv
1+阅读 · 2023年6月2日
Arxiv
0+阅读 · 2023年6月2日
Arxiv
12+阅读 · 2021年11月1日
VIP会员
最新内容
《基于强化学习的自动化红队测试》
专知会员服务
3+阅读 · 7月23日
伊朗不对称防空战略的演进
专知会员服务
4+阅读 · 7月23日
对抗环境下超视距目标打击的情报支援
专知会员服务
10+阅读 · 7月22日
《无人机对海面作战影响评估》
专知会员服务
15+阅读 · 7月21日
印度精确打击与指挥架构的断层
专知会员服务
7+阅读 · 7月20日
相关资讯
Java8 Lambda实现源码解析
阿里技术
2+阅读 · 2022年11月22日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
一文读懂依存句法分析
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日
命名实体识别从数据集到算法实现
专知
56+阅读 · 2018年6月28日
上百份文字的检测与识别资源,包含数据集、code和paper
数据挖掘入门与实战
17+阅读 · 2017年12月7日
【推荐】RNN/LSTM时序预测
机器学习研究会
25+阅读 · 2017年9月8日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
1+阅读 · 2008年12月31日
国家自然科学基金
1+阅读 · 2008年12月31日
国家自然科学基金
0+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员