A toolkit that simplifies language server development by automating grammar and semantic analysis generation. Given sample code from any domain-specific language, uLangs generates the necessary parsing and analysis components to create a LSP server implementation. The system uses LLMs to automate the traditionally manual tasks of grammar definition and semantic rule creation.
This project represents completed Master's thesis research in automated language server development. While the core research is finished, ongoing refinement and feature additions may occur.
- Automated LSP Generation: Creates complete language servers from code samples without manual grammar writing
- Semantic Analysis: Extracts language rules and patterns to provide intelligent code assistance
- Code Intelligence: Delivers syntax highlighting, completions, diagnostics, and symbol navigation
- Extensible Pipeline: Modular design supporting both traditional (ANTLR/Prolog) and LLM-based analysis
- Language Agnostic: Works with any textual DSL or programming language given sufficient code examples
- Universal Client: Includes ready-to-use VSCode extension that automatically integrates with any generated language server
- antlr-grammar-checker/: Contains grammar definitions and Java/Kotlin code for ANTLR parsing and error handling.
- lsp-server/: Implements the server-side logic for handling LSP requests.
- actions/: Contains scripts for grammar inference and query generation.
- rules/: Prolog rules and queries for semantic analysis.
- test-dsl/: Provides test files for various languages to validate grammar and server functionality.
- Node.js: Ensure that Node.js is installed on your system.
- Java: Required for running ANTLR grammar checks.
- SWI-Prolog: Needed for executing Prolog queries.
-
Clone the Repository:
git clone <repository-url> cd ulangs
-
Install Dependencies:
pnpm install
-
Build
antlr-grammar-checker
cd antlr-grammar-checker/
mvn clean install-
Build the universal-language-server (vscode extension):
pnpm run build:lsp
-
Launch the Server: Use the provided VSCode launch configurations to start the language server.
-
Generate Prolog Query:
pnpm run cli query <target> <lexer> <parser> [options]
-
Check Grammar:
pnpm run cli check <directory> <extension> <lexer> <parser>
-
Infer Grammar:
pnpm run cli infer-grammar <directory> <extension> [outputDir] [options]
-
Infer Semantic Adapter:
pnpm run cli infer-adapter <directory> <extension> [outputDir] [options]
