...
首页> 外文期刊>Science of Computer Programming >From regexes to parsing expression grammars
【24h】

From regexes to parsing expression grammars

机译:从正则表达式到解析表达式语法

获取原文
获取原文并翻译 | 示例
   

获取外文期刊封面封底 >>

       

摘要

Most scripting languages nowadays use regex pattern-matching libraries. These regex libraries borrow the syntax of regular expressions, but have an informal semantics that is different from the semantics of regular expressions, removing the commutativity of alternation and adding ad-hoc extensions that cannot be expressed by formalisms for efficient recognition of regular languages, such as deterministic finite automata. Parsing expression grammars are a formalism that can describe all deterministic context-free languages and have a simple computational model. In this paper, we present a formalization of regexes via transformation to parsing expression grammars. The proposed transformation easily accommodates several common regex extensions, giving a formal meaning to them. It also provides a clear computational model that helps to estimate the efficiency of regex-based matchers, and a basis for specifying provably correct optimizations for them.
机译:如今,大多数脚本语言都使用正则表达式模式匹配库。这些正则表达式库借用了正则表达式的语法,但具有与正则表达式的语义不同的非正式语义,消除了交替的可交换性,并添加了形式主义无法表达的即席扩展,以有效识别正则语言,例如作为确定性有限自动机。解析表达语法是一种形式主义,可以描述所有确定性的上下文无关语言,并且具有简单的计算模型。在本文中,我们介绍了通过转换为解析表达语法的正则表达式的形式化。提出的转换很容易容纳几个常见的正则表达式扩展,从而为其赋予了正式的含义。它还提供了清晰的计算模型,可帮助估计基于正则表达式的匹配器的效率,并为为它们指定可证明的正确优化奠定了基础。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号