From b36b5b232be479bd69a6e2f421c5e740429a15bf Mon Sep 17 00:00:00 2001 From: JSDurand Date: Mon, 29 Aug 2022 09:37:45 +0800 Subject: Fix the grammar There were some bugs in the grammar specification of the sheet. Now the grammar is supposedly correct. --- src/sheet/sheet grammar.abnf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sheet/sheet grammar.abnf b/src/sheet/sheet grammar.abnf index b7b842e..3076f6b 100644 --- a/src/sheet/sheet grammar.abnf +++ b/src/sheet/sheet grammar.abnf @@ -31,20 +31,20 @@ bpm = "b" 1*DIGIT instrument = "i" ( "piano" / "violin" ) ; A note has three parts: octave, tone, and duration. -note = *1octave tone *1duration +note = tone *("/" tone) *1duration -octave = "o" 1*DIGIT +tone = *1octave ( "a" / "b" / "c" / "d" / "e" / "f" / "g" ) *1tone-shift -tone = ( "a" / "b" / "c" / "d" "e" / "f" / "g" ) *tone-shift +octave = "o" 1*DIGIT / 1*">" / 1*"<" ; Shifts the tone by some number of semitones -tone-shift = "+" / "-" +tone-shift = 1*"+" / 1*"-" ; A duration is either in the standard sheet notation or a precise ; duration. ; ; There are no overlaps between the two variants. -duration = 1*DIGIT *"." / "p" 1*DIGIT *1("." 1* DIGIT) +duration = *DIGIT *"." / "p" 1*DIGIT *1("." 1* DIGIT) cram-repetition = *1cram *1repetition -- cgit v1.2.3-18-g5258