Block-based syntax from context-free grammars

Mauricio Verano Merino, Tijs Van Der Storm

Research output: Chapter in Book/Report/Conference proceedingConference contributionAcademicpeer-review

16 Citations (Scopus)

Abstract

Block-based programming systems employ a jigsaw metaphor to write programs. They are popular in the domain of programming education (e.g., Scratch), but also used as a programming interface for end-users in other disciplines, such as arts, robotics, and configuration management. In particular, block-based environments promise a convenient interface for Domain-Specific Languages (DSLs) for domain experts who might lack a traditional programming education. However, building a block-based environment for a DSL from scratch requires significant effort. This paper presents an approach to engineer block-based language interfaces by reusing existing language artifacts. We present Kogi, a tool for deriving block-based environments from context-free grammars. We identify and define the abstract structure for describing block-based environments. Kogi transforms a context-free grammar into this structure, which then generates a block-based environment based on Google Blockly. The approach is illustrated with four case studies, a DSL for state machines, Sonification Blocks (a DSL for sound synthesis), Pico (a simple programming language), and QL (a DSL for questionnaires). The results show that usable block-based environments can be derived from context-free grammars, and with an order of magnitude reduction in effort.

Original languageEnglish
Title of host publicationSLE 2020 - Proceedings of the 13th ACM SIGPLAN International Conference on Software Language Engineering, Co-located with SPLASH 2020
EditorsRalf Lammel, Laurence Tratt, Juan de Lara
PublisherAssociation for Computing Machinery, Inc
Pages283-295
Number of pages13
ISBN (Electronic)9781450381765
DOIs
Publication statusPublished - 16 Nov 2020
Event13th ACM SIGPLAN International Conference on Software Language Engineering, SLE 2020, co-located with SPLASH 2020 - Virtual, Online, United States
Duration: 16 Nov 202017 Nov 2020

Conference

Conference13th ACM SIGPLAN International Conference on Software Language Engineering, SLE 2020, co-located with SPLASH 2020
Country/TerritoryUnited States
CityVirtual, Online
Period16/11/2017/11/20

Bibliographical note

Publisher Copyright:
© 2020 ACM.

Keywords

  • Blockly
  • DSLs
  • Rascal
  • block-based environments
  • grammars
  • language workbenches
  • syntax
  • visual languages

Fingerprint

Dive into the research topics of 'Block-based syntax from context-free grammars'. Together they form a unique fingerprint.

Cite this