解析表达式语法的计算模型

Alexander Rubtsov, Nikita Chudinov
{"title":"解析表达式语法的计算模型","authors":"Alexander Rubtsov, Nikita Chudinov","doi":"arxiv-2406.14911","DOIUrl":null,"url":null,"abstract":"We present a computational model for Parsing Expression Grammars (PEGs). The\npredecessor of PEGs top-down parsing languages (TDPLs) were discovered by A.\nBirman and J. Ullman in the 1960-s, B. Ford showed in 2004 that both formalisms\nrecognize the same class named Parsing Expression Languages (PELs). A. Birman\nand J. Ullman established such important properties like TDPLs generate any\nDCFL and some non-context-free languages like $a^nb^nc^n$, a linear-time\nparsing algorithm was constructed as well. But since this parsing algorithm was\nimpractical in the 60-s TDPLs were abandoned and then upgraded by B. Ford to\nPEGs, so the parsing algorithm was improved (from the practical point of view)\nas well. Now PEGs are actively used in compilers (eg., Python replaced\nLL(1)-parser with a PEG one) so as for text processing as well. In this paper,\nwe present a computational model for PEG, obtain structural properties of PELs,\nnamely proof that PELs are closed over left concatenation with Boolean closure\nof regular closure of DCFLs, and present an extension of the PELs class based\non the extension of our computational model. Our model is an upgrade of\ndeterministic pushdown automata (DPDA) such that during the pop of a symbol it\nis allowed to return the head to the position of the push of the symbol. We\nprovide a linear-time simulation algorithm for the 2-way version of this model,\nwhich is similar to the S. Cook famous linear-time simulation algorithm of\n2-way DPDA.","PeriodicalId":501124,"journal":{"name":"arXiv - CS - Formal Languages and Automata Theory","volume":"178 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-06-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Computational Model for Parsing Expression Grammars\",\"authors\":\"Alexander Rubtsov, Nikita Chudinov\",\"doi\":\"arxiv-2406.14911\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"We present a computational model for Parsing Expression Grammars (PEGs). The\\npredecessor of PEGs top-down parsing languages (TDPLs) were discovered by A.\\nBirman and J. Ullman in the 1960-s, B. Ford showed in 2004 that both formalisms\\nrecognize the same class named Parsing Expression Languages (PELs). A. Birman\\nand J. Ullman established such important properties like TDPLs generate any\\nDCFL and some non-context-free languages like $a^nb^nc^n$, a linear-time\\nparsing algorithm was constructed as well. But since this parsing algorithm was\\nimpractical in the 60-s TDPLs were abandoned and then upgraded by B. Ford to\\nPEGs, so the parsing algorithm was improved (from the practical point of view)\\nas well. Now PEGs are actively used in compilers (eg., Python replaced\\nLL(1)-parser with a PEG one) so as for text processing as well. In this paper,\\nwe present a computational model for PEG, obtain structural properties of PELs,\\nnamely proof that PELs are closed over left concatenation with Boolean closure\\nof regular closure of DCFLs, and present an extension of the PELs class based\\non the extension of our computational model. Our model is an upgrade of\\ndeterministic pushdown automata (DPDA) such that during the pop of a symbol it\\nis allowed to return the head to the position of the push of the symbol. We\\nprovide a linear-time simulation algorithm for the 2-way version of this model,\\nwhich is similar to the S. Cook famous linear-time simulation algorithm of\\n2-way DPDA.\",\"PeriodicalId\":501124,\"journal\":{\"name\":\"arXiv - CS - Formal Languages and Automata Theory\",\"volume\":\"178 1\",\"pages\":\"\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-06-21\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"arXiv - CS - Formal Languages and Automata Theory\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/arxiv-2406.14911\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Formal Languages and Automata Theory","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2406.14911","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

摘要

我们提出了一个解析表达式语法(PEG)的计算模型。PEG 的前身自上而下解析语言(TDPL)是由 A. Birman 和 J. Ullman 在 20 世纪 60 年代发现的,B. Ford 在 2004 年指出,这两种形式主义承认同一类语言,即解析表达式语言(PEL)。A. Birman 和 J. Ullman 建立了 TDPLs 生成任意 DCFL 和一些非无上下文语言(如 $a^nb^nc^n$)等重要属性,并构建了线性时间解析算法。但由于这种解析算法在 60 年代并不实用,所以 TDPLs 被放弃了,后来 B. Ford 将其升级为 PEGs,因此解析算法也得到了改进(从实用的角度来看)。现在,PEG 已被积极用于编译器中(例如,Python 用 PEG 替代了LL(1)-parser ),也被用于文本处理。在本文中,我们提出了 PEG 的计算模型,获得了 PELs 的结构特性,即证明了 PELs 在 DCFLs 的规则闭包与布尔闭包的左连接上是闭包的,并基于我们计算模型的扩展提出了 PELs 类的扩展。我们的模型是确定性下推自动机(DPDA)的升级版,在符号弹出的过程中,允许将头部返回到符号推入的位置。我们为这个模型的双向版本提供了一种线性时间仿真算法,它类似于库克(S. Cook)著名的双向 DPDA 线性时间仿真算法。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Computational Model for Parsing Expression Grammars
We present a computational model for Parsing Expression Grammars (PEGs). The predecessor of PEGs top-down parsing languages (TDPLs) were discovered by A. Birman and J. Ullman in the 1960-s, B. Ford showed in 2004 that both formalisms recognize the same class named Parsing Expression Languages (PELs). A. Birman and J. Ullman established such important properties like TDPLs generate any DCFL and some non-context-free languages like $a^nb^nc^n$, a linear-time parsing algorithm was constructed as well. But since this parsing algorithm was impractical in the 60-s TDPLs were abandoned and then upgraded by B. Ford to PEGs, so the parsing algorithm was improved (from the practical point of view) as well. Now PEGs are actively used in compilers (eg., Python replaced LL(1)-parser with a PEG one) so as for text processing as well. In this paper, we present a computational model for PEG, obtain structural properties of PELs, namely proof that PELs are closed over left concatenation with Boolean closure of regular closure of DCFLs, and present an extension of the PELs class based on the extension of our computational model. Our model is an upgrade of deterministic pushdown automata (DPDA) such that during the pop of a symbol it is allowed to return the head to the position of the push of the symbol. We provide a linear-time simulation algorithm for the 2-way version of this model, which is similar to the S. Cook famous linear-time simulation algorithm of 2-way DPDA.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信