...
【24h】

A construction method for non-left-recursive parsing expression grammars

机译:非左递归解析表达式语法的构造方法

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

摘要

Parsing expression grammars (PEGs) have recently been used to describe the syntax of artificial languages such as programming languages. Although PEGs look similar to context-free grammars (CFGs), all PEGs have linear-time parsers, and cannot express ambiguous grammars unlike CFGs. From a theoretical point of view, it is undecidable whether a PEG is left-recursive or not. But it has been an open problem whether there is an equivalent non-left-recursive PEG for every PEG. We propose a method which constructs an equivalent non-left-recursive PEG G' from an arbitrary PEG G. And we prove that this method is valid. The PEG G' detects left-recursion by memorizing the history of applied rules in G in nonterminals.
机译:解析表达语法(PEG)最近已用于描述人工语言(例如编程语言)的语法。尽管PEG看起来与上下文无关文法(CFG)相似,但所有PEG都具有线性时间解析器,并且与CFG不同,它们无法表达歧义文法。从理论上讲,PEG是否为左递归是不确定的。但是对于每个PEG是否存在等效的非左递归PEG一直是一个未解决的问题。我们提出了一种从任意PEG G构造等效的非左递归PEG G'的方法。并且证明了该方法是有效的。 PEG G'通过在非末端存储G中应用规则的历史来检测左递归。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号