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