Default disambiguation for online parsers
Default disambiguation for online parsers
复制标题
DOI:
10.1145/3357766.3359530
复制
发表时间:
2019-09
期刊:
影响因子:
--
通讯作者:
Lukas Diekmann;L. Tratt
中科院分区:
文献类型:
--
作者:
Lukas Diekmann;L. Tratt
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.