1 ;Macros, substitue as {macro}
2 digit [0-9]
3 letter [a-zA-Z]
4 alphanum [a-zA-Z0-9\-]
5 whitespace [ 	] ;space and tab!
6 newline [^.] ;hehe... covers windows and linux CR \n as linefeed
7 sep	\|
8 durations Whole|Half|4th|8th|16th|32nd|64th|128th|256th
9 clefs Treble|Bass|Alto|Percussion|Tenor
10 
11 ; Das klappt alles so nicht. Ich muss Duration und so alles nochmal aufspalten in Werte und das dann im Parser zusammensetzen!
12 ; Möglichst viel eindeutig machen. Die Notendurations sind strings, also alle von hand eingeben. was ist mit punktiert?
13 ; Position muss errechnet werden zwischen der zahl aus der quelle sowie dem clef. Also clef kriegt eine absolute zahl und dann wird addiert, oder substrahiert. Der clef markiertja ne linie
14 
15 ; Es muss zwei Versionen geben. Eine der Beam und Stems und Barlines und son kram ignoriert und eine version, die das alles mitbeachtet.
16 
17 %%
18 ;Expressions
19 !NoteWorthyComposer\(.*\)	(yycontinue)
20 !NoteWorthyComposer-End		(yycontinue)
21 {sep}Note					(mtoken 'NEXTISNOTE yytext)
22 {sep}Dur:					(mtoken 'DURATION yytext)
23 {sep}Pos:					(mtoken 'POSITION yytext)
24 
25 
26 ;Metainfo
27 \|SongInfo.*{newline}		(yycontinue)
28 ;\|Title:					(mtoken 'TITLE yytext)
29 
30 {durations}					(mtoken 'DURATIONVALUE yytext)
31 ,Dotted						(mtoken 'DOTTED yytext)
32 ,DblDotted					(mtoken 'DOUBLEDOTTED yytext)
33 
34 Opts:Stem=Up				(yycontinue)
35 Opts:Stem=Down				(yycontinue)
36 Beam=First					(yycontinue)
37 Beam=End					(yycontinue)
38 Beam						(yycontinue)
39 
40 \|Clef\|Type:				(mtoken 'CLEF yytext)
41 {clefs}						(mtoken 'CLEFVALUE yytext)
42 OctaveShift:Octave\ Up		(mtoken 'CLEF8UP yytext)
43 OctaveShift:Octave\ Down	(mtoken 'CLEF8DOWN yytext)
44 
45 
46 
47 \|Bar{newline}				(yycontinue)
48 \|Bar\|Style:Double			(mtoken 'BAR-DOUBLE yytext)
49 
50 \|AddStaff					(mtoken 'STAFF yytext)
51 \|Name:						(mtoken 'STAFFNAME yytext)
52 \|Label:					(mtoken 'STAFFLABEL yytext)
53 
54 
55 [0-9\-]+						(mtoken 'NUMBER yytext)
56 [#bnvx]							(mtoken 'ALT yytext)
57 \"({alphanum}|{whitespace})+\"	(mtoken 'STRING yytext)
58 {digit}							(mtoken 'INTEGER yytext)
59 {letter}						(mtoken 'LETTER yytext)
60 \"								(mtoken 'DBLQUOTE yytext)
61 ({whitespace}|{newline})		(mtoken 'WHITESPACE yytext)
62 <<ERROR>>						(mtoken 'ERROR	yytext)
63 <<EOF>>							(make-lexical-token '*eoi* #f #f)
64 
65