Default disambiguation for online parsers

Default disambiguation for online parsers
复制标题

DOI:
10.1145/3357766.3359530
复制
发表时间:
2019-09
期刊:
Proceedings of the 12th ACM SIGPLAN International Conference on Software Language Engineering
影响因子:
--
通讯作者:
Lukas Diekmann;L. Tratt
Lukas Diekmann;L. Tratt
中科院分区:
其他
文献类型:
--
作者:
Lukas Diekmann;L. Tratt

文献摘要

相似文献

由于组合语法通常是多义性的,所以语法组合需要一种处理多义性的机制:要么使用分隔符(使用起来不方便)排除歧义,要么使用消除歧义操作符将分析森林过滤到单个分析树(通常,我们不能确保我们已经覆盖了所有可能的分析森林)。在这篇文章中,我们证明了默认的歧义消解不适合于批处理分析,但在在线分析中效果很好,如果需要的话,它可以被用户覆盖。我们扩展了语言框-一种基于分隔符的算法,在增量解析的基础上-以这样一种方式,默认消歧可以自动插入、删除语言框或调整语言框的大小,从而产生自动语言框算法。问题的本质意味着默认的歧义消除并不总是符合用户的意图。然而,我们的实验评估表明,在涉及真实编程语言组合的测试中,自动语言框在96.8%的测试中表现得可以接受。
Since composed grammars are often ambiguous, grammar composition requires a mechanism for dealing with ambiguity: either ruling it out by using delimiters (which are awkward to work with), or by using disambiguation operators to filter a parse forest down to a single parse tree (where, in general, we cannot be sure that we have covered all possible parse forests). In this paper, we show that default disambiguation, which is inappropriate for batch parsing, works well for online parsing, where it can be overridden by the user if necessary. We extend language boxes – a delimiter-based algorithm atop incremental parsing – in such a way that default disambiguation can automatically insert, remove, or resize, language boxes, leading to the automatic language boxes algorithm. The nature of the problem means that default disambiguation cannot always match a user’s intention. However, our experimental evaluation shows that automatic language boxes behave acceptably in 96.8% of tests involving compositions of real-world programming languages.