A Domain-Specific Language for Abstract Syntax Model to Concrete Syntax Model Mappings
Luis Quesada, Fernando Berzal, Juan-Carlos Cubero · 2014
Model-based parser generators such as ModelCC effectively decouple language design from language processing. ModelCC allows the specification of the abstract syntax model of a language as a set of language elements and their relationships. ModelCC provides the necessary mechanisms to specify the mapping from the abstract syntax model (ASM) to a concrete syntax model (CSM). This mapping can be specified as a set of metadata annotations on top of the abstract syntax model itself or by means of a domain-specific language (DSL). Using a domain-specific language to specify the mapping from abstract to concrete syntax models allows the definition of different concrete syntax models for the same abstract syntax model. In this paper, we describe the ModelCC domain-specific language for ASM-CSM mappings and we showcase its capabilities by using the ModelCC ASM-CSM DSL to define itself.