KIT | KIT-Bibliothek | Impressum | Datenschutz

Variability-Aware Parsing in the Presence of Lexical Macros and Conditional Compilation

Kästner, Christian; Giarrusso, Paolo G.; Rendel, Tillmann; Erdweg, Sebastian ORCID iD icon 1; Ostermann, Klaus; Berger, Thorsten
1 Institut für Programmstrukturen und Datenorganisation (IPD), Karlsruher Institut für Technologie (KIT)

Abstract (englisch):

In many projects, lexical preprocessors are used to manage different variants of the project (using conditional compilation) and to define compile-time code transformations (using macros). Unfortunately, while being a simple way to implement variability, conditional compilation and lexical macros hinder automatic analysis, even though such analysis is urgently needed to combat variability-induced complexity. To analyze code with its variability, we need to parse it without preprocessing it. However, current parsing solutions use unsound heuristics, support only a subset of the language, or suffer from exponential explosion. As part of the TypeChef project, we contribute a novel variability-aware parser that can parse almost all unpreprocessed code without heuristics in practicable time. Beyond the obvious task of detecting syntax errors, our parser paves the road for further analysis, such as variability-aware type checking. We implement variability-aware parsers for Java and GNU C and demonstrate practicability by parsing the product line MobileMedia and the entire X86 architecture of the Linux kernel with 6065 variable features.


Zugehörige Institution(en) am KIT Institut für Programmstrukturen und Datenorganisation (IPD)
Publikationstyp Proceedingsbeitrag
Publikationsdatum 22.10.2011
Sprache Englisch
Identifikator ISBN: 978-1-4503-0940-0
KITopen-ID: 1000188537
Erschienen in Proceedings of the 26th Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA; Portland, OR, USA, 22.-27.10.2011
Veranstaltung 26th ACM International Conference on Object Oriented Programming Systems Languages and Applications (2011), Portland, OR, USA, 22.10.2011 – 27.10.2011
Verlag Association for Computing Machinery (ACM)
Seiten S. 805–824
Schlagwörter #ifdef; C; Conditional compilation; Linux; Parsing; Preprocessor; Software product lines; Variability
Nachgewiesen in Scopus
KIT – Die Universität in der Helmholtz-Gemeinschaft
KITopen Landing Page