Exploiting Modular Language Extensions in Legacy C Code: An Automotive Case Study
ISSN der Zeitschrift
Gesellschaft für Informatik e.V.
Model-driven software development using language workbenches like JetBrains MPS provide many advantages compared to traditional software development. Base languages can be incrementally extended to increase the abstractness up to domain-specific languages (DSLs). Changes can be performed more efficiently in problem-oriented language extensions or DSLs, than in a base language. In addition, formal analysis can be performed on abstract models. To benefit from the model-driven approach, non-model-based legacy code has to be reusable and transformable to language extensions and DSLs. For the development of embedded systems, mbeddr provides a C99-like base language and extensions for MPS, such as mathematical symbols and state machines. This paper presents a case study that shows how many legacy C code fragments of three automotive series projects could be replaced by mbeddr language extensions. Furthermore, a proof of concept shows the feasibility of fraction and foreach loop refactorings. This work is a first approach for future language extension refactorings.