The realization of model-driven software development requires effective techniques for implementing code generators for domain-specific languages. This paper identifies techniques for improving separation of concerns in the implementation of generators. The core technique is code generation by model transformation, that is, the generation of a structured representation (model) of the target program instead of plain text. This approach enables the transformation of code after generation, which in turn enables the extension of the target language with features that allow better modularity in code generation rules. The technique can also be applied to 'internal code generation' for the translation of high-level extensions of a DSL to lower-level constructs within the same DSL using model-to-model transformations. This paper refines our earlier description of code generation by model transformation with an improved architecture for the composition of model-to-model normalization rules, solving the problem of combining type analysis and transformation. Instead of coarse-grained stages that alternate between normalization and type analysis, we have developed a new style of type analysis that can be integrated with normalizing transformations in a fine-grained manner. The normalization strategy has a simple extension interface and integrates non-local, context-sensitive transformation rules. We have applied the techniques in a realistic case study of domain-specific language engineering, i.e. the code generator for WebDSL, using Stratego, a high-level transformation language that integrates model-to-model, modelto-code, and code-to-code transformations.
Abstract. In textual software languages, names are used to reference elements like variables, methods, classes, etc. Name resolution analyses these names in order to establish references between denition and use sites of elements. In this paper, we identify recurring patterns for name bindings in programming languages and introduce a declarative metalanguage for the specication of name bindings in terms of namespaces, denition sites, use sites, and scopes. Based on such declarative name binding specications, we provide a language-parametric algorithm for static name resolution during compile-time. We discuss the integration of the algorithm into the Spoofax Language Workbench and show how its results can be employed in semantic editor services like reference resolution, constraint checking, and content completion.
Syntax discoverability has been a crucial advantage of structure editors for new users of a language. Despite this advantage, structure editors have not been widely adopted. Nevertheless, the Cheetah system, developed at Capgemini, leverages a structure editor to aid domain experts modeling tax-benefit rules in a domain specific language. The structure editor suffers from a lack of free form editing and conversions from/to plain text. The Spoofax language workbench, developed at Delft University of Technology, uses a textual editor, which is syntax-aware due to immediate parsing and analyses. In this thesis we describe a migration from Cheetah to Spoofax, which aims to bring the advantages of text editing to the tax-benefit rule modeling language.During the migration, we experienced that current text-based language workbenches, such as Spoofax, require redundant specification of the ingredients for a template-based editor, which is detrimental to the quality of syntactic completion, as consistency and completeness of the definition cannot be guaranteed. We describe the design and implementation of a specification language for syntax definition based on templates. It unifies the specification of parser, pretty printer and template-based editor. We evaluate the template language by application to the tax-benefit rule modeling language and a language for mobile web applications. PrefaceAbout this thesis This work essentially consists of two parts. The first part (Chapter 2 up to Chapter 7) describes a migration of the Cheetah system at Capgemini to Spoofax, and provides the motivation for the second part. The second part (Chapter 8 up to Chapter 11) describes a language that unifies the specification of grammar, pretty printer, and templates for syntactic completion (content assist), and runtime support for the template-based editors generated from specifications in this language. The title of this thesis is derived from the second part.
Spoofax is a language workbench for efficient, agile development of textual domain-specific languages with state-of-the-art IDE support. It provides a comprehensive environment that integrates syntax definition, program transformation, code generation, and declarative specification of IDE components.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
customersupport@researchsolutions.com
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.