@fileverse-dev/formula-parser 0.2.49-patch-2 → 0.2.49-patch-4

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.
Files changed (47) hide show
  1. package/package.json +2 -2
  2. package/es/error.js +0 -45
  3. package/es/evaluate-by-operator/evaluate-by-operator.js +0 -70
  4. package/es/evaluate-by-operator/operator/add.js +0 -16
  5. package/es/evaluate-by-operator/operator/ampersand.js +0 -10
  6. package/es/evaluate-by-operator/operator/divide.js +0 -21
  7. package/es/evaluate-by-operator/operator/equal.js +0 -5
  8. package/es/evaluate-by-operator/operator/formula-function.js +0 -40
  9. package/es/evaluate-by-operator/operator/greater-than-or-equal.js +0 -5
  10. package/es/evaluate-by-operator/operator/greater-than.js +0 -5
  11. package/es/evaluate-by-operator/operator/less-than-or-equal.js +0 -5
  12. package/es/evaluate-by-operator/operator/less-than.js +0 -5
  13. package/es/evaluate-by-operator/operator/minus.js +0 -16
  14. package/es/evaluate-by-operator/operator/multiply.js +0 -16
  15. package/es/evaluate-by-operator/operator/not-equal.js +0 -5
  16. package/es/evaluate-by-operator/operator/power.js +0 -11
  17. package/es/grammar-parser/grammar-parser.jison +0 -230
  18. package/es/grammar-parser/grammar-parser.js +0 -1522
  19. package/es/helper/cell.js +0 -117
  20. package/es/helper/number.js +0 -25
  21. package/es/helper/string.js +0 -13
  22. package/es/index.js +0 -5
  23. package/es/parser.js +0 -318
  24. package/es/supported-formulas.js +0 -3
  25. package/lib/error.js +0 -53
  26. package/lib/evaluate-by-operator/evaluate-by-operator.js +0 -77
  27. package/lib/evaluate-by-operator/operator/add.js +0 -23
  28. package/lib/evaluate-by-operator/operator/ampersand.js +0 -17
  29. package/lib/evaluate-by-operator/operator/divide.js +0 -28
  30. package/lib/evaluate-by-operator/operator/equal.js +0 -12
  31. package/lib/evaluate-by-operator/operator/formula-function.js +0 -50
  32. package/lib/evaluate-by-operator/operator/greater-than-or-equal.js +0 -12
  33. package/lib/evaluate-by-operator/operator/greater-than.js +0 -12
  34. package/lib/evaluate-by-operator/operator/less-than-or-equal.js +0 -12
  35. package/lib/evaluate-by-operator/operator/less-than.js +0 -12
  36. package/lib/evaluate-by-operator/operator/minus.js +0 -23
  37. package/lib/evaluate-by-operator/operator/multiply.js +0 -23
  38. package/lib/evaluate-by-operator/operator/not-equal.js +0 -12
  39. package/lib/evaluate-by-operator/operator/power.js +0 -18
  40. package/lib/grammar-parser/grammar-parser.jison +0 -230
  41. package/lib/grammar-parser/grammar-parser.js +0 -1528
  42. package/lib/helper/cell.js +0 -128
  43. package/lib/helper/number.js +0 -32
  44. package/lib/helper/string.js +0 -19
  45. package/lib/index.js +0 -114
  46. package/lib/parser.js +0 -326
  47. package/lib/supported-formulas.js +0 -11
