lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Universe of syntax possibilities, ONLY to skip over non-notes/chords


From: Jeff Epstein
Subject: Universe of syntax possibilities, ONLY to skip over non-notes/chords
Date: Fri, 12 Nov 2010 13:11:06 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

I am writing a very-simplified LilyPond parser, just to analyze the notes,
chords and rests/silences within a particular { }-block of LY code. I want
to completely ignore all non-note (and non-chords and non-rest/silence)
elements.

I am trying to understand all of the (at least most common) possibilities
of syntax that can happen within LY blocks--that is, the inner-most
blocks in which notes can be written (not score or book blocks, for
example).

I've been thinking about how to programmatically determine the syntax
possibilities, but my brain exploded.

For example:
- if a - (dash) immediately follows a note, skip over it and the next
character (articulation)
- following that could be a single ~ ? ! ( ) [ ] (up to one of each)
- if a ^ or _ immediately follows an articulation-or-note (or another 
^/_ element), then it could be...
--- a \function with or without a following { }-block, or "quoted string" or
scheme parameters
--- a "quote"

Over-simplified, and likely inaccurate, but you get the point.

This is when the possibilities started to feel infinite. Is there a well-
defined "universe of syntax possibilities"? I understand that this task
may be a whole lot more than I can handle right now, but I wish I
could at least be pointed in the right direction.

Again, my only purpose is to skip everything but notes. I don't need
to parse or understand any of it.

Thank you very much for any advice.



PS. I wish this gmane-posting-form would just chop my lines for me,
instead of the "You have lines longer than 80 characters. Fix that."
error.  :(





reply via email to

[Prev in Thread] Current Thread [Next in Thread]