arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1704.08820cs.FL
收藏

使用语法和正则表达式的流处理

Stream Processing using Grammars and Regular Expressions

Ulrik Terp Rasmussen

摘要:

在这篇论文中,我们研究正则表达式为基础的分析和使用语法规范的合成快速,流字符串处理程序。在第一部分中,我们开发了两个线性时间算法的正则表达式为基础的分析与Perl风格的贪婪消歧。第一种算法以半流的方式在两个通道中操作,使用恒定量的工作存储器和辅助磁带存储器,该辅助磁带存储器在第一通道中写入并由第二通道消耗。第二个算法是一个单通道和最佳流算法,输出尽可能多的解析树是语义上可能的基础上读取到目前为止的输入前缀,并采取缓冲尽可能多的符号,因为是需要解决下一个选择。通过对正则表达式执行PSPACE完全预分析来获得最优性。在第二部分中,我们提出了Kleenex,一种语言,用于表达高性能的流字符串处理程序作为常规语法与嵌入式语义动作,其编译流字符串转换器与最坏情况下的线性时间性能。它的基本理论是基于转换器分解成预言机和动作机,以及第一部分中提出的流解析算法的有限状态专门化。在第二部分中,我们还开发了一个新的线性时间流解析算法解析表达式语法(PEG),它推广了规则的语法的Kleenex。该算法是基于一个自下而上的制表算法重新制定使用最少的不动点和评估使用一个实例的混乱的迭代计划Cousot和Cousot。

英文摘要:

In this dissertation we study regular expression based parsing and the use of grammatical specifications for the synthesis of fast, streaming string-processing programs. In the first part we develop two linear-time algorithms for regular expression based parsing with Perl-style greedy disambiguation. The first algorithm operates in two passes in a semi-streaming fashion, using a constant amount of working memory and an auxiliary tape storage which is written in the first pass and consumed by the second. The second algorithm is a single-pass and optimally streaming algorithm which outputs as much of the parse tree as is semantically possible based on the input prefix read so far, and resorts to buffering as many symbols as is required to resolve the next choice. Optimality is obtained by performing a PSPACE-complete pre-analysis on the regular expression. In the second part we present Kleenex, a language for expressing high-performance streaming string processing programs as regular grammars with embedded semantic actions, and its compilation to streaming string transducers with worst-case linear-time performance. Its underlying theory is based on transducer decomposition into oracle and action machines, and a finite-state specialization of the streaming parsing algorithm presented in the first part. In the second part we also develop a new linear-time streaming parsing algorithm for parsing expression grammars (PEG) which generalizes the regular grammars of Kleenex. The algorithm is based on a bottom-up tabulation algorithm reformulated using least fixed points and evaluated using an instance of the chaotic iteration scheme by Cousot and Cousot.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