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
下载
关闭预览

相关内容

NeurlPS 2022 | 自然语言处理相关论文分类整理
专知会员服务
50+阅读 · 2022年10月2日
专知会员服务
44+阅读 · 2020年12月18日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
104+阅读 · 2019年10月9日
Flutter 组件集录: AppBar 的使用 | 开发者说·DTalk
谷歌开发者
0+阅读 · 2022年11月11日
Flutter 组件: Autocomplete 自动填充 | 开发者说·DTalk
谷歌开发者
0+阅读 · 2022年10月28日
Sreg 一款社工小工具
黑白之道
12+阅读 · 2019年8月18日
吐血整理!140种Python标准库、第三方库和外部工具都有了
炼数成金订阅号
14+阅读 · 2019年7月30日
Hierarchically Structured Meta-learning
CreateAMind
26+阅读 · 2019年5月22日
R工程化—Rest API 之plumber包
R语言中文社区
11+阅读 · 2018年12月25日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
17+阅读 · 2018年12月24日
在Python中使用SpaCy进行文本分类
专知
24+阅读 · 2018年5月8日
Capsule Networks解析
机器学习研究会
11+阅读 · 2017年11月12日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2013年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
1+阅读 · 2008年12月31日
Arxiv
0+阅读 · 2023年5月26日
Arxiv
19+阅读 · 2018年10月25日
VIP会员
相关资讯
Flutter 组件集录: AppBar 的使用 | 开发者说·DTalk
谷歌开发者
0+阅读 · 2022年11月11日
Flutter 组件: Autocomplete 自动填充 | 开发者说·DTalk
谷歌开发者
0+阅读 · 2022年10月28日
Sreg 一款社工小工具
黑白之道
12+阅读 · 2019年8月18日
吐血整理!140种Python标准库、第三方库和外部工具都有了
炼数成金订阅号
14+阅读 · 2019年7月30日
Hierarchically Structured Meta-learning
CreateAMind
26+阅读 · 2019年5月22日
R工程化—Rest API 之plumber包
R语言中文社区
11+阅读 · 2018年12月25日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
17+阅读 · 2018年12月24日
在Python中使用SpaCy进行文本分类
专知
24+阅读 · 2018年5月8日
Capsule Networks解析
机器学习研究会
11+阅读 · 2017年11月12日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2013年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
1+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员