论文标题

最佳LL(K)解析的LL(有限)策略

The LL(finite) strategy for optimal LL(k) parsing

论文作者

Belcak, Peter

论文摘要

提出了不需要k的LL(k)语法解析的LL(有限)解析策略。该策略在线性时间内解析输入,使用任意但始终最小的lookahead来消除非末端替代方案,并且在执行的LookAhead终端扫描的数量中是最佳的。表明对算法的修改显示,可以通过优先级解决语法歧义 - 有效地将输入解释为解析表达语法,以及使用谓词的使用,以及概念证明,开源解析器生成器ASTIR,采用了LL(FILITIE)在输出策略中生成了IT生成的IT生成。

The LL(finite) parsing strategy for parsing of LL(k) grammars where k needs not to be known is presented. The strategy parses input in linear time, uses arbitrary but always minimal lookahead necessary to disambiguate between alternatives of nonterminals, and it is optimal in the number of lookahead terminal scans performed. Modifications to the algorithm are shown that allow for resolution of grammar ambiguities by precedence -- effectively interpreting the input as a parsing expression grammar -- as well as for the use of predicates, and a proof of concept, the open-source parser generator Astir, employs the LL(finite) strategy in the output it generates.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源