Eclipse Langium is a toolkit for domain-specific languages (DSLs) that is fully built with TypeScript. It provides a text parser with integrated cross-reference resolution and a language server for smart editor support. You can use Langium to build custom text languages that can be automatically processed. For example, you can execute user-defined behavior with an interpreter, or generate executable code, documentation, or other output formats. Such a custom language can
- empower non-technical persons to provide data, logical constraints, executable behavior, or similar concepts,
- greatly reduce the manual effort to create artifacts such as source code or documentation,
- strengthen the communication between stakeholders with a formal language.
Eclipse Langium aims to enable DSL development in a web-based technology stack. When used in the context of a desktop app (e.g. VS Code, Eclipse IDE, etc.), Langium runs on the Node.js platform. Additionally, it can run in a web browser to add language support to web applications with embedded text editors (e.g. Monaco Editor). The interface between Langium and the text editor is the Language Server Protocol (LSP).
The entry point of a Langium project is the grammar language – similarly to how Eclipse Xtext works. A grammar file describes the concrete syntax by instructing the parser how to read input text, and also the abstract syntax by defining object types and their properties. The resulting abstract syntax tree (AST) is created by the parser that Langium provides based on the grammar declaration. The AST is the basis for all further operations, including cross-reference resolution, validation, code generation and much more.
In addition to editor support through LSP, a Langium-based language implementation can be used as a library to implement automation processes: interpret (execute) language instances, generate different artifacts, transform into specific modeling formats, and so forth – there are vast possibilities that can be explored depending on your project context and the specific problems you would like to address.
The content of this open source project is received and distributed under the license(s) listed above. Some source code and binaries may be distributed under different terms. Specific license information is provided in file headers and in NOTICE files distributed with the project's binaries.