Semiautomatisk generering av LSP-servrar för domänspecifika språk : Stärkande av domänspecifika språk genom generering av språkservrar
Domain-Specific Languages (DSLs) are programming or modeling languages designed to facilitate the creation of models or programs within a specific domain. For domain experts, DSLs offer alternative advantages over General-Purpose Languages (GPLs), primarily by enabling problem modeling at a much higher level of abstraction. A DSL is sometimes accompanied by a language workbench that provides essential code editing support, typically within an Integrated Development Environment (IDE). Features such as syntax highlighting, code completion, and definition lookups enhance the usability of a DSL but are costly to develop. With the introduction of the Language Server Protocol (LSP), DSL developers can target a single protocol to expose language support, making language tooling more accessible and maintainable. Many solutions exist to ease the creation of language server support for one’s DSL. Langium, an open-source language engineering tool, leverages the DSL’s semantics, defined through services, to provide language support alongside compilation. This is also the case of the popular language workbench Eclipse Xtext™ (Xtext). However, a DSL with an existing compiler implemented in an arbitrary framework must typically reimplement its semantics within such workbenches to enable language server functionality. This Master’s thesis proposes a method of extracting semantics from a compiled backend, effectively reusing already defined semantics. We do this by attaching metadata during the compilation process and reusing it to provide language server functionality through the LSP protocol, such as go-to definition or hover information. By building on existing compilation artifacts, the approach minimizes duplication of effort and ensures consistency between runtime behavior and developer tooling. The approach is demonstrated using the Meta vIKING (Miking) language workbench and evaluated on two DSLs: MLang and ProbTime. The results show that language support can be semi- automatically derived with minimal manual intervention.
Publication Details
- Journal
- KTH Publication Database DiVA (KTH Royal Institute of Technology)
- Published
- 2025-01-01
- Primary Topic
- Model-Driven Software Engineering Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00