gabc-parser 0.1.1

A library for parsing, manipulating, and converting gabc files
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
file = { soi ~ (attribute ~ "\n")* ~ "%%\n" ~ (syllable | "\n")* ~ "\n"* ~ eoi }

attribute = { attribute_key ~ ":" ~ attribute_value ~ ";"}
attribute_key = { (!(":"|";") ~ any)* }
attribute_value = { (!(":"|";") ~ any)* }

clef = { ("c" | "f") ~ ('1'..'4') }
barline = { ( ";" ~ ('1'..'6') | ";" | "::" | ":?" | ":'" | ":" | ",_" | ",0" | "," | "'" | "`" ) }
spacer = { ( "!" | "@" | "/" | "//" | "/0" | "/[" ~ "-"? ~ ('0'..'9') ~ "]"  | " " ) }
note = { prefix* ~ position ~ suffix* }
prefix = { "-" }
position = { ('a'..'m') | ('A'..'M') }
suffix = { ("~" | ">" | "<" | "v" | "V" | "o~" | "o<" | "o" | "w" | "s<" | "s" | "x" | "y" | "#" | ".." | "." | "'" | "_" ) }
syllable = { string ~ "(" ~ (clef | note | barline | spacer)* ~ ")" }

string = { (!("(") ~ any)* }