@k-l-lambda/lilylet 0.1.49 → 0.1.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/abc/abc.d.ts +102 -0
- package/lib/abc/abc.js +25 -0
- package/lib/abc/grammar.jison.js +1203 -0
- package/lib/abc/parser.d.ts +3 -0
- package/lib/abc/parser.js +6 -0
- package/lib/abcDecoder.d.ts +1 -0
- package/lib/abcDecoder.js +1 -0
- package/lib/grammar.jison.js +1 -1303
- package/lib/index.d.ts +1 -8
- package/lib/index.js +1 -10
- package/lib/lilylet/abcDecoder.d.ts +25 -0
- package/lib/lilylet/abcDecoder.js +1007 -0
- package/lib/lilylet/grammar.jison.js +1308 -0
- package/lib/lilylet/index.d.ts +10 -0
- package/lib/lilylet/index.js +10 -0
- package/lib/lilylet/lilypondDecoder.d.ts +29 -0
- package/lib/lilylet/lilypondDecoder.js +1053 -0
- package/lib/lilylet/lilypondEncoder.d.ts +34 -0
- package/lib/lilylet/lilypondEncoder.js +759 -0
- package/lib/lilylet/meiEncoder.d.ts +8 -0
- package/lib/lilylet/meiEncoder.js +1813 -0
- package/lib/lilylet/musicXmlDecoder.d.ts +20 -0
- package/lib/lilylet/musicXmlDecoder.js +1195 -0
- package/lib/lilylet/musicXmlEncoder.d.ts +15 -0
- package/lib/lilylet/musicXmlEncoder.js +701 -0
- package/lib/lilylet/musicXmlTypes.d.ts +199 -0
- package/lib/lilylet/musicXmlTypes.js +7 -0
- package/lib/lilylet/musicXmlUtils.d.ts +92 -0
- package/lib/lilylet/musicXmlUtils.js +469 -0
- package/lib/lilylet/parser.d.ts +3 -0
- package/lib/lilylet/parser.js +151 -0
- package/lib/lilylet/serializer.d.ts +11 -0
- package/lib/lilylet/serializer.js +702 -0
- package/lib/lilylet/types.d.ts +245 -0
- package/lib/lilylet/types.js +99 -0
- package/lib/lilypondDecoder.d.ts +1 -29
- package/lib/lilypondDecoder.js +1 -1006
- package/lib/lilypondEncoder.d.ts +1 -34
- package/lib/lilypondEncoder.js +1 -759
- package/lib/meiEncoder.d.ts +1 -8
- package/lib/meiEncoder.js +1 -1545
- package/lib/musicXmlDecoder.d.ts +1 -20
- package/lib/musicXmlDecoder.js +1 -1151
- package/lib/musicXmlEncoder.d.ts +1 -15
- package/lib/musicXmlEncoder.js +1 -666
- package/lib/musicXmlTypes.d.ts +1 -199
- package/lib/musicXmlTypes.js +1 -7
- package/lib/musicXmlUtils.d.ts +1 -81
- package/lib/musicXmlUtils.js +1 -435
- package/lib/parser.d.ts +1 -3
- package/lib/parser.js +1 -151
- package/lib/serializer.d.ts +1 -11
- package/lib/serializer.js +1 -650
- package/lib/types.d.ts +1 -244
- package/lib/types.js +1 -99
- package/package.json +2 -1
- package/source/abc/abc.jison +692 -0
- package/source/abc/abc.ts +176 -0
- package/source/abc/grammar.jison.js +1203 -0
- package/source/abc/parser.ts +12 -0
- package/source/lilylet/abcDecoder.ts +1121 -0
- package/source/lilylet/grammar.jison.js +195 -190
- package/source/lilylet/index.ts +4 -3
- package/source/lilylet/lilylet.jison +10 -3
- package/source/lilylet/lilypondDecoder.ts +91 -41
- package/source/lilylet/meiEncoder.ts +284 -0
- package/source/lilylet/musicXmlDecoder.ts +74 -27
- package/source/lilylet/musicXmlEncoder.ts +201 -146
- package/source/lilylet/musicXmlUtils.ts +46 -4
- package/source/lilylet/serializer.ts +75 -21
- package/source/lilylet/types.ts +1 -0
|
@@ -0,0 +1,1203 @@
|
|
|
1
|
+
/* parser generated by jison 0.4.18 */
|
|
2
|
+
/*
|
|
3
|
+
Returns a Parser object of the following structure:
|
|
4
|
+
|
|
5
|
+
Parser: {
|
|
6
|
+
yy: {}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
Parser.prototype: {
|
|
10
|
+
yy: {},
|
|
11
|
+
trace: function(),
|
|
12
|
+
symbols_: {associative list: name ==> number},
|
|
13
|
+
terminals_: {associative list: number ==> name},
|
|
14
|
+
productions_: [...],
|
|
15
|
+
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
|
|
16
|
+
table: [...],
|
|
17
|
+
defaultActions: {...},
|
|
18
|
+
parseError: function(str, hash),
|
|
19
|
+
parse: function(input),
|
|
20
|
+
|
|
21
|
+
lexer: {
|
|
22
|
+
EOF: 1,
|
|
23
|
+
parseError: function(str, hash),
|
|
24
|
+
setInput: function(input),
|
|
25
|
+
input: function(),
|
|
26
|
+
unput: function(str),
|
|
27
|
+
more: function(),
|
|
28
|
+
less: function(n),
|
|
29
|
+
pastInput: function(),
|
|
30
|
+
upcomingInput: function(),
|
|
31
|
+
showPosition: function(),
|
|
32
|
+
test_match: function(regex_match_array, rule_index),
|
|
33
|
+
next: function(),
|
|
34
|
+
lex: function(),
|
|
35
|
+
begin: function(condition),
|
|
36
|
+
popState: function(),
|
|
37
|
+
_currentRules: function(),
|
|
38
|
+
topState: function(),
|
|
39
|
+
pushState: function(condition),
|
|
40
|
+
|
|
41
|
+
options: {
|
|
42
|
+
ranges: boolean (optional: true ==> token location info will include a .range[] member)
|
|
43
|
+
flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
|
|
44
|
+
backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
|
|
48
|
+
rules: [...],
|
|
49
|
+
conditions: {associative list: name ==> set},
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
token location info (@$, _$, etc.): {
|
|
55
|
+
first_line: n,
|
|
56
|
+
last_line: n,
|
|
57
|
+
first_column: n,
|
|
58
|
+
last_column: n,
|
|
59
|
+
range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
the parseError function receives a 'hash' object with these members for lexer and parser errors: {
|
|
64
|
+
text: (matched text)
|
|
65
|
+
token: (the produced terminal token, if any)
|
|
66
|
+
line: (yylineno)
|
|
67
|
+
}
|
|
68
|
+
while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
|
|
69
|
+
loc: (yylloc)
|
|
70
|
+
expected: (string describing the set of expected tokens)
|
|
71
|
+
recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
|
|
72
|
+
}
|
|
73
|
+
*/
|
|
74
|
+
Object.defineProperty(globalThis, "__abcGrammar__", { value: (function(){
|
|
75
|
+
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,12],$V1=[1,8],$V2=[1,9],$V3=[1,10],$V4=[1,11],$V5=[5,16,26,28,29,31],$V6=[2,99],$V7=[1,21],$V8=[1,22],$V9=[5,13,14,15,16,17,21,23,24,25,26,28,29,31,32,41,45,56,57,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],$Va=[5,13,14,15,16,17,21,23,24,25,26,28,29,31,32,41,45,56,57,59,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],$Vb=[2,57],$Vc=[2,59],$Vd=[5,13,14,15,16,21,23,24,25,26,28,29,31,32,41,45,56,57,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],$Ve=[1,55],$Vf=[1,54],$Vg=[1,63],$Vh=[1,62],$Vi=[1,69],$Vj=[1,51],$Vk=[1,93],$Vl=[1,57],$Vm=[1,77],$Vn=[1,50],$Vo=[1,86],$Vp=[1,94],$Vq=[1,52],$Vr=[1,56],$Vs=[1,58],$Vt=[1,59],$Vu=[1,66],$Vv=[1,67],$Vw=[1,68],$Vx=[1,70],$Vy=[1,71],$Vz=[1,72],$VA=[1,73],$VB=[1,74],$VC=[1,75],$VD=[1,76],$VE=[1,82],$VF=[1,81],$VG=[1,85],$VH=[1,88],$VI=[1,89],$VJ=[1,90],$VK=[5,14,15,16,23,24,25,26,28,29,31,41,45,56,57,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],$VL=[1,104],$VM=[1,105],$VN=[1,106],$VO=[1,107],$VP=[1,108],$VQ=[5,13,14,15,16,17,21,23,24,25,26,28,29,31,32,45,56,57,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],$VR=[1,115],$VS=[1,111],$VT=[1,112],$VU=[1,113],$VV=[1,114],$VW=[1,124],$VX=[1,129],$VY=[1,128],$VZ=[1,130],$V_=[1,131],$V$=[1,132],$V01=[1,127],$V11=[1,134],$V21=[5,13,14,15,16,21,23,24,25,26,28,29,31,32,41,45,56,57,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],$V31=[2,115],$V41=[1,144],$V51=[1,145],$V61=[1,150],$V71=[1,153],$V81=[1,152],$V91=[5,13,14,15,16,21,23,24,25,26,28,29,31,32,41,45,56,57,61,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],$Va1=[1,181],$Vb1=[24,45,68],$Vc1=[1,188],$Vd1=[1,189],$Ve1=[5,13,14,15,16,21,23,24,25,26,28,29,31,32,41,45,56,57,61,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,123,124,125,129,130,131],$Vf1=[2,76],$Vg1=[1,195],$Vh1=[5,13,14,15,16,17,21,22,23,24,25,26,28,29,31,32,41,45,56,57,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],$Vi1=[5,13,14,15,16,17,21,23,24,25,26,28,29,31,32,41,45,53,54,56,57,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],$Vj1=[1,200],$Vk1=[1,209],$Vl1=[1,207],$Vm1=[1,208],$Vn1=[5,13,14,15,16,17,21,23,24,25,26,28,29,31,32,41,45,56,57,61,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],$Vo1=[5,13,14,15,16,21,23,24,25,26,28,29,31,41,45,56,57,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],$Vp1=[14,15,23,24,31,45,56,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,125,129,130,131],$Vq1=[13,15,24,45,63,68,80,82,125,129,130,131],$Vr1=[15,23,85],$Vs1=[62,85],$Vt1=[56,61,85],$Vu1=[85,111,112],$Vv1=[15,23],$Vw1=[5,13,14,15,16,21,23,24,25,26,28,29,31,32,41,45,56,57,61,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,123,125,129,130,131],$Vx1=[5,13,14,15,16,21,23,24,25,26,28,29,31,32,41,45,56,57,61,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,124,125,129,130,131],$Vy1=[5,13,14,15,16,17,21,23,24,25,26,28,29,31,32,41,45,56,57,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131];
|
|
76
|
+
var parser = {trace: function trace () { },
|
|
77
|
+
yy: {},
|
|
78
|
+
symbols_: {"error":2,"start_symbol":3,"tunes":4,"EOF":5,"tune":6,"header":7,"body":8,"head_lines":9,"head_line":10,"comment":11,"staff_layout_statement":12,"]":13,"}":14,")":15,"COMMENT":16,"SCORE":17,"staff_layout":18,"staff_layout_items":19,"staff_layout_item":20,"|":21,"NN":22,"(":23,"[":24,"{":25,"T:":26,"string_content":27,"C:":28,"K:":29,"key_signature":30,"H":31,":":32,"header_value":33,"string":34,"number":35,"frac":36,"numeric_tempo":37,"upper_phonet":38,"voice_exp":39,"staff_shift":40,"NAME":41,"clef":42,"STAFF":43,"plus_minus_number":44,"A":45,"sharp_or_flat":46,"key_mode":47,"TREBLE":48,"BASS":49,"TENOR":50,"SHARP":51,"FLAT":52,"MAJ":53,"MIN":54,"+":55,"-":56,"STR_START":57,"STR_END":58,"STR_CONTENT":59,"patches":60,"/":61,"N":62,"=":63,"assigns":64,"assign":65,"assign_value":66,"lower_phonet":67,"a":68,"patch":69,"bar":70,"tailless_patch":71,"music":72,"expressive_mark":73,"text":74,"event":75,"grace_events":76,"control":77,"broken_rhythm":78,"triplet":79,"^":80,"articulation":81,".":82,"O":83,"S":84,"!":85,"articulation_content":86,"directive_text":87,"P":88,"T":89,"J":90,"L":91,"M":92,"R":93,"u":94,"v":95,"~":96,"scope_articulation":97,"parenthese":98,"DYNAMIC":99,"fingering_numbers":100,"tremolo":101,"dc":102,"al":103,"octave_shift":104,"8va":105,"8vb":106,"15ma":107,"15mb":108,"D.C.":109,"D.S.":110,"alcoda":111,"alfine":112,"<":113,">":114,"pitch_or_chord":115,"pitch":116,"chord":117,"accidentals":118,"pitches":119,"quotes":120,"sub_quotes":121,"sup_quotes":122,",":123,"'":124,"_":125,"acc_pitch":126,"rest_phonet":127,"phonet":128,"z":129,"Z":130,"x":131,"duration":132,"events":133,"grace_music":134,"broken_right":135,"broken_left":136,"$accept":0,"$end":1},
|
|
79
|
+
terminals_: {2:"error",5:"EOF",13:"]",14:"}",15:")",16:"COMMENT",17:"SCORE",21:"|",22:"NN",23:"(",24:"[",25:"{",26:"T:",28:"C:",29:"K:",31:"H",32:":",41:"NAME",43:"STAFF",45:"A",48:"TREBLE",49:"BASS",50:"TENOR",51:"SHARP",52:"FLAT",53:"MAJ",54:"MIN",55:"+",56:"-",57:"STR_START",58:"STR_END",59:"STR_CONTENT",61:"/",62:"N",63:"=",68:"a",80:"^",82:".",83:"O",84:"S",85:"!",88:"P",89:"T",90:"J",91:"L",92:"M",93:"R",94:"u",95:"v",96:"~",99:"DYNAMIC",105:"8va",106:"8vb",107:"15ma",108:"15mb",109:"D.C.",110:"D.S.",111:"alcoda",112:"alfine",113:"<",114:">",123:",",124:"'",125:"_",129:"z",130:"Z",131:"x"},
|
|
80
|
+
productions_: [0,[3,2],[4,1],[4,2],[6,2],[7,1],[9,1],[9,1],[9,2],[9,2],[9,2],[9,2],[9,2],[9,2],[11,1],[12,2],[18,1],[19,1],[19,2],[19,2],[20,1],[20,3],[20,3],[20,3],[20,3],[20,3],[10,2],[10,2],[10,2],[10,3],[33,1],[33,1],[33,1],[33,1],[33,1],[33,1],[33,1],[33,1],[33,1],[33,1],[40,2],[40,2],[30,1],[30,2],[30,2],[30,3],[42,1],[42,1],[42,1],[46,1],[46,1],[47,1],[47,1],[47,1],[44,2],[44,2],[34,3],[27,0],[27,2],[8,1],[36,3],[35,1],[35,2],[37,3],[39,1],[39,2],[39,3],[39,1],[39,2],[64,1],[64,2],[65,3],[66,1],[66,1],[66,1],[66,1],[38,1],[67,1],[60,1],[60,2],[60,2],[60,2],[60,1],[60,2],[60,2],[60,2],[69,2],[71,1],[70,1],[70,2],[70,2],[70,2],[70,3],[70,4],[70,2],[70,2],[70,3],[70,2],[70,3],[72,0],[72,2],[72,2],[72,2],[72,2],[72,2],[72,2],[72,2],[72,2],[72,2],[72,3],[72,2],[77,5],[77,4],[77,5],[73,1],[73,1],[73,1],[73,1],[73,1],[73,1],[73,1],[81,3],[81,3],[81,1],[81,1],[81,1],[81,1],[81,1],[81,1],[81,1],[81,1],[81,1],[81,1],[86,1],[86,2],[86,1],[86,1],[86,1],[86,1],[86,1],[86,2],[100,1],[100,2],[101,1],[101,2],[87,1],[87,2],[87,2],[87,2],[104,1],[104,1],[104,1],[104,1],[102,1],[102,1],[103,1],[103,1],[97,1],[97,1],[97,1],[98,1],[98,1],[74,1],[115,1],[115,1],[115,2],[117,3],[117,3],[117,2],[119,1],[119,2],[119,2],[119,3],[119,2],[119,3],[119,4],[119,3],[119,2],[120,1],[120,1],[121,1],[121,2],[122,1],[122,2],[118,1],[118,1],[118,1],[118,2],[118,2],[118,2],[116,1],[116,2],[116,1],[126,1],[126,2],[126,2],[126,3],[128,1],[128,1],[127,1],[127,1],[127,1],[75,1],[75,2],[133,1],[133,2],[76,3],[76,4],[134,1],[134,2],[134,2],[134,2],[134,2],[134,2],[132,3],[132,2],[132,1],[132,1],[78,1],[78,1],[135,1],[135,2],[136,1],[136,2],[79,6],[79,4],[79,2]],
|
|
81
|
+
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
|
82
|
+
/* this == yyval */
|
|
83
|
+
|
|
84
|
+
var $0 = $$.length - 1;
|
|
85
|
+
switch (yystate) {
|
|
86
|
+
case 1:
|
|
87
|
+
return $$[$0-1];
|
|
88
|
+
break;
|
|
89
|
+
case 2: case 6: case 7: case 17: case 78: case 79: case 82: case 169: case 171: case 173: case 176: case 204: case 208:
|
|
90
|
+
this.$ = [$$[$0]];
|
|
91
|
+
break;
|
|
92
|
+
case 3: case 8: case 9: case 10: case 18: case 80: case 83: case 170: case 205: case 210: case 211: case 212:
|
|
93
|
+
this.$ = [...$$[$0-1], $$[$0]];
|
|
94
|
+
break;
|
|
95
|
+
case 4:
|
|
96
|
+
this.$ = tune($$[$0-1], $$[$0]);
|
|
97
|
+
break;
|
|
98
|
+
case 11: case 12: case 13: case 19: case 56: case 81: case 84: case 85: case 107: case 108: case 110: case 121: case 122: case 177:
|
|
99
|
+
this.$ = $$[$0-1];
|
|
100
|
+
break;
|
|
101
|
+
case 14:
|
|
102
|
+
this.$ = comment($$[$0]);
|
|
103
|
+
break;
|
|
104
|
+
case 15: case 69: case 165:
|
|
105
|
+
this.$ = $$[$0];
|
|
106
|
+
break;
|
|
107
|
+
case 16:
|
|
108
|
+
this.$ = ({staffLayout: $$[$0]});
|
|
109
|
+
break;
|
|
110
|
+
case 20:
|
|
111
|
+
this.$ = staffGroup([$$[$0]]);
|
|
112
|
+
break;
|
|
113
|
+
case 21:
|
|
114
|
+
this.$ = staffGroup($$[$0-1], 'arc');
|
|
115
|
+
break;
|
|
116
|
+
case 22: case 24:
|
|
117
|
+
this.$ = staffGroup($$[$0-1], 'square');
|
|
118
|
+
break;
|
|
119
|
+
case 23: case 25:
|
|
120
|
+
this.$ = staffGroup($$[$0-1], 'curly');
|
|
121
|
+
break;
|
|
122
|
+
case 26:
|
|
123
|
+
this.$ = header('T', $$[$0]);
|
|
124
|
+
break;
|
|
125
|
+
case 27:
|
|
126
|
+
this.$ = header('C', $$[$0]);
|
|
127
|
+
break;
|
|
128
|
+
case 28:
|
|
129
|
+
this.$ = header('K', $$[$0]);
|
|
130
|
+
break;
|
|
131
|
+
case 29:
|
|
132
|
+
this.$ = header($$[$0-2], $$[$0]);
|
|
133
|
+
break;
|
|
134
|
+
case 40: case 41:
|
|
135
|
+
this.$ = staffShift($$[$0]);
|
|
136
|
+
break;
|
|
137
|
+
case 42:
|
|
138
|
+
this.$ = key($$[$0], null);
|
|
139
|
+
break;
|
|
140
|
+
case 43:
|
|
141
|
+
this.$ = key($$[$0-1] + $$[$0], null);
|
|
142
|
+
break;
|
|
143
|
+
case 44:
|
|
144
|
+
this.$ = key($$[$0-1], $$[$0]);
|
|
145
|
+
break;
|
|
146
|
+
case 45:
|
|
147
|
+
this.$ = key($$[$0-2] + $$[$0-1], $$[$0]);
|
|
148
|
+
break;
|
|
149
|
+
case 46: case 47: case 48:
|
|
150
|
+
this.$ = clef($$[$0]);
|
|
151
|
+
break;
|
|
152
|
+
case 49:
|
|
153
|
+
this.$ = '#';
|
|
154
|
+
break;
|
|
155
|
+
case 50:
|
|
156
|
+
this.$ = 'b';
|
|
157
|
+
break;
|
|
158
|
+
case 51:
|
|
159
|
+
this.$ = 'major';
|
|
160
|
+
break;
|
|
161
|
+
case 52:
|
|
162
|
+
this.$ = 'minor';
|
|
163
|
+
break;
|
|
164
|
+
case 53:
|
|
165
|
+
this.$ = $$[$0].startsWith("ma") ? "major" : "minor";
|
|
166
|
+
break;
|
|
167
|
+
case 54: case 61:
|
|
168
|
+
this.$ = Number($$[$0]);
|
|
169
|
+
break;
|
|
170
|
+
case 55:
|
|
171
|
+
this.$ = -Number($$[$0]);
|
|
172
|
+
break;
|
|
173
|
+
case 58:
|
|
174
|
+
this.$ = $$[$0-1] ? $$[$0-1] + $$[$0] : $$[$0];
|
|
175
|
+
break;
|
|
176
|
+
case 59:
|
|
177
|
+
this.$ = ({patches: $$[$0]});
|
|
178
|
+
break;
|
|
179
|
+
case 60:
|
|
180
|
+
this.$ = frac($$[$0-2], $$[$0]);
|
|
181
|
+
break;
|
|
182
|
+
case 62:
|
|
183
|
+
this.$ = $$[$0-1] * 10 + Number($$[$0]);
|
|
184
|
+
break;
|
|
185
|
+
case 63:
|
|
186
|
+
this.$ = tempo($$[$0-2], $$[$0]);
|
|
187
|
+
break;
|
|
188
|
+
case 64:
|
|
189
|
+
this.$ = voice($$[$0]);
|
|
190
|
+
break;
|
|
191
|
+
case 65:
|
|
192
|
+
this.$ = voice($$[$0-1], $$[$0]);
|
|
193
|
+
break;
|
|
194
|
+
case 66:
|
|
195
|
+
this.$ = voice($$[$0-2], $$[$0-1], $$[$0]);
|
|
196
|
+
break;
|
|
197
|
+
case 67:
|
|
198
|
+
this.$ = voice(1, $$[$0]);
|
|
199
|
+
break;
|
|
200
|
+
case 68:
|
|
201
|
+
this.$ = voice(1, $$[$0-1], $$[$0]);
|
|
202
|
+
break;
|
|
203
|
+
case 70:
|
|
204
|
+
this.$ = ({...$$[$0-1], ...$$[$0]});
|
|
205
|
+
break;
|
|
206
|
+
case 71:
|
|
207
|
+
this.$ = assign($$[$0-2], $$[$0]);
|
|
208
|
+
break;
|
|
209
|
+
case 86:
|
|
210
|
+
this.$ = patch($$[$0-1], $$[$0]);
|
|
211
|
+
break;
|
|
212
|
+
case 87:
|
|
213
|
+
this.$ = patch($$[$0], null);
|
|
214
|
+
break;
|
|
215
|
+
case 88:
|
|
216
|
+
this.$ = '|';
|
|
217
|
+
break;
|
|
218
|
+
case 89:
|
|
219
|
+
this.$ = '|:';
|
|
220
|
+
break;
|
|
221
|
+
case 90:
|
|
222
|
+
this.$ = ':|';
|
|
223
|
+
break;
|
|
224
|
+
case 91: case 92: case 93:
|
|
225
|
+
this.$ = ':|:';
|
|
226
|
+
break;
|
|
227
|
+
case 94:
|
|
228
|
+
this.$ = '||';
|
|
229
|
+
break;
|
|
230
|
+
case 95:
|
|
231
|
+
this.$ = '|]';
|
|
232
|
+
break;
|
|
233
|
+
case 96:
|
|
234
|
+
this.$ = ':|]';
|
|
235
|
+
break;
|
|
236
|
+
case 97:
|
|
237
|
+
this.$ = '|' + $$[$0];
|
|
238
|
+
break;
|
|
239
|
+
case 98:
|
|
240
|
+
this.$ = ':|' + $$[$0-1];
|
|
241
|
+
break;
|
|
242
|
+
case 100: case 101: case 102: case 103: case 104: case 106:
|
|
243
|
+
this.$ = $$[$0-1] ? [...$$[$0-1], $$[$0]] : [$$[$0]];
|
|
244
|
+
break;
|
|
245
|
+
case 105:
|
|
246
|
+
Object.assign($$[$0-1].at(-1), $$[$0]); this.$ = $$[$0-1];
|
|
247
|
+
break;
|
|
248
|
+
case 109:
|
|
249
|
+
this.$ = $$[$0-2];
|
|
250
|
+
break;
|
|
251
|
+
case 111: case 113:
|
|
252
|
+
this.$ = ({control: header($$[$0-3], $$[$0-1])});
|
|
253
|
+
break;
|
|
254
|
+
case 112:
|
|
255
|
+
this.$ = ({control: header("K", $$[$0-1])});
|
|
256
|
+
break;
|
|
257
|
+
case 115: case 116: case 117: case 118:
|
|
258
|
+
this.$ = ({express: $$[$0]});
|
|
259
|
+
break;
|
|
260
|
+
case 119:
|
|
261
|
+
this.$ = ({express: "coda"});
|
|
262
|
+
break;
|
|
263
|
+
case 120:
|
|
264
|
+
this.$ = ({express: "segno"});
|
|
265
|
+
break;
|
|
266
|
+
case 123:
|
|
267
|
+
this.$ = articulation("prall");
|
|
268
|
+
break;
|
|
269
|
+
case 124:
|
|
270
|
+
this.$ = articulation("trill");
|
|
271
|
+
break;
|
|
272
|
+
case 125:
|
|
273
|
+
this.$ = articulation("fermata");
|
|
274
|
+
break;
|
|
275
|
+
case 126:
|
|
276
|
+
this.$ = articulation("slide");
|
|
277
|
+
break;
|
|
278
|
+
case 127:
|
|
279
|
+
this.$ = articulation("accent");
|
|
280
|
+
break;
|
|
281
|
+
case 128: case 132:
|
|
282
|
+
this.$ = articulation("mordent");
|
|
283
|
+
break;
|
|
284
|
+
case 129:
|
|
285
|
+
this.$ = articulation("roll");
|
|
286
|
+
break;
|
|
287
|
+
case 130:
|
|
288
|
+
this.$ = articulation("upbow");
|
|
289
|
+
break;
|
|
290
|
+
case 131:
|
|
291
|
+
this.$ = articulation("downbow");
|
|
292
|
+
break;
|
|
293
|
+
case 133: case 135: case 136: case 137:
|
|
294
|
+
this.$ = articulation($$[$0]);
|
|
295
|
+
break;
|
|
296
|
+
case 134:
|
|
297
|
+
this.$ = articulation($$[$0-1], $$[$0]);
|
|
298
|
+
break;
|
|
299
|
+
case 138:
|
|
300
|
+
this.$ = ({fingering: Number($$[$0])});
|
|
301
|
+
break;
|
|
302
|
+
case 139:
|
|
303
|
+
this.$ = ({tremolo: $$[$0]});
|
|
304
|
+
break;
|
|
305
|
+
case 140:
|
|
306
|
+
this.$ = ({tremolo: $$[$0-1]}) // unknown meaning of '-'?;
|
|
307
|
+
break;
|
|
308
|
+
case 141:
|
|
309
|
+
this.$ = String($$[$0]);
|
|
310
|
+
break;
|
|
311
|
+
case 142:
|
|
312
|
+
this.$ = $$[$0-1] + $$[$0];
|
|
313
|
+
break;
|
|
314
|
+
case 143: case 150: case 182: case 184: case 220:
|
|
315
|
+
this.$ = 1;
|
|
316
|
+
break;
|
|
317
|
+
case 144: case 183: case 221:
|
|
318
|
+
this.$ = $$[$0-1] + 1;
|
|
319
|
+
break;
|
|
320
|
+
case 145:
|
|
321
|
+
this.$ = ({directive: $$[$0]});
|
|
322
|
+
break;
|
|
323
|
+
case 146:
|
|
324
|
+
this.$ = ({directive: `${$$[$0-1]} ${$$[$0]}`});
|
|
325
|
+
break;
|
|
326
|
+
case 147:
|
|
327
|
+
this.$ = octaveShift($$[$0-1]);
|
|
328
|
+
break;
|
|
329
|
+
case 148:
|
|
330
|
+
this.$ = octaveShift(0);
|
|
331
|
+
break;
|
|
332
|
+
case 149: case 180: case 185: case 222:
|
|
333
|
+
this.$ = -1;
|
|
334
|
+
break;
|
|
335
|
+
case 151: case 188:
|
|
336
|
+
this.$ = -2;
|
|
337
|
+
break;
|
|
338
|
+
case 152: case 187:
|
|
339
|
+
this.$ = 2;
|
|
340
|
+
break;
|
|
341
|
+
case 155:
|
|
342
|
+
this.$ = "al coda";
|
|
343
|
+
break;
|
|
344
|
+
case 156:
|
|
345
|
+
this.$ = "al fine";
|
|
346
|
+
break;
|
|
347
|
+
case 162:
|
|
348
|
+
this.$ = ({text: $$[$0]});
|
|
349
|
+
break;
|
|
350
|
+
case 163:
|
|
351
|
+
this.$ = chord([$$[$0]]);
|
|
352
|
+
break;
|
|
353
|
+
case 166:
|
|
354
|
+
this.$ = chord($$[$0-1]);
|
|
355
|
+
break;
|
|
356
|
+
case 167: case 168:
|
|
357
|
+
this.$ = chord([]);
|
|
358
|
+
break;
|
|
359
|
+
case 172: case 174:
|
|
360
|
+
this.$ = [...$$[$0-2], $$[$0]];
|
|
361
|
+
break;
|
|
362
|
+
case 175:
|
|
363
|
+
this.$ = [...$$[$0-3], $$[$0]];
|
|
364
|
+
break;
|
|
365
|
+
case 181: case 223:
|
|
366
|
+
this.$ = $$[$0-1] - 1;
|
|
367
|
+
break;
|
|
368
|
+
case 186: case 189:
|
|
369
|
+
this.$ = 0;
|
|
370
|
+
break;
|
|
371
|
+
case 191:
|
|
372
|
+
$$[$0-1].tie = true; this.$ = $$[$0-1];
|
|
373
|
+
break;
|
|
374
|
+
case 192: case 193:
|
|
375
|
+
this.$ = pitch(null, $$[$0], 0);
|
|
376
|
+
break;
|
|
377
|
+
case 194:
|
|
378
|
+
this.$ = pitch(null, $$[$0-1], $$[$0]);
|
|
379
|
+
break;
|
|
380
|
+
case 195:
|
|
381
|
+
this.$ = pitch($$[$0-1], $$[$0], 0);
|
|
382
|
+
break;
|
|
383
|
+
case 196:
|
|
384
|
+
this.$ = pitch($$[$0-2], $$[$0-1], $$[$0]);
|
|
385
|
+
break;
|
|
386
|
+
case 202:
|
|
387
|
+
this.$ = ({event: event($$[$0])});
|
|
388
|
+
break;
|
|
389
|
+
case 203:
|
|
390
|
+
this.$ = ({event: event($$[$0-1], $$[$0])});
|
|
391
|
+
break;
|
|
392
|
+
case 206:
|
|
393
|
+
this.$ = grace($$[$0-1]);
|
|
394
|
+
break;
|
|
395
|
+
case 207:
|
|
396
|
+
this.$ = grace($$[$0-1], true);
|
|
397
|
+
break;
|
|
398
|
+
case 209: case 213:
|
|
399
|
+
this.$ = [$$[$0-1], $$[$0]];
|
|
400
|
+
break;
|
|
401
|
+
case 214:
|
|
402
|
+
this.$ = frac(Number($$[$0-2]), Number($$[$0]));
|
|
403
|
+
break;
|
|
404
|
+
case 215:
|
|
405
|
+
this.$ = frac(1, Number($$[$0]));
|
|
406
|
+
break;
|
|
407
|
+
case 216:
|
|
408
|
+
this.$ = frac(Number($$[$0]));
|
|
409
|
+
break;
|
|
410
|
+
case 217:
|
|
411
|
+
this.$ = frac(1, 2);
|
|
412
|
+
break;
|
|
413
|
+
case 218: case 219:
|
|
414
|
+
this.$ = ({broken: $$[$0]});
|
|
415
|
+
break;
|
|
416
|
+
case 224:
|
|
417
|
+
this.$ = ({triplet: $$[$0-4], multiplier: $$[$0-2], n: $$[$0]});
|
|
418
|
+
break;
|
|
419
|
+
case 225:
|
|
420
|
+
this.$ = ({triplet: $$[$0-2], multiplier: $$[$0]});
|
|
421
|
+
break;
|
|
422
|
+
case 226:
|
|
423
|
+
this.$ = ({triplet: $$[$0]});
|
|
424
|
+
break;
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
table: [{3:1,4:2,6:3,7:4,9:5,10:6,11:7,16:$V0,26:$V1,28:$V2,29:$V3,31:$V4},{1:[3]},{5:[1,13],6:14,7:4,9:5,10:6,11:7,16:$V0,26:$V1,28:$V2,29:$V3,31:$V4},o($V5,[2,2]),o([5,13,14,15,16,23,24,25,26,28,29,31,41,45,56,57,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],$V6,{8:15,60:16,69:17,70:18,71:19,72:20,21:$V7,32:$V8}),o([5,21,23,24,25,32,41,45,56,57,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],[2,5],{10:23,11:24,12:25,13:[1,26],14:[1,27],15:[1,28],16:$V0,17:[1,29],26:$V1,28:$V2,29:$V3,31:$V4}),o($V9,[2,6]),o($V9,[2,7]),o($Va,$Vb,{27:30}),o($Va,$Vb,{27:31}),{30:32,45:[1,33]},{32:[1,34]},o($V9,[2,14]),{1:[2,1]},o($V5,[2,3]),o($V5,[2,4]),o([15,21,23,24,25,32,41,45,56,57,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],$V6,{72:20,69:35,11:36,71:37,5:$Vc,26:$Vc,28:$Vc,29:$Vc,31:$Vc,13:[1,38],14:[1,39],16:$V0}),o($Vd,[2,78]),o([15,21,23,24,25,31,32,41,45,56,57,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],$V6,{69:40,72:41}),o($Vd,[2,82]),o([5,13,14,16,26,28,29],[2,87],{70:42,73:43,74:44,75:45,76:46,77:47,78:48,79:49,81:53,34:60,115:61,135:64,136:65,116:78,117:79,118:80,126:83,127:84,128:87,38:91,67:92,15:$Ve,21:$V7,23:$Vf,24:$Vg,25:$Vh,31:$Vi,32:$V8,41:$Vj,45:$Vk,56:$Vl,57:$Vm,62:$Vn,63:$Vo,68:$Vp,80:$Vq,82:$Vr,83:$Vs,84:$Vt,85:$Vu,88:$Vv,89:$Vw,90:$Vx,91:$Vy,92:$Vz,93:$VA,94:$VB,95:$VC,96:$VD,113:$VE,114:$VF,125:$VG,129:$VH,130:$VI,131:$VJ}),o($VK,[2,88],{13:[1,97],21:[1,96],32:[1,95],62:[1,98]}),{21:[1,99],32:[1,100]},o($V9,[2,8]),o($V9,[2,9]),o($V9,[2,10]),o($V9,[2,11]),o($V9,[2,12]),o($V9,[2,13]),{18:101,19:102,20:103,22:$VL,23:$VM,24:$VN,25:$VO},o($V9,[2,26],{59:$VP}),o($V9,[2,27],{59:$VP}),o($V9,[2,28]),o($VQ,[2,42],{46:109,47:110,41:$VR,51:$VS,52:$VT,53:$VU,54:$VV}),{30:125,33:116,34:117,35:118,36:119,37:120,38:121,39:122,40:123,41:$VW,42:126,43:$VX,45:$VY,48:$VZ,49:$V_,50:$V$,57:$Vm,62:$V01},o($Vd,[2,80]),o($Vd,[2,81]),o($Vd,[2,83]),o($Vd,[2,84]),o($Vd,[2,85]),o($Vd,[2,79]),{15:$Ve,21:$V7,23:$Vf,24:$Vg,25:$Vh,31:$Vi,32:$V8,34:60,38:91,41:$Vj,45:$Vk,56:$Vl,57:$Vm,62:$Vn,63:$Vo,67:92,68:$Vp,70:42,73:43,74:44,75:45,76:46,77:47,78:48,79:49,80:$Vq,81:53,82:$Vr,83:$Vs,84:$Vt,85:$Vu,88:$Vv,89:$Vw,90:$Vx,91:$Vy,92:$Vz,93:$VA,94:$VB,95:$VC,96:$VD,113:$VE,114:$VF,115:61,116:78,117:79,118:80,125:$VG,126:83,127:84,128:87,129:$VH,130:$VI,131:$VJ,135:64,136:65},o($Vd,[2,86]),o($Vd,[2,100]),o($Vd,[2,101]),o($Vd,[2,102]),o($Vd,[2,103]),o($Vd,[2,104]),o($Vd,[2,105]),o($Vd,[2,106]),o($Vd,[2,107]),o($Vd,[2,108]),o([5,13,14,15,16,21,23,24,25,26,28,29,31,32,45,56,57,62,63,68,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],[2,110],{41:[1,133],80:$V11}),o($Vd,[2,114]),o($V21,$V31,{35:135,62:$V01}),o($Vd,[2,116]),o($Vd,[2,117]),o($Vd,[2,118]),o($Vd,[2,119]),o($Vd,[2,120]),o($Vd,[2,162]),o($V21,[2,202],{132:136,35:137,61:[1,138],62:$V01}),{15:$Ve,23:$V41,24:$Vg,31:$Vi,38:91,45:$Vk,56:$Vl,61:[1,140],63:$Vo,67:92,68:$Vp,73:142,75:141,77:143,80:$V51,81:53,82:$Vr,83:$Vs,84:$Vt,85:$Vu,88:$Vv,89:$Vw,90:$Vx,91:$Vy,92:$Vz,93:$VA,94:$VB,95:$VC,96:$VD,115:61,116:78,117:79,118:80,125:$VG,126:83,127:84,128:87,129:$VH,130:$VI,131:$VJ,134:139},{15:$V61,24:$V71,29:[1,147],31:[1,146],38:91,41:[1,148],45:$Vk,63:$Vo,67:92,68:$Vp,80:$V51,82:$V81,116:151,118:154,119:149,125:$VG,126:83,127:84,128:87,129:$VH,130:$VI,131:$VJ},o([5,13,14,15,16,21,23,24,25,26,28,29,31,32,41,45,56,57,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,125,129,130,131],[2,218],{114:[1,155]}),o([5,13,14,15,16,21,23,24,25,26,28,29,31,32,41,45,56,57,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,114,125,129,130,131],[2,219],{113:[1,156]}),{41:[1,169],61:[1,171],62:[1,170],68:[1,161],80:[1,162],86:157,87:158,97:159,99:[1,160],100:163,101:164,102:165,104:166,105:[1,174],106:[1,175],107:[1,176],108:[1,177],109:[1,172],110:[1,173],113:[1,167],114:[1,168]},o($Vd,[2,123]),o($Vd,[2,124]),o($Vd,[2,125]),o($Vd,[2,126]),o($Vd,[2,127]),o($Vd,[2,128]),o($Vd,[2,129]),o($Vd,[2,130]),o($Vd,[2,131]),o($Vd,[2,132]),o([58,59],$Vb,{27:178}),o($V91,[2,163]),o($V91,[2,164]),{24:$Va1,38:91,45:$Vk,67:92,68:$Vp,117:179,128:180},o($Vd,[2,220]),o($Vd,[2,222]),o([5,13,14,15,16,21,23,24,25,26,28,29,31,32,41,45,57,61,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],[2,190],{56:[1,182]}),o($V91,[2,192]),o($Vb1,[2,185],{125:[1,183]}),o($Vb1,[2,186],{63:[1,184]}),o($V91,[2,193],{120:185,121:186,122:187,123:$Vc1,124:$Vd1}),o($V91,[2,199]),o($V91,[2,200]),o($V91,[2,201]),o($Ve1,[2,197]),o($Ve1,[2,198]),o($Ve1,$Vf1),o($Ve1,[2,77]),o($Vd,[2,89]),o($Vd,[2,94]),o($Vd,[2,95]),o($Vd,[2,97]),o($VK,[2,90],{13:[1,192],21:[1,191],32:[1,190],62:[1,193]}),o($Vd,[2,91]),o($V9,[2,15]),o([5,13,14,15,16,17,26,28,29,31,32,41,45,56,57,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],[2,16],{20:194,21:$Vg1,22:$VL,23:$VM,24:$VN,25:$VO}),o($Vh1,[2,17]),o($Vh1,[2,20]),{19:196,20:103,22:$VL,23:$VM,24:$VN,25:$VO},{19:197,20:103,22:$VL,23:$VM,24:$VN,25:$VO},{19:198,20:103,22:$VL,23:$VM,24:$VN,25:$VO},o([5,13,14,15,16,17,21,23,24,25,26,28,29,31,32,41,45,56,57,58,59,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],[2,58]),o($VQ,[2,43],{47:199,41:$VR,53:$VU,54:$VV}),o($V9,[2,44]),o($Vi1,[2,49]),o($Vi1,[2,50]),o($V9,[2,51]),o($V9,[2,52]),o($V9,[2,53]),o($V9,[2,29]),o($V9,[2,30]),o([5,13,14,15,16,17,21,23,24,25,26,28,29,31,32,45,56,57,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],[2,31],{41:[1,202],61:[1,201],62:$Vj1}),o([5,13,14,15,16,17,21,23,24,25,26,28,29,31,32,41,45,56,57,62,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],[2,32],{63:[1,203]}),o($V9,[2,33]),o($V9,[2,34]),o($V9,[2,35]),o($V9,[2,36]),o([5,13,14,15,16,17,21,23,24,25,26,28,29,31,32,45,57,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],[2,37],{64:204,44:205,65:206,41:$Vk1,55:$Vl1,56:$Vm1}),o($V9,[2,38]),o($V9,[2,39]),o($Vn1,[2,61]),o($VQ,$Vf1,{46:109,47:110,41:$VR,51:$VS,52:$VT,53:$VU,54:$VV}),{44:210,55:$Vl1,56:$Vm1},o($V9,[2,46]),o($V9,[2,47]),o($V9,[2,48]),o($Vd,[2,109]),o($Vb1,[2,187]),o($Vo1,[2,226],{32:[1,211],62:$Vj1}),o($Vd,[2,203]),o($V21,[2,216],{61:[1,212],62:$Vj1}),o($V21,[2,217],{35:213,62:$V01}),{14:[1,214],15:$Ve,23:$V41,24:$Vg,31:$Vi,38:91,45:$Vk,56:$Vl,63:$Vo,67:92,68:$Vp,73:216,75:215,77:217,80:$V51,81:53,82:$Vr,83:$Vs,84:$Vt,85:$Vu,88:$Vv,89:$Vw,90:$Vx,91:$Vy,92:$Vz,93:$VA,94:$VB,95:$VC,96:$VD,115:61,116:78,117:79,118:80,125:$VG,126:83,127:84,128:87,129:$VH,130:$VI,131:$VJ},{15:$Ve,23:$V41,24:$Vg,31:$Vi,38:91,45:$Vk,56:$Vl,63:$Vo,67:92,68:$Vp,73:142,75:141,77:143,80:$V51,81:53,82:$Vr,83:$Vs,84:$Vt,85:$Vu,88:$Vv,89:$Vw,90:$Vx,91:$Vy,92:$Vz,93:$VA,94:$VB,95:$VC,96:$VD,115:61,116:78,117:79,118:80,125:$VG,126:83,127:84,128:87,129:$VH,130:$VI,131:$VJ,134:218},o($Vp1,[2,208]),{24:$Va1,38:91,45:$Vk,63:$Vo,67:92,68:$Vp,75:219,80:$V51,115:61,116:78,117:79,118:80,125:$VG,126:83,127:84,128:87,129:$VH,130:$VI,131:$VJ},{24:$Va1,38:91,45:$Vk,63:$Vo,67:92,68:$Vp,75:220,80:$V51,115:61,116:78,117:79,118:80,125:$VG,126:83,127:84,128:87,129:$VH,130:$VI,131:$VJ},o($Vp1,$V31),o($Vb1,[2,184],{80:$V11}),{32:[1,221]},{30:125,33:222,34:117,35:118,36:119,37:120,38:121,39:122,40:123,41:$VW,42:126,43:$VX,45:$VY,48:$VZ,49:$V_,50:$V$,57:$Vm,62:$V01},{32:[1,223]},{13:[1,224],15:[1,228],24:[1,227],38:91,45:$Vk,63:$Vo,67:92,68:$Vp,80:$V51,82:[1,226],116:225,118:154,125:$VG,126:83,127:84,128:87,129:$VH,130:$VI,131:$VJ},o([5,14,15,16,21,23,24,25,26,28,29,31,32,41,45,56,57,61,62,63,68,80,82,83,84,85,88,89,90,91,92,93,94,95,96,113,114,125,129,130,131],[2,168],{13:[1,229]}),o($Vq1,[2,169]),{24:[1,231],38:91,45:$Vk,63:$Vo,67:92,68:$Vp,80:$V51,116:230,118:154,125:$VG,126:83,127:84,128:87,129:$VH,130:$VI,131:$VJ},{38:91,45:$Vk,63:$Vo,67:92,68:$Vp,80:$V51,116:232,118:154,125:$VG,126:83,127:84,128:87,129:$VH,130:$VI,131:$VJ},{38:91,45:$Vk,67:92,68:$Vp,128:180},o($Vd,[2,221]),o($Vd,[2,223]),{85:[1,233]},{85:[1,234]},{15:[1,237],23:[1,236],85:[2,133],98:235},{85:[2,135]},{85:[2,136]},{85:[2,137]},{62:[1,238],85:[2,138]},{56:[1,239],61:[1,240],85:[2,139]},{85:[2,145],103:241,111:[1,242],112:[1,243]},{15:[1,245],23:[1,244]},o($Vr1,[2,157]),o($Vr1,[2,158]),o($Vr1,[2,159]),o($Vs1,[2,141]),o($Vt1,[2,143]),o($Vu1,[2,153]),o($Vu1,[2,154]),o($Vv1,[2,149]),o($Vv1,[2,150]),o($Vv1,[2,151]),o($Vv1,[2,152]),{58:[1,246],59:$VP},o($V91,[2,165]),o($V91,[2,195],{121:186,122:187,120:247,123:$Vc1,124:$Vd1}),{15:$V61,24:$V71,38:91,45:$Vk,63:$Vo,67:92,68:$Vp,80:$V51,82:$V81,116:151,118:154,119:149,125:$VG,126:83,127:84,128:87,129:$VH,130:$VI,131:$VJ},o($V91,[2,191]),o($Vb1,[2,188]),o($Vb1,[2,189]),o($V91,[2,194]),o($V91,[2,178],{123:[1,248]}),o($V91,[2,179],{124:[1,249]}),o($Vw1,[2,180]),o($Vx1,[2,182]),o($Vd,[2,92]),{32:[1,250]},o($Vd,[2,96]),o($Vd,[2,98]),o($Vh1,[2,18]),o($Vh1,[2,19]),{15:[1,251],20:194,21:$Vg1,22:$VL,23:$VM,24:$VN,25:$VO},{13:[1,252],14:[1,253],20:194,21:$Vg1,22:$VL,23:$VM,24:$VN,25:$VO},{13:[1,255],14:[1,254],20:194,21:$Vg1,22:$VL,23:$VM,24:$VN,25:$VO},o($V9,[2,45]),o($Vn1,[2,62]),{35:256,62:$V01},o($VQ,[2,65],{65:206,64:257,41:$Vk1}),{35:258,62:$V01},o($VQ,[2,68],{65:259,41:$Vk1}),o($V9,[2,41]),o($V9,[2,69]),{35:260,62:$V01},{35:261,62:$V01},{63:[1,262]},o($V9,[2,40]),{35:263,62:$V01},{35:264,62:$V01},o($V21,[2,215],{62:$Vj1}),o($Vd,[2,206]),o($Vp1,[2,210]),o($Vp1,[2,211]),o($Vp1,[2,212]),{14:[1,265],15:$Ve,23:$V41,24:$Vg,31:$Vi,38:91,45:$Vk,56:$Vl,63:$Vo,67:92,68:$Vp,73:216,75:215,77:217,80:$V51,81:53,82:$Vr,83:$Vs,84:$Vt,85:$Vu,88:$Vv,89:$Vw,90:$Vx,91:$Vy,92:$Vz,93:$VA,94:$VB,95:$VC,96:$VD,115:61,116:78,117:79,118:80,125:$VG,126:83,127:84,128:87,129:$VH,130:$VI,131:$VJ},o($Vp1,[2,209]),o($Vp1,[2,213]),{30:125,33:266,34:117,35:118,36:119,37:120,38:121,39:122,40:123,41:$VW,42:126,43:$VX,45:$VY,48:$VZ,49:$V_,50:$V$,57:$Vm,62:$V01},{13:[1,267]},{30:125,33:268,34:117,35:118,36:119,37:120,38:121,39:122,40:123,41:$VW,42:126,43:$VX,45:$VY,48:$VZ,49:$V_,50:$V$,57:$Vm,62:$V01},o($V91,[2,166]),o($Vq1,[2,170]),{24:[1,270],38:91,45:$Vk,63:$Vo,67:92,68:$Vp,80:$V51,116:269,118:154,125:$VG,126:83,127:84,128:87,129:$VH,130:$VI,131:$VJ},{38:91,45:$Vk,63:$Vo,67:92,68:$Vp,80:$V51,116:271,118:154,125:$VG,126:83,127:84,128:87,129:$VH,130:$VI,131:$VJ},o($Vq1,[2,177]),o($V91,[2,167]),o($Vq1,[2,171]),{38:91,45:$Vk,63:$Vo,67:92,68:$Vp,80:$V51,116:272,118:154,125:$VG,126:83,127:84,128:87,129:$VH,130:$VI,131:$VJ},o($Vq1,[2,173]),o($Vd,[2,121]),o($Vd,[2,122]),{85:[2,134]},{85:[2,160]},{85:[2,161]},o($Vs1,[2,142]),{85:[2,140]},o($Vt1,[2,144]),{85:[2,146]},{85:[2,155]},{85:[2,156]},{85:[2,147]},{85:[2,148]},o($V9,[2,56]),o($V91,[2,196]),o($Vw1,[2,181]),o($Vx1,[2,183]),o($Vd,[2,93]),o($Vh1,[2,21]),o($Vh1,[2,22]),o($Vh1,[2,24]),o($Vh1,[2,23]),o($Vh1,[2,25]),o($Vy1,[2,60],{62:$Vj1}),o($VQ,[2,66],{65:259,41:$Vk1}),o($Vy1,[2,63],{62:$Vj1}),o($V9,[2,70]),o($Vy1,[2,54],{62:$Vj1}),o($Vy1,[2,55],{62:$Vj1}),{34:274,35:275,41:[1,277],44:276,55:$Vl1,56:$Vm1,57:$Vm,62:$V01,66:273},o($Vo1,[2,225],{32:[1,278],62:$Vj1}),o($V21,[2,214],{62:$Vj1}),o($Vd,[2,207]),{13:[1,279]},o($Vd,[2,112]),{13:[1,280]},o($Vq1,[2,172]),{38:91,45:$Vk,63:$Vo,67:92,68:$Vp,80:$V51,116:281,118:154,125:$VG,126:83,127:84,128:87,129:$VH,130:$VI,131:$VJ},o($Vq1,[2,174]),o($Vq1,[2,176]),o($V9,[2,71]),o($V9,[2,72]),o($Vy1,[2,73],{62:$Vj1}),o($V9,[2,74]),o($V9,[2,75]),{35:282,62:$V01},o($Vd,[2,111]),o($Vd,[2,113]),o($Vq1,[2,175]),o($V21,[2,224],{62:$Vj1})],
|
|
428
|
+
defaultActions: {13:[2,1],160:[2,135],161:[2,136],162:[2,137],235:[2,134],236:[2,160],237:[2,161],239:[2,140],241:[2,146],242:[2,155],243:[2,156],244:[2,147],245:[2,148]},
|
|
429
|
+
parseError: function parseError (str, hash) {
|
|
430
|
+
if (hash.recoverable) {
|
|
431
|
+
this.trace(str);
|
|
432
|
+
} else {
|
|
433
|
+
var error = new Error(str);
|
|
434
|
+
error.hash = hash;
|
|
435
|
+
throw error;
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
parse: function parse(input) {
|
|
439
|
+
var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
|
|
440
|
+
var args = lstack.slice.call(arguments, 1);
|
|
441
|
+
var lexer = Object.create(this.lexer);
|
|
442
|
+
var sharedState = { yy: {} };
|
|
443
|
+
for (var k in this.yy) {
|
|
444
|
+
if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
|
|
445
|
+
sharedState.yy[k] = this.yy[k];
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
lexer.setInput(input, sharedState.yy);
|
|
449
|
+
sharedState.yy.lexer = lexer;
|
|
450
|
+
sharedState.yy.parser = this;
|
|
451
|
+
if (typeof lexer.yylloc == 'undefined') {
|
|
452
|
+
lexer.yylloc = {};
|
|
453
|
+
}
|
|
454
|
+
var yyloc = lexer.yylloc;
|
|
455
|
+
lstack.push(yyloc);
|
|
456
|
+
var ranges = lexer.options && lexer.options.ranges;
|
|
457
|
+
if (typeof sharedState.yy.parseError === 'function') {
|
|
458
|
+
this.parseError = sharedState.yy.parseError;
|
|
459
|
+
} else {
|
|
460
|
+
this.parseError = Object.getPrototypeOf(this).parseError;
|
|
461
|
+
}
|
|
462
|
+
function popStack(n) {
|
|
463
|
+
stack.length = stack.length - 2 * n;
|
|
464
|
+
vstack.length = vstack.length - n;
|
|
465
|
+
lstack.length = lstack.length - n;
|
|
466
|
+
}
|
|
467
|
+
_token_stack:
|
|
468
|
+
var lex = function () {
|
|
469
|
+
var token;
|
|
470
|
+
token = lexer.lex() || EOF;
|
|
471
|
+
if (typeof token !== 'number') {
|
|
472
|
+
token = self.symbols_[token] || token;
|
|
473
|
+
}
|
|
474
|
+
return token;
|
|
475
|
+
};
|
|
476
|
+
var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
|
|
477
|
+
while (true) {
|
|
478
|
+
state = stack[stack.length - 1];
|
|
479
|
+
if (this.defaultActions[state]) {
|
|
480
|
+
action = this.defaultActions[state];
|
|
481
|
+
} else {
|
|
482
|
+
if (symbol === null || typeof symbol == 'undefined') {
|
|
483
|
+
symbol = lex();
|
|
484
|
+
}
|
|
485
|
+
action = table[state] && table[state][symbol];
|
|
486
|
+
}
|
|
487
|
+
if (typeof action === 'undefined' || !action.length || !action[0]) {
|
|
488
|
+
var errStr = '';
|
|
489
|
+
expected = [];
|
|
490
|
+
for (p in table[state]) {
|
|
491
|
+
if (this.terminals_[p] && p > TERROR) {
|
|
492
|
+
expected.push('\'' + this.terminals_[p] + '\'');
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
if (lexer.showPosition) {
|
|
496
|
+
errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
|
|
497
|
+
} else {
|
|
498
|
+
errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
|
|
499
|
+
}
|
|
500
|
+
this.parseError(errStr, {
|
|
501
|
+
text: lexer.match,
|
|
502
|
+
token: this.terminals_[symbol] || symbol,
|
|
503
|
+
line: lexer.yylineno,
|
|
504
|
+
loc: yyloc,
|
|
505
|
+
expected: expected
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
if (action[0] instanceof Array && action.length > 1) {
|
|
509
|
+
throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
|
|
510
|
+
}
|
|
511
|
+
switch (action[0]) {
|
|
512
|
+
case 1:
|
|
513
|
+
stack.push(symbol);
|
|
514
|
+
vstack.push(lexer.yytext);
|
|
515
|
+
lstack.push(lexer.yylloc);
|
|
516
|
+
stack.push(action[1]);
|
|
517
|
+
symbol = null;
|
|
518
|
+
if (!preErrorSymbol) {
|
|
519
|
+
yyleng = lexer.yyleng;
|
|
520
|
+
yytext = lexer.yytext;
|
|
521
|
+
yylineno = lexer.yylineno;
|
|
522
|
+
yyloc = lexer.yylloc;
|
|
523
|
+
if (recovering > 0) {
|
|
524
|
+
recovering--;
|
|
525
|
+
}
|
|
526
|
+
} else {
|
|
527
|
+
symbol = preErrorSymbol;
|
|
528
|
+
preErrorSymbol = null;
|
|
529
|
+
}
|
|
530
|
+
break;
|
|
531
|
+
case 2:
|
|
532
|
+
len = this.productions_[action[1]][1];
|
|
533
|
+
yyval.$ = vstack[vstack.length - len];
|
|
534
|
+
yyval._$ = {
|
|
535
|
+
first_line: lstack[lstack.length - (len || 1)].first_line,
|
|
536
|
+
last_line: lstack[lstack.length - 1].last_line,
|
|
537
|
+
first_column: lstack[lstack.length - (len || 1)].first_column,
|
|
538
|
+
last_column: lstack[lstack.length - 1].last_column
|
|
539
|
+
};
|
|
540
|
+
if (ranges) {
|
|
541
|
+
yyval._$.range = [
|
|
542
|
+
lstack[lstack.length - (len || 1)].range[0],
|
|
543
|
+
lstack[lstack.length - 1].range[1]
|
|
544
|
+
];
|
|
545
|
+
}
|
|
546
|
+
r = this.performAction.apply(yyval, [
|
|
547
|
+
yytext,
|
|
548
|
+
yyleng,
|
|
549
|
+
yylineno,
|
|
550
|
+
sharedState.yy,
|
|
551
|
+
action[1],
|
|
552
|
+
vstack,
|
|
553
|
+
lstack
|
|
554
|
+
].concat(args));
|
|
555
|
+
if (typeof r !== 'undefined') {
|
|
556
|
+
return r;
|
|
557
|
+
}
|
|
558
|
+
if (len) {
|
|
559
|
+
stack = stack.slice(0, -1 * len * 2);
|
|
560
|
+
vstack = vstack.slice(0, -1 * len);
|
|
561
|
+
lstack = lstack.slice(0, -1 * len);
|
|
562
|
+
}
|
|
563
|
+
stack.push(this.productions_[action[1]][0]);
|
|
564
|
+
vstack.push(yyval.$);
|
|
565
|
+
lstack.push(yyval._$);
|
|
566
|
+
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
|
567
|
+
stack.push(newState);
|
|
568
|
+
break;
|
|
569
|
+
case 3:
|
|
570
|
+
return true;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
return true;
|
|
574
|
+
}};
|
|
575
|
+
|
|
576
|
+
const header = (name, value) => {
|
|
577
|
+
switch (name) {
|
|
578
|
+
case "K":
|
|
579
|
+
if (typeof value === "string") {
|
|
580
|
+
return {
|
|
581
|
+
name,
|
|
582
|
+
value: key(value),
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
return {
|
|
588
|
+
name,
|
|
589
|
+
value,
|
|
590
|
+
};
|
|
591
|
+
};
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
const event = (chord, duration) => {
|
|
595
|
+
return {
|
|
596
|
+
chord,
|
|
597
|
+
duration,
|
|
598
|
+
};
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
const pitch = (acc, phonet, quotes) => {
|
|
603
|
+
return {
|
|
604
|
+
acc,
|
|
605
|
+
phonet,
|
|
606
|
+
quotes,
|
|
607
|
+
};
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
const patch = (terms, bar) => {
|
|
612
|
+
const control = {};
|
|
613
|
+
terms.forEach(term => {
|
|
614
|
+
if (term.control)
|
|
615
|
+
control[term.control.name] = term.control.value;
|
|
616
|
+
});
|
|
617
|
+
|
|
618
|
+
return {
|
|
619
|
+
control,
|
|
620
|
+
terms,
|
|
621
|
+
bar,
|
|
622
|
+
};
|
|
623
|
+
};
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
const voice = (name, clef, properties) => ({
|
|
627
|
+
name,
|
|
628
|
+
clef,
|
|
629
|
+
properties,
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
const assign = (name, value) => {
|
|
634
|
+
return {
|
|
635
|
+
[name]: value,
|
|
636
|
+
};
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
const frac = (numerator, denominator) => {
|
|
641
|
+
return {
|
|
642
|
+
numerator,
|
|
643
|
+
denominator,
|
|
644
|
+
};
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
const articulation = (content, scope) => ({
|
|
649
|
+
articulation: content,
|
|
650
|
+
scope,
|
|
651
|
+
});
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
const tune = (header, body) => {
|
|
655
|
+
const {patches} = body;
|
|
656
|
+
const measures = [];
|
|
657
|
+
let measure = null;
|
|
658
|
+
let lastVoice = 1;
|
|
659
|
+
patches.forEach(patch => {
|
|
660
|
+
const voice = patch.control.V || 1;
|
|
661
|
+
if (voice <= lastVoice) {
|
|
662
|
+
if (measure)
|
|
663
|
+
measures.push(measure);
|
|
664
|
+
measure = {voices: []};
|
|
665
|
+
}
|
|
666
|
+
measure.voices.push(patch);
|
|
667
|
+
});
|
|
668
|
+
|
|
669
|
+
measures.push(measure);
|
|
670
|
+
|
|
671
|
+
measures.forEach((measure, index) => measure.index = index + 1);
|
|
672
|
+
|
|
673
|
+
return {
|
|
674
|
+
header,
|
|
675
|
+
body: {
|
|
676
|
+
measures,
|
|
677
|
+
},
|
|
678
|
+
};
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
const grace = (events, acciaccatura) => ({
|
|
683
|
+
grace: true,
|
|
684
|
+
acciaccatura,
|
|
685
|
+
events,
|
|
686
|
+
});
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
const chord = (pitches, tie) => ({
|
|
690
|
+
pitches,
|
|
691
|
+
tie,
|
|
692
|
+
});
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
const staffShift = (shift) => ({
|
|
696
|
+
staffShift: shift,
|
|
697
|
+
});
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
const comment = (text) => ({
|
|
701
|
+
comment: text,
|
|
702
|
+
});
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
const staffGroup = (items, bound) => ({
|
|
706
|
+
items,
|
|
707
|
+
bound,
|
|
708
|
+
});
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
const tempo = (note, bpm) => ({
|
|
712
|
+
note,
|
|
713
|
+
bpm,
|
|
714
|
+
});
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
const key = (root, mode) => ({
|
|
718
|
+
root,
|
|
719
|
+
mode,
|
|
720
|
+
});
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
const clef = clef => ({clef});
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
const octaveShift = shift => ({octaveShift: shift});
|
|
727
|
+
/* generated by jison-lex 0.3.4 */
|
|
728
|
+
var lexer = (function(){
|
|
729
|
+
var lexer = ({
|
|
730
|
+
|
|
731
|
+
EOF:1,
|
|
732
|
+
|
|
733
|
+
parseError:function parseError(str, hash) {
|
|
734
|
+
if (this.yy.parser) {
|
|
735
|
+
this.yy.parser.parseError(str, hash);
|
|
736
|
+
} else {
|
|
737
|
+
throw new Error(str);
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
|
|
741
|
+
// resets the lexer, sets new input
|
|
742
|
+
setInput:function (input, yy) {
|
|
743
|
+
this.yy = yy || this.yy || {};
|
|
744
|
+
this._input = input;
|
|
745
|
+
this._more = this._backtrack = this.done = false;
|
|
746
|
+
this.yylineno = this.yyleng = 0;
|
|
747
|
+
this.yytext = this.matched = this.match = '';
|
|
748
|
+
this.conditionStack = ['INITIAL'];
|
|
749
|
+
this.yylloc = {
|
|
750
|
+
first_line: 1,
|
|
751
|
+
first_column: 0,
|
|
752
|
+
last_line: 1,
|
|
753
|
+
last_column: 0
|
|
754
|
+
};
|
|
755
|
+
if (this.options.ranges) {
|
|
756
|
+
this.yylloc.range = [0,0];
|
|
757
|
+
}
|
|
758
|
+
this.offset = 0;
|
|
759
|
+
return this;
|
|
760
|
+
},
|
|
761
|
+
|
|
762
|
+
// consumes and returns one char from the input
|
|
763
|
+
input:function () {
|
|
764
|
+
var ch = this._input[0];
|
|
765
|
+
this.yytext += ch;
|
|
766
|
+
this.yyleng++;
|
|
767
|
+
this.offset++;
|
|
768
|
+
this.match += ch;
|
|
769
|
+
this.matched += ch;
|
|
770
|
+
var lines = ch.match(/(?:\r\n?|\n).*/g);
|
|
771
|
+
if (lines) {
|
|
772
|
+
this.yylineno++;
|
|
773
|
+
this.yylloc.last_line++;
|
|
774
|
+
} else {
|
|
775
|
+
this.yylloc.last_column++;
|
|
776
|
+
}
|
|
777
|
+
if (this.options.ranges) {
|
|
778
|
+
this.yylloc.range[1]++;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
this._input = this._input.slice(1);
|
|
782
|
+
return ch;
|
|
783
|
+
},
|
|
784
|
+
|
|
785
|
+
// unshifts one char (or a string) into the input
|
|
786
|
+
unput:function (ch) {
|
|
787
|
+
var len = ch.length;
|
|
788
|
+
var lines = ch.split(/(?:\r\n?|\n)/g);
|
|
789
|
+
|
|
790
|
+
this._input = ch + this._input;
|
|
791
|
+
this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
|
792
|
+
//this.yyleng -= len;
|
|
793
|
+
this.offset -= len;
|
|
794
|
+
var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
|
795
|
+
this.match = this.match.substr(0, this.match.length - 1);
|
|
796
|
+
this.matched = this.matched.substr(0, this.matched.length - 1);
|
|
797
|
+
|
|
798
|
+
if (lines.length - 1) {
|
|
799
|
+
this.yylineno -= lines.length - 1;
|
|
800
|
+
}
|
|
801
|
+
var r = this.yylloc.range;
|
|
802
|
+
|
|
803
|
+
this.yylloc = {
|
|
804
|
+
first_line: this.yylloc.first_line,
|
|
805
|
+
last_line: this.yylineno + 1,
|
|
806
|
+
first_column: this.yylloc.first_column,
|
|
807
|
+
last_column: lines ?
|
|
808
|
+
(lines.length === oldLines.length ? this.yylloc.first_column : 0)
|
|
809
|
+
+ oldLines[oldLines.length - lines.length].length - lines[0].length :
|
|
810
|
+
this.yylloc.first_column - len
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
if (this.options.ranges) {
|
|
814
|
+
this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
|
815
|
+
}
|
|
816
|
+
this.yyleng = this.yytext.length;
|
|
817
|
+
return this;
|
|
818
|
+
},
|
|
819
|
+
|
|
820
|
+
// When called from action, caches matched text and appends it on next action
|
|
821
|
+
more:function () {
|
|
822
|
+
this._more = true;
|
|
823
|
+
return this;
|
|
824
|
+
},
|
|
825
|
+
|
|
826
|
+
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
|
|
827
|
+
reject:function () {
|
|
828
|
+
if (this.options.backtrack_lexer) {
|
|
829
|
+
this._backtrack = true;
|
|
830
|
+
} else {
|
|
831
|
+
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
|
|
832
|
+
text: "",
|
|
833
|
+
token: null,
|
|
834
|
+
line: this.yylineno
|
|
835
|
+
});
|
|
836
|
+
|
|
837
|
+
}
|
|
838
|
+
return this;
|
|
839
|
+
},
|
|
840
|
+
|
|
841
|
+
// retain first n characters of the match
|
|
842
|
+
less:function (n) {
|
|
843
|
+
this.unput(this.match.slice(n));
|
|
844
|
+
},
|
|
845
|
+
|
|
846
|
+
// displays already matched input, i.e. for error messages
|
|
847
|
+
pastInput:function () {
|
|
848
|
+
var past = this.matched.substr(0, this.matched.length - this.match.length);
|
|
849
|
+
return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
|
|
850
|
+
},
|
|
851
|
+
|
|
852
|
+
// displays upcoming input, i.e. for error messages
|
|
853
|
+
upcomingInput:function () {
|
|
854
|
+
var next = this.match;
|
|
855
|
+
if (next.length < 20) {
|
|
856
|
+
next += this._input.substr(0, 20-next.length);
|
|
857
|
+
}
|
|
858
|
+
return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
|
859
|
+
},
|
|
860
|
+
|
|
861
|
+
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
862
|
+
showPosition:function () {
|
|
863
|
+
var pre = this.pastInput();
|
|
864
|
+
var c = new Array(pre.length + 1).join("-");
|
|
865
|
+
return pre + this.upcomingInput() + "\n" + c + "^";
|
|
866
|
+
},
|
|
867
|
+
|
|
868
|
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
869
|
+
test_match:function(match, indexed_rule) {
|
|
870
|
+
var token,
|
|
871
|
+
lines,
|
|
872
|
+
backup;
|
|
873
|
+
|
|
874
|
+
if (this.options.backtrack_lexer) {
|
|
875
|
+
// save context
|
|
876
|
+
backup = {
|
|
877
|
+
yylineno: this.yylineno,
|
|
878
|
+
yylloc: {
|
|
879
|
+
first_line: this.yylloc.first_line,
|
|
880
|
+
last_line: this.last_line,
|
|
881
|
+
first_column: this.yylloc.first_column,
|
|
882
|
+
last_column: this.yylloc.last_column
|
|
883
|
+
},
|
|
884
|
+
yytext: this.yytext,
|
|
885
|
+
match: this.match,
|
|
886
|
+
matches: this.matches,
|
|
887
|
+
matched: this.matched,
|
|
888
|
+
yyleng: this.yyleng,
|
|
889
|
+
offset: this.offset,
|
|
890
|
+
_more: this._more,
|
|
891
|
+
_input: this._input,
|
|
892
|
+
yy: this.yy,
|
|
893
|
+
conditionStack: this.conditionStack.slice(0),
|
|
894
|
+
done: this.done
|
|
895
|
+
};
|
|
896
|
+
if (this.options.ranges) {
|
|
897
|
+
backup.yylloc.range = this.yylloc.range.slice(0);
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
lines = match[0].match(/(?:\r\n?|\n).*/g);
|
|
902
|
+
if (lines) {
|
|
903
|
+
this.yylineno += lines.length;
|
|
904
|
+
}
|
|
905
|
+
this.yylloc = {
|
|
906
|
+
first_line: this.yylloc.last_line,
|
|
907
|
+
last_line: this.yylineno + 1,
|
|
908
|
+
first_column: this.yylloc.last_column,
|
|
909
|
+
last_column: lines ?
|
|
910
|
+
lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
|
|
911
|
+
this.yylloc.last_column + match[0].length
|
|
912
|
+
};
|
|
913
|
+
this.yytext += match[0];
|
|
914
|
+
this.match += match[0];
|
|
915
|
+
this.matches = match;
|
|
916
|
+
this.yyleng = this.yytext.length;
|
|
917
|
+
if (this.options.ranges) {
|
|
918
|
+
this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
|
919
|
+
}
|
|
920
|
+
this._more = false;
|
|
921
|
+
this._backtrack = false;
|
|
922
|
+
this._input = this._input.slice(match[0].length);
|
|
923
|
+
this.matched += match[0];
|
|
924
|
+
token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
|
925
|
+
if (this.done && this._input) {
|
|
926
|
+
this.done = false;
|
|
927
|
+
}
|
|
928
|
+
if (token) {
|
|
929
|
+
return token;
|
|
930
|
+
} else if (this._backtrack) {
|
|
931
|
+
// recover context
|
|
932
|
+
for (var k in backup) {
|
|
933
|
+
this[k] = backup[k];
|
|
934
|
+
}
|
|
935
|
+
return false; // rule action called reject() implying the next rule should be tested instead.
|
|
936
|
+
}
|
|
937
|
+
return false;
|
|
938
|
+
},
|
|
939
|
+
|
|
940
|
+
// return next match in input
|
|
941
|
+
next:function () {
|
|
942
|
+
if (this.done) {
|
|
943
|
+
return this.EOF;
|
|
944
|
+
}
|
|
945
|
+
if (!this._input) {
|
|
946
|
+
this.done = true;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
var token,
|
|
950
|
+
match,
|
|
951
|
+
tempMatch,
|
|
952
|
+
index;
|
|
953
|
+
if (!this._more) {
|
|
954
|
+
this.yytext = '';
|
|
955
|
+
this.match = '';
|
|
956
|
+
}
|
|
957
|
+
var rules = this._currentRules();
|
|
958
|
+
for (var i = 0; i < rules.length; i++) {
|
|
959
|
+
tempMatch = this._input.match(this.rules[rules[i]]);
|
|
960
|
+
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
|
961
|
+
match = tempMatch;
|
|
962
|
+
index = i;
|
|
963
|
+
if (this.options.backtrack_lexer) {
|
|
964
|
+
token = this.test_match(tempMatch, rules[i]);
|
|
965
|
+
if (token !== false) {
|
|
966
|
+
return token;
|
|
967
|
+
} else if (this._backtrack) {
|
|
968
|
+
match = false;
|
|
969
|
+
continue; // rule action called reject() implying a rule MISmatch.
|
|
970
|
+
} else {
|
|
971
|
+
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
|
|
972
|
+
return false;
|
|
973
|
+
}
|
|
974
|
+
} else if (!this.options.flex) {
|
|
975
|
+
break;
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
if (match) {
|
|
980
|
+
token = this.test_match(match, rules[index]);
|
|
981
|
+
if (token !== false) {
|
|
982
|
+
return token;
|
|
983
|
+
}
|
|
984
|
+
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
|
|
985
|
+
return false;
|
|
986
|
+
}
|
|
987
|
+
if (this._input === "") {
|
|
988
|
+
return this.EOF;
|
|
989
|
+
} else {
|
|
990
|
+
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
|
|
991
|
+
text: "",
|
|
992
|
+
token: null,
|
|
993
|
+
line: this.yylineno
|
|
994
|
+
});
|
|
995
|
+
}
|
|
996
|
+
},
|
|
997
|
+
|
|
998
|
+
// return next match that has a token
|
|
999
|
+
lex:function lex () {
|
|
1000
|
+
var r = this.next();
|
|
1001
|
+
if (r) {
|
|
1002
|
+
return r;
|
|
1003
|
+
} else {
|
|
1004
|
+
return this.lex();
|
|
1005
|
+
}
|
|
1006
|
+
},
|
|
1007
|
+
|
|
1008
|
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
1009
|
+
begin:function begin (condition) {
|
|
1010
|
+
this.conditionStack.push(condition);
|
|
1011
|
+
},
|
|
1012
|
+
|
|
1013
|
+
// pop the previously active lexer condition state off the condition stack
|
|
1014
|
+
popState:function popState () {
|
|
1015
|
+
var n = this.conditionStack.length - 1;
|
|
1016
|
+
if (n > 0) {
|
|
1017
|
+
return this.conditionStack.pop();
|
|
1018
|
+
} else {
|
|
1019
|
+
return this.conditionStack[0];
|
|
1020
|
+
}
|
|
1021
|
+
},
|
|
1022
|
+
|
|
1023
|
+
// produce the lexer rule set which is active for the currently active lexer condition state
|
|
1024
|
+
_currentRules:function _currentRules () {
|
|
1025
|
+
if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
|
1026
|
+
return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
|
1027
|
+
} else {
|
|
1028
|
+
return this.conditions["INITIAL"].rules;
|
|
1029
|
+
}
|
|
1030
|
+
},
|
|
1031
|
+
|
|
1032
|
+
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
|
1033
|
+
topState:function topState (n) {
|
|
1034
|
+
n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
|
1035
|
+
if (n >= 0) {
|
|
1036
|
+
return this.conditionStack[n];
|
|
1037
|
+
} else {
|
|
1038
|
+
return "INITIAL";
|
|
1039
|
+
}
|
|
1040
|
+
},
|
|
1041
|
+
|
|
1042
|
+
// alias for begin(condition)
|
|
1043
|
+
pushState:function pushState (condition) {
|
|
1044
|
+
this.begin(condition);
|
|
1045
|
+
},
|
|
1046
|
+
|
|
1047
|
+
// return the number of states currently on the stack
|
|
1048
|
+
stateStackSize:function stateStackSize() {
|
|
1049
|
+
return this.conditionStack.length;
|
|
1050
|
+
},
|
|
1051
|
+
options: {},
|
|
1052
|
+
performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
|
|
1053
|
+
var YYSTATE=YY_START;
|
|
1054
|
+
switch($avoiding_name_collisions) {
|
|
1055
|
+
case 0: this.pushState('string'); return 57;
|
|
1056
|
+
break;
|
|
1057
|
+
case 1: this.popState(); return 58;
|
|
1058
|
+
break;
|
|
1059
|
+
case 2:return 59
|
|
1060
|
+
break;
|
|
1061
|
+
case 3:return 59
|
|
1062
|
+
break;
|
|
1063
|
+
case 4: this.pushState('title_string'); return 26;
|
|
1064
|
+
break;
|
|
1065
|
+
case 5: this.pushState('title_string'); return 28;
|
|
1066
|
+
break;
|
|
1067
|
+
case 6: this.popState();
|
|
1068
|
+
break;
|
|
1069
|
+
case 7:return 59
|
|
1070
|
+
break;
|
|
1071
|
+
case 8: this.pushState('key_signature'); return 29;
|
|
1072
|
+
break;
|
|
1073
|
+
case 9:return 48;
|
|
1074
|
+
break;
|
|
1075
|
+
case 10:return 49;
|
|
1076
|
+
break;
|
|
1077
|
+
case 11:return 50;
|
|
1078
|
+
break;
|
|
1079
|
+
case 12:return 45;
|
|
1080
|
+
break;
|
|
1081
|
+
case 13:return 52;
|
|
1082
|
+
break;
|
|
1083
|
+
case 14:return 51;
|
|
1084
|
+
break;
|
|
1085
|
+
case 15:return 41;
|
|
1086
|
+
break;
|
|
1087
|
+
case 16:return 41;
|
|
1088
|
+
break;
|
|
1089
|
+
case 17:
|
|
1090
|
+
break;
|
|
1091
|
+
case 18:return yy_.yytext;
|
|
1092
|
+
break;
|
|
1093
|
+
case 19:return 62;
|
|
1094
|
+
break;
|
|
1095
|
+
case 20: this.popState();
|
|
1096
|
+
break;
|
|
1097
|
+
case 21: this.popState(); return 13;
|
|
1098
|
+
break;
|
|
1099
|
+
case 22: this.pushState('comment');
|
|
1100
|
+
break;
|
|
1101
|
+
case 23: this.pushState('spec_comment');
|
|
1102
|
+
break;
|
|
1103
|
+
case 24: return 16;
|
|
1104
|
+
break;
|
|
1105
|
+
case 25: this.popState(); this.popState();
|
|
1106
|
+
break;
|
|
1107
|
+
case 26: this.popState();
|
|
1108
|
+
break;
|
|
1109
|
+
case 27:
|
|
1110
|
+
break;
|
|
1111
|
+
case 28:return 17
|
|
1112
|
+
break;
|
|
1113
|
+
case 29:return 22
|
|
1114
|
+
break;
|
|
1115
|
+
case 30:return yy_.yytext
|
|
1116
|
+
break;
|
|
1117
|
+
case 31: this.pushState('exclamation_exp'); return 85;
|
|
1118
|
+
break;
|
|
1119
|
+
case 32: this.popState(); return 85;
|
|
1120
|
+
break;
|
|
1121
|
+
case 33:return yy_.yytext
|
|
1122
|
+
break;
|
|
1123
|
+
case 34:return yy_.yytext
|
|
1124
|
+
break;
|
|
1125
|
+
case 35:return yy_.yytext
|
|
1126
|
+
break;
|
|
1127
|
+
case 36:return yy_.yytext
|
|
1128
|
+
break;
|
|
1129
|
+
case 37:return yy_.yytext
|
|
1130
|
+
break;
|
|
1131
|
+
case 38:return yy_.yytext
|
|
1132
|
+
break;
|
|
1133
|
+
case 39:return yy_.yytext
|
|
1134
|
+
break;
|
|
1135
|
+
case 40:return 99
|
|
1136
|
+
break;
|
|
1137
|
+
case 41:return 68
|
|
1138
|
+
break;
|
|
1139
|
+
case 42:return 62
|
|
1140
|
+
break;
|
|
1141
|
+
case 43:return 41
|
|
1142
|
+
break;
|
|
1143
|
+
case 44:
|
|
1144
|
+
break;
|
|
1145
|
+
case 45:return yy_.yytext
|
|
1146
|
+
break;
|
|
1147
|
+
case 46:return 31
|
|
1148
|
+
break;
|
|
1149
|
+
case 47:return 45
|
|
1150
|
+
break;
|
|
1151
|
+
case 48:return 45
|
|
1152
|
+
break;
|
|
1153
|
+
case 49:return 68
|
|
1154
|
+
break;
|
|
1155
|
+
case 50:return 129
|
|
1156
|
+
break;
|
|
1157
|
+
case 51:return 130
|
|
1158
|
+
break;
|
|
1159
|
+
case 52:return yy_.yytext
|
|
1160
|
+
break;
|
|
1161
|
+
case 53:return yy_.yytext
|
|
1162
|
+
break;
|
|
1163
|
+
case 54:return 131
|
|
1164
|
+
break;
|
|
1165
|
+
case 55:return 62
|
|
1166
|
+
break;
|
|
1167
|
+
case 56:return 99
|
|
1168
|
+
break;
|
|
1169
|
+
case 57:return 43
|
|
1170
|
+
break;
|
|
1171
|
+
case 58:return 53
|
|
1172
|
+
break;
|
|
1173
|
+
case 59:return 54
|
|
1174
|
+
break;
|
|
1175
|
+
case 60:return 41
|
|
1176
|
+
break;
|
|
1177
|
+
case 61:return 5
|
|
1178
|
+
break;
|
|
1179
|
+
}
|
|
1180
|
+
},
|
|
1181
|
+
rules: [/^(?:")/,/^(?:")/,/^(?:\\")/,/^(?:[^"]+)/,/^(?:^[T][:][\s]*)/,/^(?:^[C][:][\s]*)/,/^(?:\n)/,/^(?:[^\n]+)/,/^(?:^[K][:][\s]*)/,/^(?:treble\b)/,/^(?:bass\b)/,/^(?:tenor\b)/,/^(?:[A-G])/,/^(?:[b])/,/^(?:[#])/,/^(?:[m][a-z]*)/,/^(?:[a-z]+)/,/^(?:[ \t]+)/,/^(?:[+\-])/,/^(?:[0-9])/,/^(?:\n)/,/^(?:\])/,/^(?:^[%])/,/^(?:[%])/,/^(?:[^\n]+)/,/^(?:\n)/,/^(?:\n)/,/^(?:\s)/,/^(?:score\b)/,/^(?:[\w]+)/,/^(?:[(){}\[\]|])/,/^(?:[!])/,/^(?:[!])/,/^(?:([:!^_,'/<>={}()\[\]|.\-+~]))/,/^(?:D\.C\.)/,/^(?:D\.S\.)/,/^(?:alcoda\b)/,/^(?:alfine\b)/,/^(?:[8][v][ab])/,/^(?:[1][5][m][ab])/,/^(?:\b[ms]?[pf]+[z]?\b)/,/^(?:(\b[a-g](?=[\W\d\sA-Ga-g_zHJLMOPRSTuv]*\b)))/,/^(?:([0-9]))/,/^(?:[a-zA-Z][\w-]*)/,/^(?:\s+)/,/^(?:([:!^_,'/<>={}()\[\]|.\-+~]))/,/^(?:(\b[A-Z](?=:[^|])))/,/^(?:(\b[A-G](?=[\W\d\sA-Ga-g_zHJLMOPRSTuv]*\b)))/,/^(?:(\b[A-G](?=[m][a][j]|[m][i][n]\b)))/,/^(?:(\b[a-g](?=[\W\d\sA-Ga-g_zHJLMOPRSTuv]*\b)))/,/^(?:(\b[z]))/,/^(?:(\b[Z]))/,/^(?:(\b[HJLMOPRSTuv](?=[A-Ga-g][A-Ga-g0-9]*\b)))/,/^(?:(\b[HJLMOPRSTuv](?=[xz!\[^_=\s"])))/,/^(?:(\b[x](?=[\W\d\s])))/,/^(?:([0-9]))/,/^(?:\b[ms]?[pf]+[z]?\b)/,/^(?:staff\b)/,/^(?:maj\b)/,/^(?:min\b)/,/^(?:[a-zA-Z][\w-]*)/,/^(?:$)/],
|
|
1182
|
+
conditions: {"exclamation_exp":{"rules":[32,33,34,35,36,37,38,39,40,41,42,43],"inclusive":false},"key_signature":{"rules":[9,10,11,12,13,14,15,16,17,18,19,20,21],"inclusive":false},"title_string":{"rules":[6,7],"inclusive":false},"spec_comment":{"rules":[25,27,28,29,30],"inclusive":false},"comment":{"rules":[23,24,26],"inclusive":false},"string":{"rules":[1,2,3],"inclusive":false},"INITIAL":{"rules":[0,4,5,8,22,31,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61],"inclusive":true}}
|
|
1183
|
+
});
|
|
1184
|
+
return lexer;
|
|
1185
|
+
})();
|
|
1186
|
+
parser.lexer = lexer;
|
|
1187
|
+
function Parser () {
|
|
1188
|
+
this.yy = {};
|
|
1189
|
+
}
|
|
1190
|
+
Parser.prototype = parser;parser.Parser = Parser;
|
|
1191
|
+
return new Parser;
|
|
1192
|
+
})(), writable: false, configurable: false });
|
|
1193
|
+
|
|
1194
|
+
|
|
1195
|
+
|
|
1196
|
+
// ES module exports
|
|
1197
|
+
const __grammar = globalThis["__abcGrammar__"];
|
|
1198
|
+
const __parser = globalThis["__abcGrammar__"];
|
|
1199
|
+
const __Parser = globalThis["__abcGrammar__"].Parser;
|
|
1200
|
+
const __parse = function() { return globalThis["__abcGrammar__"].parse.apply(globalThis["__abcGrammar__"], arguments); };
|
|
1201
|
+
|
|
1202
|
+
export { __grammar as grammar, __parser as parser, __Parser as Parser, __parse as parse };
|
|
1203
|
+
export default __grammar;
|