首页> 外文期刊>Journal of Visual Languages & Computing >Generating fluent embedded domain-specific languages with subchaining
【24h】

Generating fluent embedded domain-specific languages with subchaining

机译:通过子链生成流利的嵌入式特定领域语言

获取原文
获取原文并翻译 | 示例

摘要

This paper presents Silverchain, a tool that generates a fluent embedded domain-specific language (EDSL) from a BNF-style grammar. A fluent EDSL is a class library that allows its users to embed domain-specific sentences into a program written in a general-purpose language by method chaining. A generated EDSL is designed so that its users can find syntactic errors from type errors and make effective use of method chaining in various situations. The first feature is realized by setting the return type of each method based on which methods may be invoked next, and the second feature is achieved by providing subchaining APIs besides regular chaining APIs. The contribution of this paper is the development of a translation method from a grammar to such an EDSL. Our translation method is modeled as the construction of a set of single-state real-time deterministic pushdown automata (RPAs). A fluent EDSL is obtained by encoding those RPAs into class definitions. In the construction of RPAs, Silverchain does not add or remove any non-terminal from the given grammar. This constraint is required to generate subchaining APIs as specified in the grammar.
机译:本文介绍了Silverchain,该工具可从BNF风格的语法生成流利的嵌入式领域特定语言(EDSL)。流畅的EDSL是一个类库,该类库允许其用户通过方法链接将特定于域的句子嵌入以通用语言编写的程序中。设计生成的EDSL,以便其用户可以从类型错误中找到语法错​​误,并在各种情况下有效地使用方法链接。第一个功能是通过设置每个方法的返回类型来实现的,然后根据这些方法可以调用哪些方法,第二个功能是通过提供常规链接API之外的子链API来实现的。本文的贡献是从语法到这种EDSL的转换方法的发展。我们的翻译方法被建模为一组单状态实时确定性下推自动机(RPA)的构造。通过将那些RPA编码为类定义,可以获得流畅的EDSL。在RPA的构造中,Silverchain不会在给定的语法中添加或删除任何非终结符。此约束是生成语法中指定的子链API所必需的。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号