Domain-specific languages (DSLs) assist a software developer (or end-user) in writing a program using idioms that are similar to the abstractions found in a specific problem domain. Tool support for DSLs is lacking when compared with the capabilities provided for standard general-purpose languages (GPLs), such as Java and C++. For example, support for debugging a program written in a DSL is often non-existent. The lack of a debugger at the proper abstraction level limits an end-user's ability to discover and locate faults in a DSL program. This paper describes a grammar-driven technique to build a debugging tool generation framework from existing DSL grammars. The DSL grammars are used to generate the hooks needed to interface with a supporting infrastructure constructed for an integrated development environment that assists in debugging a program written in a DSL. The contribution represents a coordinated approach to bring essential software tools (e.g. debuggers) to different types of DSLs (e.g. imperative, declarative, and hybrid). This approach hides from the end-users the accidental complexities associated with expanding the focus of a language environment to include debuggers. The research described in this paper addresses a long-term goal of empowering end-users with development tools for particular DSL problem domains at the proper level of abstraction without depending on a specific GPL.
The challenges of DSL implementationThere is a distinction between the end-user programmers who use a DSL and the language designers who specify the DSL and implement the required tools (e.g. the DSL compiler). The design and implementation of a DSL can be challenging and expensive [19]. The development of a DSL requires 1075 knowledge of programming language implementation, as well as domain knowledge. Building a debugger for each DSL from scratch can be time consuming, error prone, and costly. It is difficult to build new source-level debuggers [20] for each new language of interest and for each supported platform because each debugger depends heavily on the underlying operating system's capabilities and lower-level native code functionality [21]. The main goal of this paper is to show how the effort of developing DSL tools can be minimized by an automated grammar-driven tool generation approach that extends a popular integrated development environment (IDE). At the experimental evaluation phase of this research, the research results reveal the reusable and non-reusable software components of the framework. Reusable components deal with the commonality across debugging behavior, and non-reusable components handle the specificity across different DSLs and testing tools. A detailed analysis of the reusability of these components is described in Section 4.4.Mernik et al. have categorized various DSL implementation patterns as interpreter, compiler/ application generator, pre-processor, embedding, extensible compiler/interpreter, commercial offthe-shelf, and hybrid [13]. The majority of the DSL implementation patterns tran...