Proceedingsbeitrag
Zitieren …

Embedding a Questionnaire DSL with SugarJ

Sebastian Erdweg ORCID-iD-Icon 1
1 Institut für Programmstrukturen und Datenorganisation (IPD), Karlsruher Institut für Technologie (KIT)
Abstract

We describe our SugarJ-based solution to the 2013 Language Workbench Competition. As part of this competition, we developed domain-specific language (DSL) for questionnaires that features conditional questions, locally defined questions, derived values, name checking, type checking, checking for overlapping question instances, and basic tool support such as code coloring. Using SugarJ, we have realized the questionnaire DSL as a language extension of Java that translates a questionnaire into a Java Swing component. We have realized the questionnaire DSL via separate components for the syntax, code generation, tool support, name checking, type checking, and overlap checking. Moreover, we use SugarJ’s support for layout-sensitive syntax to use indentation instead of parentheses in the design of the questionnaire DSL. The source code of the questionnaire DSL is available online: https://github.com/seba--/sugarj/tree/questionnaire/case-studies/questionnaire-language.