/** * textblock-param ::= "obeylines" / ("fill" / "ragged") / ("align" / "justify") * / "skip" */ Rule TextblockParam() { return FirstOf("obeylines", "fill", "ragged", "align", "justify", "skip") .label(TextblockParam).suppressSubnodes(); } /**
/** * clef-line ::= "1" / "2" / "3" / "4" / "5" */ Rule ClefLine() { return FirstOf('1', '2', '3', '4', '5').label(ClefLine).suppressSubnodes(); } Rule ClefOctave() {
/** * accidental ::= "^" / "^^" / "_" / "__" / "=" * * + quarter tones */ Rule Accidental() { //TODO Accidental : microtones return FirstOf("^^", "^/", "^", "__", "_/", "_", "=", "^3/2", "^3/", "_3/2", "_3/") .label(_Accidental).suppressSubnodes(); } /**
/** * user definable symbols <tt>~, H-Y, h-w</tt> * * userdef-symbol ::= "~" / %x48-59 / %x68-77 */ Rule UserdefSymbol() { return AnyOf("~HIJKLMNOPQRSTUVWXYhijklmnopqrstuvw") //return FirstOf('~', CharRange('H', 'Y'), CharRange('h','w')) .label(UserdefSymbol).suppressSubnodes(); } /**
/** * repeat whole measure * * measure-repeat ::= "/" ["/"] */ Rule MeasureRepeat() { return Sequence('/', Optional('/')) .label(MeasureRepeat).suppressSubnodes(); } /**
/** * tex-escape ::= "\" 1*(VCHAR) * <p>to be defined better */ Rule TexEscape() { return Sequence('\\', OneOrMore(VCHAR()) ).label(TexEscape).suppressSubnodes(); }
Rule Boolean() { return FirstOf(IgnoreCase("yes"), IgnoreCase("no")) .label(Boolean).suppressSubnodes(); } /**
/** * lyrics-char-ifield ::= WSP / DIGIT / ALPHA / %x21-29 / %x2B-2C / %x2E-2F * / %x3A-40 / %x5B / %x5E / %x60 / %x7B-7D * <p>all characters without special meaning and except ] */ Rule LyricsCharIfield() { return FirstOf(DIGIT(), ALPHA(), AnyOf("!\"#$%&'()"+"+,"+"./"+":;<=>?@"+"[^`{}")) .label(LyricsChar).suppressSubnodes(); } /**
/** Alpha numeric value<br> * OneOrMore(FirstOf(ALPHA(), DIGIT())), suppress sub nodes */ Rule ALPHASandDIGITS() { return OneOrMore(FirstOf(ALPHA(), DIGIT())) .label(ALPHASandDIGITS).suppressSubnodes(); }
/** * e.g. m, 7, m7, +, mb5, sus, sus4, maj7, mmaj7, 7sus4, dim * * chord-type ::= 1*( ALPHA / DIGIT / "+" / "-" ) */ Rule ChordType() { return OneOrMore(FirstOf(ALPHA(), DIGIT(), '+', '-')) .label(ChordType).suppressSubnodes(); } /**
Rule LyricsSyllable() { return OneOrMore(FirstOf(LyricsChar(), TexEscape())) .label(LyricsSyllable).suppressSubnodes(); } Rule LyricsSyllableIfield() {
/** * lyrics-char ::= WSP / DIGIT / ALPHA / %x21-29 / %x2B-2C / %x2E-2F * / %x3A-40 / %x5B / %x5D / %x5E / %x60 / %x7B-7D * <p>all characters without special meaning */ Rule LyricsChar() { return FirstOf(DIGIT(), ALPHA(), AnyOf("!\"#$%&'()"+"+,"+"./"+":;<=>?@"+"[]^`{}")) .label(LyricsChar).suppressSubnodes(); } /**
Rule VoiceStems() { return SequenceS(IgnoreCase("stems="), FirstOf(IgnoreCase("up"), IgnoreCase("down")) .label(VoiceStems).suppressSubnodes() ); } Rule VoiceStaves() {
/** * nth-repeat-text ::= %x22 *non-quote %x22 */ Rule NthRepeatText() { return SequenceS(suppr("\""), ZeroOrMore(NonQuote()).label(NthRepeatText).suppressSubnodes(), suppr("\"")); } /**
/** * voice-transpose ::= "transpose=" ["-"] 1*DIGIT */ Rule VoiceTranspose() { return SequenceS( IgnoreCase("transpose="), Sequence( OptionalS(String("-")), DIGITS() ).label(VoiceTranspose).suppressSubnodes() ); } Rule VoiceMerge() {
/** * note-length ::= (*DIGIT ["/" *DIGIT]) / 1*"/" */ Rule NoteLength() { return Sequence(ZeroOrMoreS(DIGIT()), ZeroOrMoreS('/'), ZeroOrMoreS(DIGIT()) ).label(NoteLength).suppressSubnodes(); } /**
/** * xcom-number ::= 1*DIGIT ["." 1*DIGIT] */ Rule XcomNumber() { return Sequence(OneOrMore(DIGIT()), Optional(Sequence('.', OneOrMore(DIGIT()))) ).label(XcomNumber).suppressSubnodes(); } /**
/** * major ::= "maj" ["o" ["r"]] */ Rule Major() { return Sequence(IgnoreCase("maj"), Optional(Sequence(IgnoreCase("o"), Optional(IgnoreCase("r")) )) ).label(Major).suppressSubnodes(); } /**
Rule Parameter(String s) { return Sequence( String(s), String("="), OneOrMore(FirstOf("-", ALPHA(), DIGIT())) .label(ParameterValue).suppressSubnodes() ).label(Parameter); }
Rule IUnusedField() { return Sequence(String("["), AnyOf("EIJYabcdefghijklnopqrstvxyz") .label(UnusedFieldLetter).suppressSubnodes(), String(":"), ZeroOrMore(WSP()).suppressNode(), TexTextIfield(), String("]")) .label(IUnusedField); } /**