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

线性解析表达式文法

Linear Parsing Expression Grammars

Nariyoshi Chida, Kimio Kuramitsu

摘要:

PEG在2004年由Ford正式化,并且具有几个实用的操作符(例如有序选择和无限前瞻),以更好地表达现代程序设计语言语法。由于这些算子在经典的形式语言理论中没有明确的定义,因此在形式语言理论的背景下讨论PEG的表达性是很有意义的,也是很有挑战性的。这使得一些技术的应用,从理论的正规文法PEG。在本文中,我们定义了线性PEG(LPEG),它是等同于DFA的PEG的一个子类。令人惊讶的是,LPEG的形式化,只排除了一些模式的递归非终结符的PEG,并包括完整的有序选择,无限的前瞻性,和贪婪的重复,这是PEG的特点。虽然解析表达式到DFA的转换判断一般是不可判定的,但LPEG的形式主义允许解析表达式的语法判断。

英文摘要:

PEGs were formalized by Ford in 2004, and have several pragmatic operators (such as ordered choice and unlimited lookahead) for better expressing modern programming language syntax. Since these operators are not explicitly defined in the classic formal language theory, it is significant and still challenging to argue PEGs' expressiveness in the context of formal language theory.Since PEGs are relatively new, there are several unsolved problems.One of the problems is revealing a subclass of PEGs that is equivalent to DFAs. This allows application of some techniques from the theory of regular grammar to PEGs. In this paper, we define Linear PEGs (LPEGs), a subclass of PEGs that is equivalent to DFAs. Surprisingly, LPEGs are formalized by only excluding some patterns of recursive nonterminal in PEGs, and include the full set of ordered choice, unlimited lookahead, and greedy repetition, which are characteristic of PEGs. Although the conversion judgement of parsing expressions into DFAs is undecidable in general, the formalism of LPEGs allows for a syntactical judgement of parsing expressions.

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

↑