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