@@ -1,1522 +0,0 @@
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
-
75
- /* addresses */
76
- var simpleSheetName = "[A-Za-z0-9_\xC0-\u02AF]+";
77
- var quotedSheetName = "'(?:(?!').|'')*'";
78
- var sheetNameRegexp = "(?:".concat(simpleSheetName, "|").concat(quotedSheetName, ")!");
79
- var ABSOLUTE_CELL = new RegExp("^(?:".concat(sheetNameRegexp, ")?(?:[$][A-Za-z]+[$][0-9]+)"));
80
- var MIXED_CELL_COL = new RegExp("^(?:".concat(sheetNameRegexp, ")?(?:[$][A-Za-z]+[0-9]*)"));
81
- var MIXED_CELL_ROW = new RegExp("^(?:".concat(sheetNameRegexp, ")?(?:[A-Za-z]*[$][0-9]+)"));
82
- var RELATIVE_CELL = new RegExp("^(?:".concat(sheetNameRegexp, ")?(?:(?:[A-Za-z]+[0-9]*)|(?:[A-Za-z]*[0-9]+))(?!\\d)(?!\\.)"));
83
- var NUMONLY = /^(?:[0-9]+$)/;
84
- var stackCache;
85
- var o = function o(k, v, _o, l) {
86
- for (_o = _o || {}, l = k.length; l--; _o[k[l]] = v);
87
- return _o;
88
- },
89
- $V0 = [1, 5],
90
- $V1 = [1, 8],
91
- $V2 = [1, 6],
92
- $V3 = [1, 7],
93
- $V4 = [1, 9],
94
- $V5 = [1, 14],
95
- $V6 = [1, 15],
96
- $V7 = [1, 16],
97
- $V8 = [1, 12],
98
- $V9 = [1, 13],
99
- $Va = [1, 17],
100
- $Vb = [1, 19],
101
- $Vc = [1, 20],
102
- $Vd = [1, 21],
103
- $Ve = [1, 22],
104
- $Vf = [1, 23],
105
- $Vg = [1, 24],
106
- $Vh = [1, 25],
107
- $Vi = [1, 26],
108
- $Vj = [1, 27],
109
- $Vk = [1, 28],
110
- $Vl = [5, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30],
111
- $Vm = [5, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30, 32],
112
- $Vn = [5, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30, 34],
113
- $Vo = [5, 10, 11, 13, 14, 15, 16, 17, 29, 30],
114
- $Vp = [5, 10, 13, 14, 15, 16, 29, 30],
115
- $Vq = [5, 10, 11, 13, 14, 15, 16, 17, 18, 19, 29, 30],
116
- $Vr = [13, 29, 30];
117
- var parser = {
118
- trace: function trace() {},
119
- yy: {},
120
- symbols_: {
121
- error: 2,
122
- expressions: 3,
123
- expression: 4,
124
- EOF: 5,
125
- variableSequence: 6,
126
- number: 7,
127
- STRING: 8,
128
- "&": 9,
129
- "=": 10,
130
- "+": 11,
131
- "(": 12,
132
- ")": 13,
133
- "<": 14,
134
- ">": 15,
135
- NOT: 16,
136
- "-": 17,
137
- "*": 18,
138
- "/": 19,
139
- "^": 20,
140
- FUNCTION: 21,
141
- expseq: 22,
142
- cell: 23,
143
- ABSOLUTE_CELL: 24,
144
- RELATIVE_CELL: 25,
145
- MIXED_CELL: 26,
146
- ":": 27,
147
- ARRAY: 28,
148
- ";": 29,
149
- ",": 30,
150
- VARIABLE: 31,
151
- DECIMAL: 32,
152
- NUMBER: 33,
153
- "%": 34,
154
- ERROR: 35,
155
- $accept: 0,
156
- $end: 1
157
- },
158
- terminals_: {
159
- 5: "EOF",
160
- 8: "STRING",
161
- 9: "&",
162
- 10: "=",
163
- 11: "+",
164
- 12: "(",
165
- 13: ")",
166
- 14: "<",
167
- 15: ">",
168
- 16: "NOT",
169
- 17: "-",
170
- 18: "*",
171
- 19: "/",
172
- 20: "^",
173
- 21: "FUNCTION",
174
- 24: "ABSOLUTE_CELL",
175
- 25: "RELATIVE_CELL",
176
- 26: "MIXED_CELL",
177
- 27: ":",
178
- 28: "ARRAY",
179
- 29: ";",
180
- 30: ",",
181
- 31: "VARIABLE",
182
- 32: "DECIMAL",
183
- 33: "NUMBER",
184
- 34: "%",
185
- 35: "ERROR"
186
- },
187
- productions_: [0, [3, 2], [4, 1], [4, 1], [4, 1], [4, 3], [4, 3], [4, 3], [4, 3], [4, 4], [4, 4], [4, 4], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 2], [4, 2], [4, 3], [4, 4], [4, 1], [4, 1], [4, 2], [23, 1], [23, 1], [23, 1], [23, 3], [23, 3], [23, 3], [23, 3], [23, 3], [23, 3], [23, 3], [23, 3], [23, 3], [22, 1], [22, 1], [22, 3], [22, 3], [6, 1], [6, 3], [7, 1], [7, 3], [7, 2], [2, 1]],
188
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
189
- /* this == yyval */
190
-
191
- var $0 = $$.length - 1;
192
- switch (yystate) {
193
- case 1:
194
- return $$[$0 - 1];
195
- break;
196
- case 2:
197
- this.$ = yy.callVariable($$[$0][0]);
198
- break;
199
- case 3:
200
- this.$ = yy.toNumber($$[$0]);
201
- break;
202
- case 4:
203
- this.$ = yy.trimEdges($$[$0]);
204
- break;
205
- case 5:
206
- this.$ = yy.evaluateByOperator("&", [$$[$0 - 2], $$[$0]]);
207
- break;
208
- case 6:
209
- this.$ = yy.evaluateByOperator("=", [$$[$0 - 2], $$[$0]]);
210
- break;
211
- case 7:
212
- this.$ = yy.evaluateByOperator("+", [$$[$0 - 2], $$[$0]]);
213
- break;
214
- case 8:
215
- this.$ = $$[$0 - 1];
216
- break;
217
- case 9:
218
- this.$ = yy.evaluateByOperator("<=", [$$[$0 - 3], $$[$0]]);
219
- break;
220
- case 10:
221
- this.$ = yy.evaluateByOperator(">=", [$$[$0 - 3], $$[$0]]);
222
- break;
223
- case 11:
224
- this.$ = yy.evaluateByOperator("<>", [$$[$0 - 3], $$[$0]]);
225
- break;
226
- case 12:
227
- this.$ = yy.evaluateByOperator("NOT", [$$[$0 - 2], $$[$0]]);
228
- break;
229
- case 13:
230
- this.$ = yy.evaluateByOperator(">", [$$[$0 - 2], $$[$0]]);
231
- break;
232
- case 14:
233
- this.$ = yy.evaluateByOperator("<", [$$[$0 - 2], $$[$0]]);
234
- break;
235
- case 15:
236
- this.$ = yy.evaluateByOperator("-", [$$[$0 - 2], $$[$0]]);
237
- break;
238
- case 16:
239
- this.$ = yy.evaluateByOperator("*", [$$[$0 - 2], $$[$0]]);
240
- break;
241
- case 17:
242
- this.$ = yy.evaluateByOperator("/", [$$[$0 - 2], $$[$0]]);
243
- break;
244
- case 18:
245
- this.$ = yy.evaluateByOperator("^", [$$[$0 - 2], $$[$0]]);
246
- break;
247
- case 19:
248
- var n1 = yy.invertNumber($$[$0]);
249
- this.$ = n1;
250
- if (isNaN(this.$)) {
251
- this.$ = 0;
252
- }
253
- break;
254
- case 20:
255
- var n1 = yy.toNumber($$[$0]);
256
- this.$ = n1;
257
- if (isNaN(this.$)) {
258
- this.$ = 0;
259
- }
260
- break;
261
- case 21:
262
- this.$ = yy.callFunction($$[$0 - 2]);
263
- break;
264
- case 22:
265
- this.$ = yy.callFunction($$[$0 - 3], $$[$0 - 1]);
266
- break;
267
- case 26:
268
- case 27:
269
- case 28:
270
- this.$ = yy.cellValue($$[$0]);
271
- break;
272
- case 29:
273
- case 30:
274
- case 31:
275
- case 32:
276
- case 33:
277
- case 34:
278
- case 35:
279
- case 36:
280
- case 37:
281
- this.$ = yy.rangeValue($$[$0 - 2], $$[$0]);
282
- break;
283
- case 38:
284
- case 42:
285
- this.$ = [$$[$0]];
286
- break;
287
- case 39:
288
- this.$ = yy.trimEdges(yytext).split(",");
289
- break;
290
- case 40:
291
- case 41:
292
- $$[$0 - 2].push($$[$0]);
293
- this.$ = $$[$0 - 2];
294
- break;
295
- case 43:
296
- this.$ = Array.isArray($$[$0 - 2]) ? $$[$0 - 2] : [$$[$0 - 2]];
297
- this.$.push($$[$0]);
298
- break;
299
- case 44:
300
- this.$ = $$[$0];
301
- break;
302
- case 45:
303
- this.$ = ($$[$0 - 2] + "." + $$[$0]) * 1;
304
- break;
305
- case 46:
306
- this.$ = $$[$0 - 1] * 0.01;
307
- break;
308
- case 47:
309
- this.$ = yy.throwError($$[$0]);
310
- break;
311
- }
312
- },
313
- table: [{
314
- 2: 11,
315
- 3: 1,
316
- 4: 2,
317
- 6: 3,
318
- 7: 4,
319
- 8: $V0,
320
- 11: $V1,
321
- 12: $V2,
322
- 17: $V3,
323
- 21: $V4,
324
- 23: 10,
325
- 24: $V5,
326
- 25: $V6,
327
- 26: $V7,
328
- 31: $V8,
329
- 33: $V9,
330
- 35: $Va
331
- }, {
332
- 1: [3]
333
- }, {
334
- 5: [1, 18],
335
- 9: $Vb,
336
- 10: $Vc,
337
- 11: $Vd,
338
- 14: $Ve,
339
- 15: $Vf,
340
- 16: $Vg,
341
- 17: $Vh,
342
- 18: $Vi,
343
- 19: $Vj,
344
- 20: $Vk
345
- }, o($Vl, [2, 2], {
346
- 32: [1, 29]
347
- }), o($Vl, [2, 3], {
348
- 34: [1, 30]
349
- }), o($Vl, [2, 4]), {
350
- 2: 11,
351
- 4: 31,
352
- 6: 3,
353
- 7: 4,
354
- 8: $V0,
355
- 11: $V1,
356
- 12: $V2,
357
- 17: $V3,
358
- 21: $V4,
359
- 23: 10,
360
- 24: $V5,
361
- 25: $V6,
362
- 26: $V7,
363
- 31: $V8,
364
- 33: $V9,
365
- 35: $Va
366
- }, {
367
- 2: 11,
368
- 4: 32,
369
- 6: 3,
370
- 7: 4,
371
- 8: $V0,
372
- 11: $V1,
373
- 12: $V2,
374
- 17: $V3,
375
- 21: $V4,
376
- 23: 10,
377
- 24: $V5,
378
- 25: $V6,
379
- 26: $V7,
380
- 31: $V8,
381
- 33: $V9,
382
- 35: $Va
383
- }, {
384
- 2: 11,
385
- 4: 33,
386
- 6: 3,
387
- 7: 4,
388
- 8: $V0,
389
- 11: $V1,
390
- 12: $V2,
391
- 17: $V3,
392
- 21: $V4,
393
- 23: 10,
394
- 24: $V5,
395
- 25: $V6,
396
- 26: $V7,
397
- 31: $V8,
398
- 33: $V9,
399
- 35: $Va
400
- }, {
401
- 12: [1, 34]
402
- }, o($Vl, [2, 23]), o($Vl, [2, 24], {
403
- 2: 35,
404
- 35: $Va
405
- }), o($Vm, [2, 42]), o($Vn, [2, 44], {
406
- 32: [1, 36]
407
- }), o($Vl, [2, 26], {
408
- 27: [1, 37]
409
- }), o($Vl, [2, 27], {
410
- 27: [1, 38]
411
- }), o($Vl, [2, 28], {
412
- 27: [1, 39]
413
- }), o([5, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30, 35], [2, 47]), {
414
- 1: [2, 1]
415
- }, {
416
- 2: 11,
417
- 4: 40,
418
- 6: 3,
419
- 7: 4,
420
- 8: $V0,
421
- 11: $V1,
422
- 12: $V2,
423
- 17: $V3,
424
- 21: $V4,
425
- 23: 10,
426
- 24: $V5,
427
- 25: $V6,
428
- 26: $V7,
429
- 31: $V8,
430
- 33: $V9,
431
- 35: $Va
432
- }, {
433
- 2: 11,
434
- 4: 41,
435
- 6: 3,
436
- 7: 4,
437
- 8: $V0,
438
- 11: $V1,
439
- 12: $V2,
440
- 17: $V3,
441
- 21: $V4,
442
- 23: 10,
443
- 24: $V5,
444
- 25: $V6,
445
- 26: $V7,
446
- 31: $V8,
447
- 33: $V9,
448
- 35: $Va
449
- }, {
450
- 2: 11,
451
- 4: 42,
452
- 6: 3,
453
- 7: 4,
454
- 8: $V0,
455
- 11: $V1,
456
- 12: $V2,
457
- 17: $V3,
458
- 21: $V4,
459
- 23: 10,
460
- 24: $V5,
461
- 25: $V6,
462
- 26: $V7,
463
- 31: $V8,
464
- 33: $V9,
465
- 35: $Va
466
- }, {
467
- 2: 11,
468
- 4: 45,
469
- 6: 3,
470
- 7: 4,
471
- 8: $V0,
472
- 10: [1, 43],
473
- 11: $V1,
474
- 12: $V2,
475
- 15: [1, 44],
476
- 17: $V3,
477
- 21: $V4,
478
- 23: 10,
479
- 24: $V5,
480
- 25: $V6,
481
- 26: $V7,
482
- 31: $V8,
483
- 33: $V9,
484
- 35: $Va
485
- }, {
486
- 2: 11,
487
- 4: 47,
488
- 6: 3,
489
- 7: 4,
490
- 8: $V0,
491
- 10: [1, 46],
492
- 11: $V1,
493
- 12: $V2,
494
- 17: $V3,
495
- 21: $V4,
496
- 23: 10,
497
- 24: $V5,
498
- 25: $V6,
499
- 26: $V7,
500
- 31: $V8,
501
- 33: $V9,
502
- 35: $Va
503
- }, {
504
- 2: 11,
505
- 4: 48,
506
- 6: 3,
507
- 7: 4,
508
- 8: $V0,
509
- 11: $V1,
510
- 12: $V2,
511
- 17: $V3,
512
- 21: $V4,
513
- 23: 10,
514
- 24: $V5,
515
- 25: $V6,
516
- 26: $V7,
517
- 31: $V8,
518
- 33: $V9,
519
- 35: $Va
520
- }, {
521
- 2: 11,
522
- 4: 49,
523
- 6: 3,
524
- 7: 4,
525
- 8: $V0,
526
- 11: $V1,
527
- 12: $V2,
528
- 17: $V3,
529
- 21: $V4,
530
- 23: 10,
531
- 24: $V5,
532
- 25: $V6,
533
- 26: $V7,
534
- 31: $V8,
535
- 33: $V9,
536
- 35: $Va
537
- }, {
538
- 2: 11,
539
- 4: 50,
540
- 6: 3,
541
- 7: 4,
542
- 8: $V0,
543
- 11: $V1,
544
- 12: $V2,
545
- 17: $V3,
546
- 21: $V4,
547
- 23: 10,
548
- 24: $V5,
549
- 25: $V6,
550
- 26: $V7,
551
- 31: $V8,
552
- 33: $V9,
553
- 35: $Va
554
- }, {
555
- 2: 11,
556
- 4: 51,
557
- 6: 3,
558
- 7: 4,
559
- 8: $V0,
560
- 11: $V1,
561
- 12: $V2,
562
- 17: $V3,
563
- 21: $V4,
564
- 23: 10,
565
- 24: $V5,
566
- 25: $V6,
567
- 26: $V7,
568
- 31: $V8,
569
- 33: $V9,
570
- 35: $Va
571
- }, {
572
- 2: 11,
573
- 4: 52,
574
- 6: 3,
575
- 7: 4,
576
- 8: $V0,
577
- 11: $V1,
578
- 12: $V2,
579
- 17: $V3,
580
- 21: $V4,
581
- 23: 10,
582
- 24: $V5,
583
- 25: $V6,
584
- 26: $V7,
585
- 31: $V8,
586
- 33: $V9,
587
- 35: $Va
588
- }, {
589
- 31: [1, 53]
590
- }, o($Vn, [2, 46]), {
591
- 9: $Vb,
592
- 10: $Vc,
593
- 11: $Vd,
594
- 13: [1, 54],
595
- 14: $Ve,
596
- 15: $Vf,
597
- 16: $Vg,
598
- 17: $Vh,
599
- 18: $Vi,
600
- 19: $Vj,
601
- 20: $Vk
602
- }, o($Vo, [2, 19], {
603
- 9: $Vb,
604
- 18: $Vi,
605
- 19: $Vj,
606
- 20: $Vk
607
- }), o($Vo, [2, 20], {
608
- 9: $Vb,
609
- 18: $Vi,
610
- 19: $Vj,
611
- 20: $Vk
612
- }), {
613
- 2: 11,
614
- 4: 57,
615
- 6: 3,
616
- 7: 4,
617
- 8: $V0,
618
- 11: $V1,
619
- 12: $V2,
620
- 13: [1, 55],
621
- 17: $V3,
622
- 21: $V4,
623
- 22: 56,
624
- 23: 10,
625
- 24: $V5,
626
- 25: $V6,
627
- 26: $V7,
628
- 28: [1, 58],
629
- 31: $V8,
630
- 33: $V9,
631
- 35: $Va
632
- }, o($Vl, [2, 25]), {
633
- 33: [1, 59]
634
- }, {
635
- 24: [1, 60],
636
- 25: [1, 61],
637
- 26: [1, 62]
638
- }, {
639
- 24: [1, 63],
640
- 25: [1, 64],
641
- 26: [1, 65]
642
- }, {
643
- 24: [1, 66],
644
- 25: [1, 67],
645
- 26: [1, 68]
646
- }, o($Vl, [2, 5]), o([5, 10, 13, 29, 30], [2, 6], {
647
- 9: $Vb,
648
- 11: $Vd,
649
- 14: $Ve,
650
- 15: $Vf,
651
- 16: $Vg,
652
- 17: $Vh,
653
- 18: $Vi,
654
- 19: $Vj,
655
- 20: $Vk
656
- }), o($Vo, [2, 7], {
657
- 9: $Vb,
658
- 18: $Vi,
659
- 19: $Vj,
660
- 20: $Vk
661
- }), {
662
- 2: 11,
663
- 4: 69,
664
- 6: 3,
665
- 7: 4,
666
- 8: $V0,
667
- 11: $V1,
668
- 12: $V2,
669
- 17: $V3,
670
- 21: $V4,
671
- 23: 10,
672
- 24: $V5,
673
- 25: $V6,
674
- 26: $V7,
675
- 31: $V8,
676
- 33: $V9,
677
- 35: $Va
678
- }, {
679
- 2: 11,
680
- 4: 70,
681
- 6: 3,
682
- 7: 4,
683
- 8: $V0,
684
- 11: $V1,
685
- 12: $V2,
686
- 17: $V3,
687
- 21: $V4,
688
- 23: 10,
689
- 24: $V5,
690
- 25: $V6,
691
- 26: $V7,
692
- 31: $V8,
693
- 33: $V9,
694
- 35: $Va
695
- }, o($Vp, [2, 14], {
696
- 9: $Vb,
697
- 11: $Vd,
698
- 17: $Vh,
699
- 18: $Vi,
700
- 19: $Vj,
701
- 20: $Vk
702
- }), {
703
- 2: 11,
704
- 4: 71,
705
- 6: 3,
706
- 7: 4,
707
- 8: $V0,
708
- 11: $V1,
709
- 12: $V2,
710
- 17: $V3,
711
- 21: $V4,
712
- 23: 10,
713
- 24: $V5,
714
- 25: $V6,
715
- 26: $V7,
716
- 31: $V8,
717
- 33: $V9,
718
- 35: $Va
719
- }, o($Vp, [2, 13], {
720
- 9: $Vb,
721
- 11: $Vd,
722
- 17: $Vh,
723
- 18: $Vi,
724
- 19: $Vj,
725
- 20: $Vk
726
- }), o([5, 10, 13, 16, 29, 30], [2, 12], {
727
- 9: $Vb,
728
- 11: $Vd,
729
- 14: $Ve,
730
- 15: $Vf,
731
- 17: $Vh,
732
- 18: $Vi,
733
- 19: $Vj,
734
- 20: $Vk
735
- }), o($Vo, [2, 15], {
736
- 9: $Vb,
737
- 18: $Vi,
738
- 19: $Vj,
739
- 20: $Vk
740
- }), o($Vq, [2, 16], {
741
- 9: $Vb,
742
- 20: $Vk
743
- }), o($Vq, [2, 17], {
744
- 9: $Vb,
745
- 20: $Vk
746
- }), o([5, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29, 30], [2, 18], {
747
- 9: $Vb
748
- }), o($Vm, [2, 43]), o($Vl, [2, 8]), o($Vl, [2, 21]), {
749
- 13: [1, 72],
750
- 29: [1, 73],
751
- 30: [1, 74]
752
- }, o($Vr, [2, 38], {
753
- 9: $Vb,
754
- 10: $Vc,
755
- 11: $Vd,
756
- 14: $Ve,
757
- 15: $Vf,
758
- 16: $Vg,
759
- 17: $Vh,
760
- 18: $Vi,
761
- 19: $Vj,
762
- 20: $Vk
763
- }), o($Vr, [2, 39]), o($Vn, [2, 45]), o($Vl, [2, 29]), o($Vl, [2, 30]), o($Vl, [2, 31]), o($Vl, [2, 32]), o($Vl, [2, 33]), o($Vl, [2, 34]), o($Vl, [2, 35]), o($Vl, [2, 36]), o($Vl, [2, 37]), o($Vp, [2, 9], {
764
- 9: $Vb,
765
- 11: $Vd,
766
- 17: $Vh,
767
- 18: $Vi,
768
- 19: $Vj,
769
- 20: $Vk
770
- }), o($Vp, [2, 11], {
771
- 9: $Vb,
772
- 11: $Vd,
773
- 17: $Vh,
774
- 18: $Vi,
775
- 19: $Vj,
776
- 20: $Vk
777
- }), o($Vp, [2, 10], {
778
- 9: $Vb,
779
- 11: $Vd,
780
- 17: $Vh,
781
- 18: $Vi,
782
- 19: $Vj,
783
- 20: $Vk
784
- }), o($Vl, [2, 22]), {
785
- 2: 11,
786
- 4: 75,
787
- 6: 3,
788
- 7: 4,
789
- 8: $V0,
790
- 11: $V1,
791
- 12: $V2,
792
- 17: $V3,
793
- 21: $V4,
794
- 23: 10,
795
- 24: $V5,
796
- 25: $V6,
797
- 26: $V7,
798
- 31: $V8,
799
- 33: $V9,
800
- 35: $Va
801
- }, {
802
- 2: 11,
803
- 4: 76,
804
- 6: 3,
805
- 7: 4,
806
- 8: $V0,
807
- 11: $V1,
808
- 12: $V2,
809
- 17: $V3,
810
- 21: $V4,
811
- 23: 10,
812
- 24: $V5,
813
- 25: $V6,
814
- 26: $V7,
815
- 31: $V8,
816
- 33: $V9,
817
- 35: $Va
818
- }, o($Vr, [2, 40], {
819
- 9: $Vb,
820
- 10: $Vc,
821
- 11: $Vd,
822
- 14: $Ve,
823
- 15: $Vf,
824
- 16: $Vg,
825
- 17: $Vh,
826
- 18: $Vi,
827
- 19: $Vj,
828
- 20: $Vk
829
- }), o($Vr, [2, 41], {
830
- 9: $Vb,
831
- 10: $Vc,
832
- 11: $Vd,
833
- 14: $Ve,
834
- 15: $Vf,
835
- 16: $Vg,
836
- 17: $Vh,
837
- 18: $Vi,
838
- 19: $Vj,
839
- 20: $Vk
840
- })],
841
- defaultActions: {
842
- 18: [2, 1]
843
- },
844
- parseError: function parseError(str, hash) {
845
- if (hash.recoverable) {
846
- this.trace(str);
847
- } else {
848
- var error = new Error(str);
849
- error.hash = hash;
850
- throw error;
851
- }
852
- },
853
- parse: function parse(input) {
854
- var _this = this;
855
- var self = this,
856
- stack = [0],
857
- tstack = [],
858
- // token stack
859
- vstack = [null],
860
- // semantic value stack
861
- lstack = [],
862
- // location stack
863
- table = this.table,
864
- yytext = "",
865
- yylineno = 0,
866
- yyleng = 0,
867
- recovering = 0,
868
- TERROR = 2,
869
- EOF = 1;
870
- var args = lstack.slice.call(arguments, 1);
871
-
872
- //this.reductionCount = this.shiftCount = 0;
873
-
874
- var lexer = Object.create(this.lexer);
875
- var sharedState = {
876
- yy: {}
877
- };
878
- // copy state
879
- for (var k in this.yy) {
880
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
881
- sharedState.yy[k] = this.yy[k];
882
- }
883
- }
884
- lexer.setInput(input, sharedState.yy);
885
- sharedState.yy.lexer = lexer;
886
- sharedState.yy.parser = this;
887
- if (typeof lexer.yylloc == "undefined") {
888
- lexer.yylloc = {};
889
- }
890
- var yyloc = lexer.yylloc;
891
- lstack.push(yyloc);
892
- var ranges = lexer.options && lexer.options.ranges;
893
- if (typeof sharedState.yy.parseError === "function") {
894
- this.parseError = sharedState.yy.parseError;
895
- } else {
896
- this.parseError = Object.getPrototypeOf(this).parseError;
897
- }
898
- function popStack(n) {
899
- stack.length = stack.length - 2 * n;
900
- vstack.length = vstack.length - n;
901
- lstack.length = lstack.length - n;
902
- }
903
- var lex = function lex() {
904
- var token;
905
- token = lexer.lex() || EOF;
906
- // if token isn't its numeric value, convert
907
- if (typeof token !== "number") {
908
- token = self.symbols_[token] || token;
909
- }
910
- return token;
911
- };
912
- var symbol,
913
- preErrorSymbol,
914
- state,
915
- action,
916
- a,
917
- r,
918
- yyval = {},
919
- p,
920
- len,
921
- newState,
922
- expected;
923
- var _loop = function _loop() {
924
- // retreive state number from top of stack
925
- stackCache = stack;
926
- state = stack[stack.length - 1];
927
-
928
- // use default actions if available
929
- if (_this.defaultActions[state]) {
930
- action = _this.defaultActions[state];
931
- } else {
932
- if (symbol === null || typeof symbol == "undefined") {
933
- symbol = lex();
934
- }
935
- // read action for current state and first input
936
- action = table[state] && table[state][symbol];
937
- }
938
-
939
- // handle parse error
940
- if (typeof action === "undefined" || !action.length || !action[0]) {
941
- // Return the rule stack depth where the nearest error rule can be found.
942
- // Return FALSE when no error recovery rule was found.
943
- var locateNearestErrorRecoveryRule = function locateNearestErrorRecoveryRule(state) {
944
- var stack_probe = stack.length - 1;
945
- var depth = 0;
946
-
947
- // try to recover from error
948
- for (;;) {
949
- // check for error recovery rule in this state
950
- if (TERROR.toString() in table[state]) {
951
- return depth;
952
- }
953
- if (state === 0 || stack_probe < 2) {
954
- return false; // No suitable error recovery rule available.
955
- }
956
- stack_probe -= 2; // popStack(1): [symbol, action]
957
- state = stack[stack_probe];
958
- ++depth;
959
- }
960
- };
961
- errStr = "";
962
- if (!recovering) {
963
- // first see if there's any chance at hitting an error recovery rule:
964
- error_rule_depth = locateNearestErrorRecoveryRule(state);
965
-
966
- // Report error
967
- expected = [];
968
- for (p in table[state]) {
969
- if (_this.terminals_[p] && p > TERROR) {
970
- expected.push("'" + _this.terminals_[p] + "'");
971
- }
972
- }
973
- if (lexer.showPosition) {
974
- errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (_this.terminals_[symbol] || symbol) + "'";
975
- } else {
976
- errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (_this.terminals_[symbol] || symbol) + "'");
977
- }
978
- _this.parseError(errStr, {
979
- text: lexer.match,
980
- token: _this.terminals_[symbol] || symbol,
981
- line: lexer.yylineno,
982
- loc: yyloc,
983
- expected: expected,
984
- recoverable: error_rule_depth !== false
985
- });
986
- } else if (preErrorSymbol !== EOF) {
987
- error_rule_depth = locateNearestErrorRecoveryRule(state);
988
- }
989
-
990
- // just recovered from another error
991
- if (recovering == 3) {
992
- if (symbol === EOF || preErrorSymbol === EOF) {
993
- throw new Error(errStr || "Parsing halted while starting to recover from another error.");
994
- }
995
-
996
- // discard current lookahead and grab another
997
- yyleng = lexer.yyleng;
998
- yytext = lexer.yytext;
999
- yylineno = lexer.yylineno;
1000
- yyloc = lexer.yylloc;
1001
- symbol = lex();
1002
- }
1003
-
1004
- // try to recover from error
1005
- if (error_rule_depth === false) {
1006
- throw new Error(errStr || "Parsing halted. No suitable error recovery rule available.");
1007
- }
1008
- popStack(error_rule_depth);
1009
- preErrorSymbol = symbol == TERROR ? null : symbol; // save the lookahead token
1010
- symbol = TERROR; // insert generic error symbol as new lookahead
1011
- state = stack[stack.length - 1];
1012
- action = table[state] && table[state][TERROR];
1013
- recovering = 3; // allow 3 real symbols to be shifted before reporting a new error
1014
- }
1015
-
1016
- // this shouldn't happen, unless resolve defaults are off
1017
- if (action[0] instanceof Array && action.length > 1) {
1018
- throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
1019
- }
1020
- switch (action[0]) {
1021
- case 1:
1022
- // shift
1023
- //this.shiftCount++;
1024
-
1025
- stack.push(symbol);
1026
- vstack.push(lexer.yytext);
1027
- lstack.push(lexer.yylloc);
1028
- stack.push(action[1]); // push state
1029
- symbol = null;
1030
- if (!preErrorSymbol) {
1031
- // normal execution/no error
1032
- yyleng = lexer.yyleng;
1033
- yytext = lexer.yytext;
1034
- yylineno = lexer.yylineno;
1035
- yyloc = lexer.yylloc;
1036
- if (recovering > 0) {
1037
- recovering--;
1038
- }
1039
- } else {
1040
- // error just occurred, resume old lookahead f/ before error
1041
- symbol = preErrorSymbol;
1042
- preErrorSymbol = null;
1043
- }
1044
- break;
1045
- case 2:
1046
- // reduce
1047
- //this.reductionCount++;
1048
-
1049
- len = _this.productions_[action[1]][1];
1050
-
1051
- // perform semantic action
1052
- yyval.$ = vstack[vstack.length - len]; // default to $$ = $1
1053
- // default location, uses first token for firsts, last for lasts
1054
- yyval._$ = {
1055
- first_line: lstack[lstack.length - (len || 1)].first_line,
1056
- last_line: lstack[lstack.length - 1].last_line,
1057
- first_column: lstack[lstack.length - (len || 1)].first_column,
1058
- last_column: lstack[lstack.length - 1].last_column
1059
- };
1060
- if (ranges) {
1061
- yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
1062
- }
1063
- r = _this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
1064
- if (typeof r !== "undefined") {
1065
- return {
1066
- v: r
1067
- };
1068
- }
1069
-
1070
- // pop off stack
1071
- if (len) {
1072
- stack = stack.slice(0, -1 * len * 2);
1073
- vstack = vstack.slice(0, -1 * len);
1074
- lstack = lstack.slice(0, -1 * len);
1075
- }
1076
- stack.push(_this.productions_[action[1]][0]); // push nonterminal (reduce)
1077
- vstack.push(yyval.$);
1078
- lstack.push(yyval._$);
1079
- // goto new state = table[STATE][NONTERMINAL]
1080
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
1081
- stack.push(newState);
1082
- break;
1083
- case 3:
1084
- // accept
1085
- return {
1086
- v: true
1087
- };
1088
- }
1089
- },
1090
- error_rule_depth,
1091
- errStr,
1092
- _ret;
1093
- while (true) {
1094
- _ret = _loop();
1095
- if (_ret) return _ret.v;
1096
- }
1097
- return true;
1098
- }
1099
- };
1100
-
1101
- /* generated by jison-lex 0.3.4 */
1102
- var lexer = function () {
1103
- var lexer = {
1104
- EOF: 1,
1105
- parseError: function parseError(str, hash) {
1106
- if (this.yy.parser) {
1107
- this.yy.parser.parseError(str, hash);
1108
- } else {
1109
- throw new Error(str);
1110
- }
1111
- },
1112
- // resets the lexer, sets new input
1113
- setInput: function setInput(input, yy) {
1114
- this.yy = yy || this.yy || {};
1115
- this._input = input;
1116
- this._more = this._backtrack = this.done = false;
1117
- this.yylineno = this.yyleng = 0;
1118
- this.yytext = this.matched = this.match = "";
1119
- this.conditionStack = ["INITIAL"];
1120
- this.yylloc = {
1121
- first_line: 1,
1122
- first_column: 0,
1123
- last_line: 1,
1124
- last_column: 0
1125
- };
1126
- if (this.options.ranges) {
1127
- this.yylloc.range = [0, 0];
1128
- }
1129
- this.offset = 0;
1130
- return this;
1131
- },
1132
- // consumes and returns one char from the input
1133
- input: function input() {
1134
- var ch = this._input[0];
1135
- this.yytext += ch;
1136
- this.yyleng++;
1137
- this.offset++;
1138
- this.match += ch;
1139
- this.matched += ch;
1140
- var lines = ch.match(/(?:\r\n?|\n).*/g);
1141
- if (lines) {
1142
- this.yylineno++;
1143
- this.yylloc.last_line++;
1144
- } else {
1145
- this.yylloc.last_column++;
1146
- }
1147
- if (this.options.ranges) {
1148
- this.yylloc.range[1]++;
1149
- }
1150
- this._input = this._input.slice(1);
1151
- return ch;
1152
- },
1153
- // unshifts one char (or a string) into the input
1154
- unput: function unput(ch) {
1155
- var len = ch.length;
1156
- var lines = ch.split(/(?:\r\n?|\n)/g);
1157
- this._input = ch + this._input;
1158
- this.yytext = this.yytext.substr(0, this.yytext.length - len);
1159
- //this.yyleng -= len;
1160
- this.offset -= len;
1161
- var oldLines = this.match.split(/(?:\r\n?|\n)/g);
1162
- this.match = this.match.substr(0, this.match.length - 1);
1163
- this.matched = this.matched.substr(0, this.matched.length - 1);
1164
- if (lines.length - 1) {
1165
- this.yylineno -= lines.length - 1;
1166
- }
1167
- var r = this.yylloc.range;
1168
- this.yylloc = {
1169
- first_line: this.yylloc.first_line,
1170
- last_line: this.yylineno + 1,
1171
- first_column: this.yylloc.first_column,
1172
- last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
1173
- };
1174
- if (this.options.ranges) {
1175
- this.yylloc.range = [r[0], r[0] + this.yyleng - len];
1176
- }
1177
- this.yyleng = this.yytext.length;
1178
- return this;
1179
- },
1180
- // When called from action, caches matched text and appends it on next action
1181
- more: function more() {
1182
- this._more = true;
1183
- return this;
1184
- },
1185
- // 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.
1186
- reject: function reject() {
1187
- if (this.options.backtrack_lexer) {
1188
- this._backtrack = true;
1189
- } else {
1190
- 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(), {
1191
- text: "",
1192
- token: null,
1193
- line: this.yylineno
1194
- });
1195
- }
1196
- return this;
1197
- },
1198
- // retain first n characters of the match
1199
- less: function less(n) {
1200
- this.unput(this.match.slice(n));
1201
- },
1202
- // displays already matched input, i.e. for error messages
1203
- pastInput: function pastInput() {
1204
- var past = this.matched.substr(0, this.matched.length - this.match.length);
1205
- return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
1206
- },
1207
- // displays upcoming input, i.e. for error messages
1208
- upcomingInput: function upcomingInput() {
1209
- var next = this.match;
1210
- if (next.length < 20) {
1211
- next += this._input.substr(0, 20 - next.length);
1212
- }
1213
- return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
1214
- },
1215
- // displays the character position where the lexing error occurred, i.e. for error messages
1216
- showPosition: function showPosition() {
1217
- var pre = this.pastInput();
1218
- var c = new Array(pre.length + 1).join("-");
1219
- return pre + this.upcomingInput() + "\n" + c + "^";
1220
- },
1221
- // test the lexed token: return FALSE when not a match, otherwise return token
1222
- test_match: function test_match(match, indexed_rule) {
1223
- var token, lines, backup;
1224
- if (this.options.backtrack_lexer) {
1225
- // save context
1226
- backup = {
1227
- yylineno: this.yylineno,
1228
- yylloc: {
1229
- first_line: this.yylloc.first_line,
1230
- last_line: this.last_line,
1231
- first_column: this.yylloc.first_column,
1232
- last_column: this.yylloc.last_column
1233
- },
1234
- yytext: this.yytext,
1235
- match: this.match,
1236
- matches: this.matches,
1237
- matched: this.matched,
1238
- yyleng: this.yyleng,
1239
- offset: this.offset,
1240
- _more: this._more,
1241
- _input: this._input,
1242
- yy: this.yy,
1243
- conditionStack: this.conditionStack.slice(0),
1244
- done: this.done
1245
- };
1246
- if (this.options.ranges) {
1247
- backup.yylloc.range = this.yylloc.range.slice(0);
1248
- }
1249
- }
1250
- lines = match[0].match(/(?:\r\n?|\n).*/g);
1251
- if (lines) {
1252
- this.yylineno += lines.length;
1253
- }
1254
- this.yylloc = {
1255
- first_line: this.yylloc.last_line,
1256
- last_line: this.yylineno + 1,
1257
- first_column: this.yylloc.last_column,
1258
- last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
1259
- };
1260
- this.yytext += match[0];
1261
- this.match += match[0];
1262
- this.matches = match;
1263
- this.yyleng = this.yytext.length;
1264
- if (this.options.ranges) {
1265
- this.yylloc.range = [this.offset, this.offset += this.yyleng];
1266
- }
1267
- this._more = false;
1268
- this._backtrack = false;
1269
- this._input = this._input.slice(match[0].length);
1270
- this.matched += match[0];
1271
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
1272
- if (this.done && this._input) {
1273
- this.done = false;
1274
- }
1275
- if (token) {
1276
- return token;
1277
- } else if (this._backtrack) {
1278
- // recover context
1279
- for (var k in backup) {
1280
- this[k] = backup[k];
1281
- }
1282
- return false; // rule action called reject() implying the next rule should be tested instead.
1283
- }
1284
- return false;
1285
- },
1286
- // return next match in input
1287
- next: function next() {
1288
- if (this.done) {
1289
- return this.EOF;
1290
- }
1291
- if (!this._input) {
1292
- this.done = true;
1293
- }
1294
- var token, match, tempMatch, index;
1295
- if (!this._more) {
1296
- this.yytext = "";
1297
- this.match = "";
1298
- }
1299
- var rules = this._currentRules();
1300
- for (var i = 0; i < rules.length; i++) {
1301
- tempMatch = this._input.match(this.rules[rules[i]]);
1302
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
1303
- match = tempMatch;
1304
- index = i;
1305
- var stackLen = stackCache.length;
1306
- if (rules[i] === 8 && match[0].match(NUMONLY) && !(match.input.slice(match[0].length)[0] === ":" || stackLen > 3 && stackCache[stackLen - 4] === 25 && stackCache[stackLen - 2] === 27)) {
1307
- match = false;
1308
- continue;
1309
- }
1310
- if (this.options.backtrack_lexer) {
1311
- token = this.test_match(tempMatch, rules[i]);
1312
- if (token !== false) {
1313
- return token;
1314
- } else if (this._backtrack) {
1315
- match = false;
1316
- continue; // rule action called reject() implying a rule MISmatch.
1317
- } else {
1318
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
1319
- return false;
1320
- }
1321
- } else if (!this.options.flex) {
1322
- break;
1323
- }
1324
- }
1325
- }
1326
- if (match) {
1327
- token = this.test_match(match, rules[index]);
1328
- if (token !== false) {
1329
- return token;
1330
- }
1331
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
1332
- return false;
1333
- }
1334
- if (this._input === "") {
1335
- return this.EOF;
1336
- } else {
1337
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
1338
- text: "",
1339
- token: null,
1340
- line: this.yylineno
1341
- });
1342
- }
1343
- },
1344
- // return next match that has a token
1345
- lex: function lex() {
1346
- var r = this.next();
1347
- if (r) {
1348
- return r;
1349
- } else {
1350
- return this.lex();
1351
- }
1352
- },
1353
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
1354
- begin: function begin(condition) {
1355
- this.conditionStack.push(condition);
1356
- },
1357
- // pop the previously active lexer condition state off the condition stack
1358
- popState: function popState() {
1359
- var n = this.conditionStack.length - 1;
1360
- if (n > 0) {
1361
- return this.conditionStack.pop();
1362
- } else {
1363
- return this.conditionStack[0];
1364
- }
1365
- },
1366
- // produce the lexer rule set which is active for the currently active lexer condition state
1367
- _currentRules: function _currentRules() {
1368
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
1369
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
1370
- } else {
1371
- return this.conditions["INITIAL"].rules;
1372
- }
1373
- },
1374
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
1375
- topState: function topState(n) {
1376
- n = this.conditionStack.length - 1 - Math.abs(n || 0);
1377
- if (n >= 0) {
1378
- return this.conditionStack[n];
1379
- } else {
1380
- return "INITIAL";
1381
- }
1382
- },
1383
- // alias for begin(condition)
1384
- pushState: function pushState(condition) {
1385
- this.begin(condition);
1386
- },
1387
- // return the number of states currently on the stack
1388
- stateStackSize: function stateStackSize() {
1389
- return this.conditionStack.length;
1390
- },
1391
- options: {},
1392
- performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
1393
- var YYSTATE = YY_START;
1394
- switch ($avoiding_name_collisions) {
1395
- case 0 /* skip whitespace */:
1396
- break;
1397
- case 1:
1398
- return 8;
1399
- break;
1400
- case 2:
1401
- return 8;
1402
- break;
1403
- case 3:
1404
- return 21;
1405
- break;
1406
- case 4:
1407
- return 35;
1408
- break;
1409
- case 5:
1410
- return 24;
1411
- break;
1412
- case 6:
1413
- return 26;
1414
- break;
1415
- case 7:
1416
- return 26;
1417
- break;
1418
- case 8:
1419
- return 25;
1420
- break;
1421
- case 9:
1422
- return 21;
1423
- break;
1424
- case 10:
1425
- return 31;
1426
- break;
1427
- case 11:
1428
- return 31;
1429
- break;
1430
- case 12:
1431
- return 33;
1432
- break;
1433
- case 13:
1434
- return 28;
1435
- break;
1436
- case 14:
1437
- return 9;
1438
- break;
1439
- case 15:
1440
- return " ";
1441
- break;
1442
- case 16:
1443
- return 32;
1444
- break;
1445
- case 17:
1446
- return 27;
1447
- break;
1448
- case 18:
1449
- return 29;
1450
- break;
1451
- case 19:
1452
- return 30;
1453
- break;
1454
- case 20:
1455
- return 18;
1456
- break;
1457
- case 21:
1458
- return 19;
1459
- break;
1460
- case 22:
1461
- return 17;
1462
- break;
1463
- case 23:
1464
- return 11;
1465
- break;
1466
- case 24:
1467
- return 20;
1468
- break;
1469
- case 25:
1470
- return 12;
1471
- break;
1472
- case 26:
1473
- return 13;
1474
- break;
1475
- case 27:
1476
- return 15;
1477
- break;
1478
- case 28:
1479
- return 14;
1480
- break;
1481
- case 29:
1482
- return 16;
1483
- break;
1484
- case 30:
1485
- return '"';
1486
- break;
1487
- case 31:
1488
- return "'";
1489
- break;
1490
- case 32:
1491
- return "!";
1492
- break;
1493
- case 33:
1494
- return 10;
1495
- break;
1496
- case 34:
1497
- return 34;
1498
- break;
1499
- case 35:
1500
- return "#";
1501
- break;
1502
- case 36:
1503
- return 5;
1504
- break;
1505
- }
1506
- },
1507
- rules: [/^(?:\s+)/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*'[^'!])/, /^(?:[A-Za-z]{1,}[A-Za-z_0-9\.]+(?=[(]))/, /^(?:#[A-Z0-9\/]+(!|\?)?)/, ABSOLUTE_CELL, MIXED_CELL_COL, MIXED_CELL_ROW, RELATIVE_CELL, /^(?:[A-Za-z\.]+(?=[(]))/, /^(?:[A-Za-z]{1,}[A-Za-z_0-9]+)/, /^(?:[A-Za-z_]+)/, /^(?:[0-9]+)/, /^(?:\[(.*)?\])/, /^(?:&)/, /^(?: )/, /^(?:[.])/, /^(?::)/, /^(?:;)/, /^(?:,)/, /^(?:\*)/, /^(?:\/)/, /^(?:-)/, /^(?:\+)/, /^(?:\^)/, /^(?:\()/, /^(?:\))/, /^(?:>)/, /^(?:<)/, /^(?:NOT\b)/, /^(?:")/, /^(?:')/, /^(?:!)/, /^(?:=)/, /^(?:%)/, /^(?:[#])/, /^(?:$)/],
1508
- conditions: {
1509
- INITIAL: {
1510
- rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36],
1511
- inclusive: true
1512
- }
1513
- }
1514
- };
1515
- return lexer;
1516
- }();
1517
- parser.lexer = lexer;
1518
- export function Parser() {
1519
- this.yy = {};
1520
- }
1521
- Parser.prototype = parser;
1522
- parser.Parser = Parser;