AnyText: Incremental, left-recursive Parsing and Pretty-Printing from a single Grammar Definition with first-class LSP support
Many current language workbenches do not support incremental parsing or left recursion, lack support for resolving references and pretty-printing or make it difficult to implement the Language Server Protocol (LSP) based on the generated parser. In this paper, we present AnyText, a new language workbench that solves these challenges by implementing the LSP using a scannerless, incremental packrat parser with support for left recursion, based on a grammar description in an extended EBNF-like grammar similar to Xtext/Langium. Furthermore, we show how an EBNF extension with formatting instructions can be used to obtain a pretty-printer. We use a combination of an internal and an external DSL to simplify the process of creating a new language. We demonstrate our approach using two new DSLs and evaluate performance and the amount of manual code necessary to support different editor features.
Authors
- Klaus Weinert
- Georg Hinkel (ORCID: https://orcid.org/0000-0002-6462-5208)
- Alexander Hert
- Niklas Hettler
Institutions
- RheinMain University of Applied Sciences (DE)
Publication Details
- Published
- 2025-06-12
- DOI
- https://doi.org/10.1145/3732771.3742716
- Primary Topic
- Natural Language Processing Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00