Translating Regular Expression Matching into Transducers

Translating Regular Expression Matching into Transducers
复制标题

将正则表达式匹配转换为转换器

DOI:
10.1016/j.jal.2011.11.003
复制
发表时间:
2012
影响因子:
--
通讯作者:
Andrei Voronkov
Andrei Voronkov
中科院分区:
--
文献类型:
--
作者:
Yuto Sakuma;Yasuhiko Minamide;Andrei Voronkov

文献摘要

参考文献

被引文献

相似文献

正则表达式匹配是字符串操作程序中的一个重要工具,在脚本语言中起着至关重要的作用。本文重点研究了基于Perl语言的正则表达式匹配技术,实现了正则表达式匹配到转换器的转换。这种表示方法使形式语言理论在字符串操作程序的静态分析和验证中的应用成为可能。我们首先制定了正则表达式匹配的语义作为一个不确定的分析器,通过使用列表和输出单子的组合。然后,我们通过引入lookahead,将非确定性解析器转化为确定性解析器。确定性分析器是制定与选项单子,而不是列表单子,并通过涉及单子方程推理。从确定性解析器的定义,我们可以很容易地通过具有常规前瞻的转换器来构造转换器。我们已经实现了翻译,并在几个流行的PHP程序中发现的正则表达式进行了实验。
Regular expression matching is an essential tool in string manipulating programs and plays crucial roles in scripting languages. We focus on regular expression matching based on the strategy of Perl and develop a translation from regular expression matching into transducers. The representation makes it possible to apply the theory of formal languages in static analysis and verification of string manipulating programs. We first formulate the semantics of regular expression matching as a nondeterministic parser by using the composition of the list and output monads. Then, we transform the nondeterministic parser into deterministic one by introducing lookahead. The deterministic parser is formulated with the option monad instead of the list monad and derived through equational reasoning involving monads. From the definition of the deterministic parser, we can easily construct transducers through transducers with regular lookahead. We have implemented the translation and conducted experiments on regular expressions found in several popular PHP programs.
用于唯一模式匹配的类型推断
DOI: 10.1145/1133651.1133652
发表时间: 2006
期刊: ACM Trans. Program. Lang. Syst.
影响因子: --
作者:
Stijn Vansummeren
通讯作者: Stijn Vansummeren
DOI: 10.1145/321312.321326
发表时间: 1966-01-01
期刊: JOURNAL OF THE ACM
影响因子: 2.5
作者:
SALOMAA, A
通讯作者: SALOMAA, A
使用正则表达式对字符串进行类型化且明确的模式匹配
DOI: 10.1145/1836089.1836120
发表时间: 2010
期刊: --
影响因子: --
作者:
Claus Brabrand;Jakob G. Thomsen
通讯作者: Jakob G. Thomsen
正则表达式的游戏:功能性珍珠
DOI: --
发表时间: 2010
期刊: ACM SIGPLAN International Conference on Functional Programming
影响因子: --
作者:
Sebastian Fischer;F. Huch;T. Wilke
通讯作者: T. Wilke
贪心正则表达式匹配
DOI: 10.1007/978-3-540-27836-8_53
发表时间: 2004
期刊: --
影响因子: --
作者:
Alain Frisch;L. Cardelli
通讯作者: L. Cardelli