[GSoC] Proposal: Modular LilyPond Parser (C++)

"C. Stroppel" <[email protected]>
Newsgroups gmane.comp.gnu.lilypond.devel
Message-ID <[email protected]>
Proposal for Google Summer of Code: Modular LilyPond Parser in C++
------------------------------------------------------------------------------------------------

I would like to propose a project to develop a modular LilyPond parser 
in C++. The goal is a fault tolerant, context sensitive, and very fast 
parser that can be used independently of the engraver system and 
integrated into editors, analysis tools, and other applications. The 
technical foundation is a trie handler pipeline for efficient tokenizing 
and incremental re parsing.

Motivation

The current LilyPond parser is tightly coupled to the engraver system 
and therefore difficult to reuse in external software. Modern editors 
would benefit greatly from real time structural analysis of LilyPond 
code. A standalone parser would make LilyPond more accessible to new 
users and enable a wider range of applications.

A short video demonstrating my current editor is available here:

https://www.youtube.com/watch?v=nQNUPbI9swA

Project goals

1. Modularity: Lexer and parser as separate, reusable components.
2. Performance: Optimized for real time processing during text input.
3. Context sensitivity: Detection of which commands are valid in which 
contexts; precise error reporting.
4. Fault tolerance: Robust handling of missing or mis nested brackets; 
ability to read incomplete files.
5. Incremental parsing: Only modified regions need to be re parsed; 
suitable for live editing.

Background

I am currently developing a LilyPond editor and have already implemented 
a parser that reads LilyPond files into an AST on a block basis. This 
parser works for well formed input, but it is not fault tolerant, cannot 
handle missing or mismatched brackets, and is not incremental. Working 
with these limitations has clarified which requirements a parser must 
meet to be editor friendly and modular. A general purpose parser would 
improve editor support and enable new tools for analyzing, converting, 
or visualizing LilyPond files.

The goal is not to replace LilyPond’s existing parser, but to provide an 
additional, editor oriented library that can be reused by external 
tools. The initial GSoC scope would focus on a robust core (lexer, 
parser, and AST for a well defined subset of LilyPond), with a clear 
path for later extensions.

Additional note

My current family situation may or may not allow me to participate in 
GSoC within the official time window. This may change by the time the 
program starts. Regardless of GSoC, I intend to continue working on this 
parser throughout the year and would like to align it with the needs and 
expectations of the community. I am therefore sharing this proposal now 
so that the project can be discussed independently of my availability 
for GSoC.

Best regards,
cStr.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.