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

良好类型的孤岛解析速度更快

Well-typed Islands Parse Faster

Erik Silkensen, Jeremy G. Siek

摘要:

本文提出了一种模块化的、用户友好的方法来指定和解析领域特定语言(DSL)的语法。也就是说,我们希望能够设计出可组合的DSL,将外部DSL的自然语法与内部DSL的简单实现结合起来。解析可组合DSL的挑战是,几种(单独明确的)语言的组合可能包含歧义。在本文中,我们介绍了一个系统的设计,该系统使用岛解析的面向类型的变体来有效地解析可组合DSL的语法。特别是,我们展示了如何面向类型的岛解析是恒定的时间相对于DSL导入的数量。我们还展示了如何使用我们的工具来实现DSL的主机语言,如打字球拍。

英文摘要:

This paper addresses the problem of specifying and parsing the syntax of domain-specific languages (DSLs) in a modular, user-friendly way. That is, we want to enable the design of composable DSLs that combine the natural syntax of external DSLs with the easy implementation of internal DSLs. The challenge in parsing composable DSLs is that the composition of several (individually unambiguous) languages is likely to contain ambiguities. In this paper, we present the design of a system that uses a type-oriented variant of island parsing to efficiently parse the syntax of composable DSLs. In particular, we show how type-oriented island parsing is constant time with respect to the number of DSLs imported. We also show how to use our tool to implement DSLs on top of a host language such as Typed Racket.

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

↑