Generating fluent embedded domain-specific languages with subchaining

被引:3
|
作者
Nakamaru, Tomoki [1 ]
Ichikawa, Kazuhiro [1 ]
Yamazaki, Tetsuro [1 ]
Chiba, Shigeru [1 ]
机构
[1] Univ Tokyo, Tokyo, Japan
关键词
Embedded domain-specific language; Fluent API;
D O I
10.1016/j.jvlc.2018.11.001
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页码:70 / 83
页数:14
相关论文
共 50 条
  • [1] Generating Version Convertors for Domain-Specific Languages
    de Geest, Gerardo
    Vermolen, Sander
    van Deursen, Arie
    Visser, Eelco
    [J]. FIFTEENTH WORKING CONFERENCE ON REVERSE ENGINEERING, PROCEEDINGS, 2008, : 197 - 201
  • [2] Deriving Fluent Internal Domain-Specific Languages from Grammars
    Butting, Arvid
    Dalibor, Manuela
    Leonhardt, Gerrit
    Rumpe, Bernhard
    Wortmann, Andreas
    [J]. PROCEEDINGS OF THE 11TH ACM SIGPLAN INTERNATIONAL CONFERENCE ON SOFTWARE LANGUAGE ENGINEERING (SLE '18), 2018, : 187 - 199
  • [5] ProMoBox: A Framework for Generating Domain-Specific Property Languages
    Meyers, Bart
    Deshayes, Romuald
    Lucio, Levi
    Syriani, Eugene
    Vangheluwe, Hans
    Wimmer, Manuel
    [J]. SOFTWARE LANGUAGE ENGINEERING, SLE 2014, 2014, 8706 : 1 - +
  • [6] Domain-Specific Languages for Embedded Systems Portable Software Development
    Ivanova, Vera
    Sedov, Boris
    Sheynin, Yuriy
    Syschikov, Alexey
    [J]. PROCEEDINGS OF THE 2014 16TH CONFERENCE OF OPEN INNOVATIONS ASSOCIATION (FRUCT16), 2014, : 24 - 30
  • [7] Domain-specific model differencing for graphical domain-specific languages
    Jafarlou, Manouchehr Zadahmad
    [J]. ACM/IEEE 25TH INTERNATIONAL CONFERENCE ON MODEL DRIVEN ENGINEERING LANGUAGES AND SYSTEMS, MODELS 2022 COMPANION, 2022, : 205 - 208
  • [8] Domain-specific visual languages for specifying and generating data mapping systems
    Grundy, JC
    Hosking, JG
    Amor, RW
    Mugridge, WB
    Li, Y
    [J]. JOURNAL OF VISUAL LANGUAGES AND COMPUTING, 2004, 15 (3-4): : 243 - 263
  • [9] On domain-specific languages reengineering
    Alias, C
    Barthou, D
    [J]. GENERATIVE PROGRAMMING AND COMPONENT ENGINEERING, PROCEEDINGS, 2005, 3676 : 63 - 77
  • [10] Unembedding Domain-Specific Languages
    Atkey, Robert
    Lindley, Sam
    Yallop, Jeremy
    [J]. HASKELL'09: PROCEEDINGS OF THE 2009 ACM SIGPLAN HASKELL SYMPOSIUM, 2009, : 37 - 48