Debian Codegraph @

vendor/wikimedia/shellbox/src/ShellParser/PEGParser.php

raw
1 <?php
2 /*
3 * Generated by WikiPEG
4 */
5
6
7 namespace Shellbox\ShellParser;
8
9
10 use Wikimedia\WikiPEG\InternalError;
11 // @phan-file-suppress PhanUnusedGotoLabel
12 // @phan-file-suppress PhanNoopSwitchCases
13
14
15
16 class PEGParserCacheEntry {
17 public $nextPos;
18 public $result;
19
20
21 public function __construct( $nextPos, $result ) {
22 $this->nextPos = $nextPos;
23 $this->result = $result;
24
25 }
26 }
27
28
29 class PEGParser extends \Wikimedia\WikiPEG\PEGParserBase {
30 // initializer
31
32 /**
33 * Overridable tree node constructor
34 *
35 * @stable to override
36 * @param string $type
37 * @param array|Node|string $contents
38 * @return Node
39 */
40 protected function node( $type, $contents ) {
41 return new Node( $type, $contents );
42 }
43
44 /**
45 * Combine arrays and non-array items into a single flat array.
46 *
47 * @param array|Node|string|null ...$items
48 * @return array
49 * @phan-return array<Node|string>
50 */
51 private function merge( ...$items ) {
52 if ( !$items ) {
53 return [];
54 }
55 $mergeArgs = [];
56 foreach ( $items as $item ) {
57 if ( $item !== null ) {
58 if ( !is_array( $item ) ) {
59 $mergeArgs[] = [ $item ];
60 } else {
61 $mergeArgs[] = $item;
62 }
63 }
64 }
65 return array_merge( ...$mergeArgs );
66 }
67
68
69 // cache init
70 protected $cache = [];
71
72 // expectations
73 protected $expectations = [
74 0 => ["type" => "end", "description" => "end of input"],
75 1 => ["type" => "literal", "value" => "\x0a", "description" => "\"\\n\""],
76 2 => ["type" => "class", "value" => "[ \\t\\v\\r\\f]", "description" => "[ \\t\\v\\r\\f]"],
77 3 => ["type" => "literal", "value" => "#", "description" => "\"#\""],
78 4 => ["type" => "class", "value" => "[^\\n]", "description" => "[^\\n]"],
79 5 => ["type" => "literal", "value" => "&&", "description" => "\"&&\""],
80 6 => ["type" => "literal", "value" => "||", "description" => "\"||\""],
81 7 => ["type" => "literal", "value" => "&", "description" => "\"&\""],
82 8 => ["type" => "literal", "value" => ";", "description" => "\";\""],
83 9 => ["type" => "literal", "value" => "!", "description" => "\"!\""],
84 10 => ["type" => "literal", "value" => ";;", "description" => "\";;\""],
85 11 => ["type" => "literal", "value" => "|", "description" => "\"|\""],
86 12 => ["type" => "class", "value" => "[_a-zA-Z]", "description" => "[_a-zA-Z]"],
87 13 => ["type" => "class", "value" => "[_a-zA-Z0-9]", "description" => "[_a-zA-Z0-9]"],
88 14 => ["type" => "literal", "value" => "(", "description" => "\"(\""],
89 15 => ["type" => "literal", "value" => ")", "description" => "\")\""],
90 16 => ["type" => "literal", "value" => "=", "description" => "\"=\""],
91 17 => ["type" => "literal", "value" => "{", "description" => "\"{\""],
92 18 => ["type" => "literal", "value" => "}", "description" => "\"}\""],
93 19 => ["type" => "literal", "value" => "for", "description" => "\"for\""],
94 20 => ["type" => "literal", "value" => "case", "description" => "\"case\""],
95 21 => ["type" => "literal", "value" => "esac", "description" => "\"esac\""],
96 22 => ["type" => "literal", "value" => "if", "description" => "\"if\""],
97 23 => ["type" => "literal", "value" => "then", "description" => "\"then\""],
98 24 => ["type" => "literal", "value" => "fi", "description" => "\"fi\""],
99 25 => ["type" => "literal", "value" => "while", "description" => "\"while\""],
100 26 => ["type" => "literal", "value" => "until", "description" => "\"until\""],
101 27 => ["type" => "class", "value" => "[0-9]", "description" => "[0-9]"],
102 28 => ["type" => "literal", "value" => "'", "description" => "\"'\""],
103 29 => ["type" => "class", "value" => "[^']", "description" => "[^']"],
104 30 => ["type" => "literal", "value" => "\"", "description" => "\"\\\"\""],
105 31 => ["type" => "literal", "value" => "\\", "description" => "\"\\\\\""],
106 32 => ["type" => "class", "value" => "[^\"`\$\\\\]", "description" => "[^\"`\$\\\\]"],
107 33 => ["type" => "literal", "value" => "`", "description" => "\"`\""],
108 34 => ["type" => "literal", "value" => "\$", "description" => "\"\$\""],
109 35 => ["type" => "class", "value" => "[^`\$\\\\]", "description" => "[^`\$\\\\]"],
110 36 => ["type" => "class", "value" => "[^'\"\\\\`\$ \\t\\v\\r\\f\\n&|;<>(){}]", "description" => "[^'\"\\\\`\$ \\t\\v\\r\\f\\n&|;<>(){}]"],
111 37 => ["type" => "class", "value" => "[^'\"\\\\`\$ \\t\\v\\r\\f\\n&|;<>()]", "description" => "[^'\"\\\\`\$ \\t\\v\\r\\f\\n&|;<>()]"],
112 38 => ["type" => "literal", "value" => "else", "description" => "\"else\""],
113 39 => ["type" => "literal", "value" => "elif", "description" => "\"elif\""],
114 40 => ["type" => "literal", "value" => "do", "description" => "\"do\""],
115 41 => ["type" => "literal", "value" => "done", "description" => "\"done\""],
116 42 => ["type" => "literal", "value" => "in", "description" => "\"in\""],
117 43 => ["type" => "literal", "value" => "<&", "description" => "\"<&\""],
118 44 => ["type" => "literal", "value" => "<>", "description" => "\"<>\""],
119 45 => ["type" => "literal", "value" => "<", "description" => "\"<\""],
120 46 => ["type" => "literal", "value" => ">&", "description" => "\">&\""],
121 47 => ["type" => "literal", "value" => ">>", "description" => "\">>\""],
122 48 => ["type" => "literal", "value" => ">|", "description" => "\">|\""],
123 49 => ["type" => "literal", "value" => ">", "description" => "\">\""],
124 50 => ["type" => "literal", "value" => "<<-", "description" => "\"<<-\""],
125 51 => ["type" => "literal", "value" => "<<", "description" => "\"<<\""],
126 52 => ["type" => "class", "value" => "[\$`\"\\\\\\n]", "description" => "[\$`\"\\\\\\n]"],
127 53 => ["type" => "class", "value" => "[\$\\\\]", "description" => "[\$\\\\]"],
128 54 => ["type" => "literal", "value" => "\\`", "description" => "\"\\\\`\""],
129 55 => ["type" => "class", "value" => "[@*#?\\-\$!0]", "description" => "[@*#?\\-\$!0]"],
130 56 => ["type" => "class", "value" => "[1-9]", "description" => "[1-9]"],
131 57 => ["type" => "literal", "value" => "((", "description" => "\"((\""],
132 58 => ["type" => "literal", "value" => "))", "description" => "\"))\""],
133 59 => ["type" => "literal", "value" => ":", "description" => "\":\""],
134 60 => ["type" => "class", "value" => "[\\-=?+]", "description" => "[\\-=?+]"],
135 61 => ["type" => "literal", "value" => "%%", "description" => "\"%%\""],
136 62 => ["type" => "literal", "value" => "##", "description" => "\"##\""],
137 63 => ["type" => "class", "value" => "[%#\\-=?+]", "description" => "[%#\\-=?+]"],
138 ];
139
140 // actions
141 private function a0($commands) {
142
143 return $this->node( 'program', $commands );
144
145 }
146 private function a1() {
147
148 return $this->node( 'program', [] );
149
150 }
151 private function a2($c) {
152
153 return $c;
154
155 }
156 private function a3($item, $separator) {
157
158 if ( $separator && $separator[0] === '&' ) {
159 return $this->node( 'background', $item );
160 } else {
161 return $item;
162 }
163
164 }
165 private function a4($nodes, $last) {
166
167 if ( $last ) {
168 $nodes[] = $last;
169 }
170 if ( count( $nodes ) > 1 ) {
171 return $this->node( 'list', $nodes );
172 } else {
173 return $nodes[0];
174 }
175
176 }
177 private function a5($list) {
178
179 return $this->node( 'complete_command', $list );
180
181 }
182 private function a6($first, $pipeline) {
183
184 return $this->node( 'and_if', $pipeline );
185
186 }
187 private function a7($first, $pipeline) {
188
189 return $this->node( 'or_if', $pipeline );
190
191 }
192 private function a8($first, $rest) {
193
194 return $this->merge( $first, $rest );
195
196 }
197 private function a9($bang, $pipeline) {
198
199 if ( $bang !== null ) {
200 return $this->node( 'bang', $pipeline );
201 } else {
202 return $pipeline;
203 }
204
205 }
206 private function a10($first, $command) {
207
208 return $command;
209
210 }
211 private function a11($first, $rest) {
212
213 if ( count( $rest ) ) {
214 return $this->node( 'pipeline', $this->merge( $first, $rest ) );
215 } else {
216 return $first;
217 }
218
219 }
220 private function a12($c, $r) {
221
222 if ( $r !== null ) {
223 return $this->merge( $c, $r );
224 } else {
225 return $c;
226 }
227
228 }
229 private function a13($fname, $body) {
230
231 return $this->node( 'function_definition',
232 $this->merge( $this->node( 'function_name', $fname ), $body ) );
233
234 }
235 private function a14($prefix, $word, $suffix) {
236
237 $contents = [ $prefix, $word ];
238 if ( $suffix !== null ) {
239 $contents = array_merge( $contents, $suffix );
240 }
241 return $this->node( 'simple_command', $contents );
242
243 }
244 private function a15($prefix) {
245
246 return $this->node( 'simple_command', [ $prefix ] );
247
248 }
249 private function a16($name, $suffix) {
250
251 $contents = [ $name ];
252 if ( $suffix ) {
253 $contents = array_merge( $contents, $suffix );
254 }
255 return $this->node( 'simple_command', $contents );
256
257 }
258 private function a17($c, $r) {
259
260 if ( $r !== null ) {
261 return $this->merge( $c, $r );
262 } else {
263 return $c;
264 }
265
266 }
267 private function a18($contents) {
268
269 return $this->node( 'cmd_prefix', $contents );
270
271 }
272 private function a19($parts) {
273
274 return $this->node( 'word', $parts );
275
276 }
277 private function a20($word) {
278
279 return $word;
280
281 }
282 private function a21($list) {
283
284 return $this->node( 'brace_group', $list );
285
286 }
287 private function a22($list) {
288
289 return $this->node( 'subshell', $list );
290
291 }
292 private function a23($name, $wordlist, $do_group) {
293
294 return $this->node( 'for', [ $name, $this->node( 'in', $wordlist ?: [] ), $do_group ] );
295
296 }
297 private function a24($name, $do_group) {
298
299 return $this->node( 'for', [ $name, $do_group ] );
300
301 }
302 private function a25($word, $list_esac) {
303
304 if ( is_array( $list_esac ) ) {
305 $list = $list_esac[0];
306 } else {
307 $list = [];
308 }
309 return $this->node( 'case', [ $word, $this->node( 'in', $list ) ] );
310
311 }
312 private function a26($condition, $consequent, $else_part) {
313
314 $contents = [
315 $this->node( 'condition', $condition ),
316 $this->node( 'consequent', $consequent )
317 ];
318 if ( $else_part !== null ) {
319 $contents = $this->merge( $contents, $else_part );
320 }
321 return $this->node( 'if', $contents );
322
323 }
324 private function a27($list, $body) {
325
326 return $this->node( 'while', [
327 $this->node( 'condition', $list ),
328 $body
329 ] );
330
331 }
332 private function a28($list, $body) {
333
334 return $this->node( 'until', [
335 $this->node( 'condition', $list ),
336 $body
337 ] );
338
339 }
340 private function a29($number, $file_or_here) {
341
342 $contents = [];
343 if ( $number !== null ) {
344 $contents[] = $this->node( 'io_subject', $number );
345 }
346 $contents[] = $file_or_here;
347 return $this->node( 'io_redirect', $contents );
348
349 }
350 private function a30($name, $word) {
351
352 return $this->node( 'assignment', [ $this->node( 'name', $name ), $word ] );
353
354 }
355 private function a31($term, $separator) {
356
357 if ( $separator && $separator[0] === '&' ) {
358 return $this->node( 'background', $term );
359 } else {
360 return $term;
361 }
362
363 }
364 private function a32($terms, $last) {
365
366 if ( $last ) {
367 $terms[] = $last;
368 }
369 return $terms;
370
371 }
372 private function a33($term) {
373
374 if ( $term === null ) {
375 // Phan is convinced $term may be null, not sure how
376 return [];
377 } else {
378 return $term;
379 }
380
381 }
382 private function a34($name) {
383
384 return $name;
385
386 }
387 private function a35($list) {
388
389 return $this->node( 'do', $list );
390
391 }
392 private function a36($list, $item) {
393
394 $list[] = $item;
395 return $list;
396
397 }
398 private function a37($item) {
399
400 return [ $item ];
401
402 }
403 private function a38($condition, $consequent, $else_part) {
404
405 $contents = [
406 $this->node( 'elif_condition', $condition ),
407 $this->node( 'elif_consequent', $consequent )
408 ];
409 if ( $else_part !== null ) {
410 $contents = $this->merge( $contents, $else_part );
411 }
412 return $contents;
413
414 }
415 private function a39($alternative) {
416
417 return [ $this->node( 'else', $alternative ) ];
418
419 }
420 private function a40($filename) {
421
422 return $this->node( 'duplicate_input', $filename );
423
424 }
425 private function a41($filename) {
426
427 return $this->node( 'read_and_write', $filename );
428
429 }
430 private function a42($filename) {
431
432 return $this->node( 'input', $filename );
433
434 }
435 private function a43($filename) {
436
437 return $this->node( 'duplicate_output', $filename );
438
439 }
440 private function a44($filename) {
441
442 return $this->node( 'append_output', $filename );
443
444 }
445 private function a45($filename) {
446
447 return $this->node( 'clobber', $filename );
448
449 }
450 private function a46($filename) {
451
452 return $this->node( 'output', $filename );
453
454 }
455 private function a47() {
456 return 'io_here_strip';
457 }
458 private function a48() {
459 return 'io_here';
460 }
461 private function a49($op, $end) {
462 // @phan-suppress-previous-line PhanPluginNeverReturnMethod
463 // TODO: this is quite complicated to implement, especially given the way
464 // the parser is structured.
465 throw new UnimplementedError( 'heredoc is not implemented' );
466 // For phan
467 // @phan-suppress-next-line PhanPluginUnreachableCode
468 return $this->node( 'io_here', '' );
469
470 }
471 private function a50($contents) {
472
473 return $this->node( 'single_quote', $contents );
474
475 }
476 private function a51($contents) {
477
478 return $this->node( 'double_quote', $contents );
479
480 }
481 private function a52($contents) {
482
483 return $this->node( 'bare_escape', $contents );
484
485 }
486 private function a53($parts) {
487
488 return $this->node( 'backquote', $parts );
489
490 }
491 private function a54($contents) {
492
493 return $contents;
494
495 }
496 private function a55($plain) {
497
498 return $this->node( 'unquoted_literal', $plain );
499
500 }
501 private function a56($pattern, $list) {
502
503 return $this->node( 'case_item', [
504 $pattern,
505 $this->node( 'case_consequent', $list )
506 ] );
507
508 }
509 private function a57($pattern) {
510
511 return $this->node( 'case_item', $pattern );
512
513 }
514 private function a58($pattern) {
515
516 return $this->node( 'case_item', [ $pattern ] );
517
518 }
519 private function a59($contents) {
520
521 return $this->node( 'dquoted_escape', $contents );
522
523 }
524 private function a60($contents) {
525
526 return $this->node( 'backquoted_escape', $contents );
527
528 }
529 private function a61($parts) {
530
531 return $this->node( 'double_backquote', $parts );
532
533 }
534 private function a62($contents) {
535
536 return $this->node( 'special_parameter', $contents );
537
538 }
539 private function a63($contents) {
540
541 return $this->node( 'positional_parameter', $contents );
542
543 }
544 private function a64($words) {
545
546 return $this->node( 'arithmetic_expansion', $words );
547
548 }
549 private function a65($command) {
550
551 return $this->node( 'command_expansion', $command );
552
553 }
554 private function a66($name) {
555
556 return $this->node( 'named_parameter', $name );
557
558 }
559 private function a67($first, $rest) {
560
561 $patterns = [ $first ];
562 foreach ( $rest as $pattern ) {
563 $patterns[] = $pattern[1];
564 }
565 return $this->node( 'case_pattern', $patterns );
566
567 }
568 private function a68($parameter, $operator, $word) {
569
570 $names = [
571 ':-' => 'use_default',
572 '-' => 'use_default_unset',
573 ':=' => 'assign_default',
574 '=' => 'assign_default_unset',
575 ':?' => 'indicate_error',
576 '?' => 'indicate_error_unset',
577 ':+' => 'use_alternative',
578 '+' => 'use_alternative_unset',
579 '%' => 'remove_smallest_suffix',
580 '%%' => 'remove_largest_suffix',
581 '#' => 'remove_smallest_prefix',
582 '##' => 'remove_largest_prefix'
583 ];
584 if ( !isset( $names[$operator] ) ) {
585 throw new InternalError( "Unable to find operator \"$operator\"" );
586 }
587 return $this->node( $names[$operator], [ $parameter, $word ?? '' ] );
588
589 }
590 private function a69($parameter) {
591
592 return $this->node( 'string_length', $parameter );
593
594 }
595 private function a70($parameter) {
596
597 return $this->node( 'braced_parameter_expansion', $parameter );
598
599 }
600 private function a71($parameter) {
601
602 return $this->node( 'positional_parameter', $parameter );
603
604 }
605
606 // generated
607 private function parseprogram($silence) {
608 $key = json_encode([0,$this->currPos]);
609 $cached = $this->cache[$key] ?? null;
610 if ($cached) {
611 $this->currPos = $cached->nextPos;
612
613 return $cached->result;
614 }
615
616 // start choice_1
617 $p2 = $this->currPos;
618 // start seq_1
619 $p3 = $this->currPos;
620 $r4 = $this->discardlinebreak($silence);
621 if ($r4===self::$FAILED) {
622 $r1 = self::$FAILED;
623 goto seq_1;
624 }
625 $r5 = $this->parsecomplete_commands($silence);
626 // commands <- $r5
627 if ($r5===self::$FAILED) {
628 $this->currPos = $p3;
629 $r1 = self::$FAILED;
630 goto seq_1;
631 }
632 $r6 = $this->discardlinebreak($silence);
633 if ($r6===self::$FAILED) {
634 $this->currPos = $p3;
635 $r1 = self::$FAILED;
636 goto seq_1;
637 }
638 $r1 = true;
639 seq_1:
640 if ($r1!==self::$FAILED) {
641 $this->savedPos = $p2;
642 $r1 = $this->a0($r5);
643 goto choice_1;
644 }
645 // free $p3
646 $p3 = $this->currPos;
647 $r1 = $this->discardlinebreak($silence);
648 if ($r1!==self::$FAILED) {
649 $this->savedPos = $p3;
650 $r1 = $this->a1();
651 }
652 choice_1:
653 $this->cache[$key] = new PEGParserCacheEntry(
654 $this->currPos,
655 $r1
656
657 );
658 return $r1;
659 }
660 private function discardlinebreak($silence) {
661 $key = json_encode([77,$this->currPos]);
662 $cached = $this->cache[$key] ?? null;
663 if ($cached) {
664 $this->currPos = $cached->nextPos;
665
666 return $cached->result;
667 }
668
669 $r1 = $this->discardnewline_list($silence);
670 if ($r1===self::$FAILED) {
671 $r1 = null;
672 }
673 $this->cache[$key] = new PEGParserCacheEntry(
674 $this->currPos,
675 $r1
676
677 );
678 return $r1;
679 }
680 private function parsecomplete_commands($silence) {
681 $key = json_encode([2,$this->currPos]);
682 $cached = $this->cache[$key] ?? null;
683 if ($cached) {
684 $this->currPos = $cached->nextPos;
685
686 return $cached->result;
687 }
688
689 $r1 = [];
690 for (;;) {
691 // start choice_1
692 $p3 = $this->currPos;
693 // start seq_1
694 $p4 = $this->currPos;
695 $r5 = $this->parsecomplete_command($silence, 0x0);
696 // c <- $r5
697 if ($r5===self::$FAILED) {
698 $r2 = self::$FAILED;
699 goto seq_1;
700 }
701 $r6 = $this->discardnewline_list($silence);
702 if ($r6===self::$FAILED) {
703 $this->currPos = $p4;
704 $r2 = self::$FAILED;
705 goto seq_1;
706 }
707 $r2 = true;
708 seq_1:
709 if ($r2!==self::$FAILED) {
710 $this->savedPos = $p3;
711 $r2 = $this->a2($r5);
712 goto choice_1;
713 }
714 // free $p4
715 $r2 = $this->parsecomplete_command($silence, 0x0);
716 choice_1:
717 if ($r2!==self::$FAILED) {
718 $r1[] = $r2;
719 } else {
720 break;
721 }
722 }
723 // free $r2
724 $this->cache[$key] = new PEGParserCacheEntry(
725 $this->currPos,
726 $r1
727
728 );
729 return $r1;
730 }
731 private function discardnewline_list($silence) {
732 $key = json_encode([75,$this->currPos]);
733 $cached = $this->cache[$key] ?? null;
734 if ($cached) {
735 $this->currPos = $cached->nextPos;
736
737 return $cached->result;
738 }
739
740 $r1 = self::$FAILED;
741 for (;;) {
742 $r2 = $this->discardNEWLINE($silence);
743 if ($r2!==self::$FAILED) {
744 $r1 = true;
745 } else {
746 break;
747 }
748 }
749 // free $r2
750 $this->cache[$key] = new PEGParserCacheEntry(
751 $this->currPos,
752 $r1
753
754 );
755 return $r1;
756 }
757 private function parsecomplete_command($silence, $boolParams) {
758 $key = json_encode([4,$this->currPos,$boolParams & 0x1]);
759 $cached = $this->cache[$key] ?? null;
760 if ($cached) {
761 $this->currPos = $cached->nextPos;
762
763 return $cached->result;
764 }
765
766 $p2 = $this->currPos;
767 // start seq_1
768 $p3 = $this->currPos;
769 $r4 = $this->discardOWS($silence);
770 if ($r4===self::$FAILED) {
771 $r1 = self::$FAILED;
772 goto seq_1;
773 }
774 // start choice_1
775 $p6 = $this->currPos;
776 // start seq_2
777 $p7 = $this->currPos;
778 $r8 = [];
779 for (;;) {
780 $p10 = $this->currPos;
781 // start seq_3
782 $p11 = $this->currPos;
783 $r12 = $this->parseand_or($silence, $boolParams);
784 // item <- $r12
785 if ($r12===self::$FAILED) {
786 $r9 = self::$FAILED;
787 goto seq_3;
788 }
789 $p14 = $this->currPos;
790 $r13 = $this->discardseparator_op($silence);
791 // separator <- $r13
792 if ($r13!==self::$FAILED) {
793 $r13 = substr($this->input, $p14, $this->currPos - $p14);
794 } else {
795 $r13 = self::$FAILED;
796 $this->currPos = $p11;
797 $r9 = self::$FAILED;
798 goto seq_3;
799 }
800 // free $p14
801 $r9 = true;
802 seq_3:
803 if ($r9!==self::$FAILED) {
804 $this->savedPos = $p10;
805 $r9 = $this->a3($r12, $r13);
806 $r8[] = $r9;
807 } else {
808 break;
809 }
810 // free $p11
811 }
812 if (count($r8) === 0) {
813 $r8 = self::$FAILED;
814 }
815 // nodes <- $r8
816 if ($r8===self::$FAILED) {
817 $r5 = self::$FAILED;
818 goto seq_2;
819 }
820 // free $r9
821 $r9 = $this->parseand_or($silence, $boolParams);
822 if ($r9===self::$FAILED) {
823 $r9 = null;
824 }
825 // last <- $r9
826 $r5 = true;
827 seq_2:
828 if ($r5!==self::$FAILED) {
829 $this->savedPos = $p6;
830 $r5 = $this->a4($r8, $r9);
831 goto choice_1;
832 }
833 // free $p7
834 $r5 = $this->parseand_or($silence, $boolParams);
835 choice_1:
836 // list <- $r5
837 if ($r5===self::$FAILED) {
838 $this->currPos = $p3;
839 $r1 = self::$FAILED;
840 goto seq_1;
841 }
842 $r1 = true;
843 seq_1:
844 if ($r1!==self::$FAILED) {
845 $this->savedPos = $p2;
846 $r1 = $this->a5($r5);
847 }
848 // free $p3
849 $this->cache[$key] = new PEGParserCacheEntry(
850 $this->currPos,
851 $r1
852
853 );
854 return $r1;
855 }
856 private function discardNEWLINE($silence) {
857 $key = json_encode([205,$this->currPos]);
858 $cached = $this->cache[$key] ?? null;
859 if ($cached) {
860 $this->currPos = $cached->nextPos;
861
862 return $cached->result;
863 }
864
865 // start seq_1
866 $p1 = $this->currPos;
867 if (($this->input[$this->currPos] ?? null) === "\x0a") {
868 $this->currPos++;
869 $r3 = "\x0a";
870 } else {
871 if (!$silence) {$this->fail(1);}
872 $r3 = self::$FAILED;
873 $r2 = self::$FAILED;
874 goto seq_1;
875 }
876 $r4 = $this->discardOWS($silence);
877 if ($r4===self::$FAILED) {
878 $this->currPos = $p1;
879 $r2 = self::$FAILED;
880 goto seq_1;
881 }
882 $r2 = true;
883 seq_1:
884 // free $r2,$p1
885 $this->cache[$key] = new PEGParserCacheEntry(
886 $this->currPos,
887 $r2
888
889 );
890 return $r2;
891 }
892 private function discardOWS($silence) {
893 $key = json_encode([153,$this->currPos]);
894 $cached = $this->cache[$key] ?? null;
895 if ($cached) {
896 $this->currPos = $cached->nextPos;
897
898 return $cached->result;
899 }
900
901 // start seq_1
902 $p1 = $this->currPos;
903 for (;;) {
904 if (strspn($this->input, " \x09\x0b\x0d\x0c", $this->currPos, 1) !== 0) {
905 $r4 = $this->input[$this->currPos++];
906 } else {
907 $r4 = self::$FAILED;
908 if (!$silence) {$this->fail(2);}
909 break;
910 }
911 }
912 // free $r4
913 $r3 = true;
914 if ($r3===self::$FAILED) {
915 $r2 = self::$FAILED;
916 goto seq_1;
917 }
918 // free $r3
919 // start seq_2
920 $p5 = $this->currPos;
921 if (($this->input[$this->currPos] ?? null) === "#") {
922 $this->currPos++;
923 $r4 = "#";
924 } else {
925 if (!$silence) {$this->fail(3);}
926 $r4 = self::$FAILED;
927 $r3 = self::$FAILED;
928 goto seq_2;
929 }
930 for (;;) {
931 $r7 = self::charAt($this->input, $this->currPos);
932 if ($r7 !== '' && !($r7 === "\x0a")) {
933 $this->currPos += strlen($r7);
934 } else {
935 $r7 = self::$FAILED;
936 if (!$silence) {$this->fail(4);}
937 break;
938 }
939 }
940 // free $r7
941 $r6 = true;
942 if ($r6===self::$FAILED) {
943 $this->currPos = $p5;
944 $r3 = self::$FAILED;
945 goto seq_2;
946 }
947 // free $r6
948 $r3 = true;
949 seq_2:
950 if ($r3===self::$FAILED) {
951 $r3 = null;
952 }
953 // free $p5
954 $r2 = true;
955 seq_1:
956 // free $r2,$p1
957 $this->cache[$key] = new PEGParserCacheEntry(
958 $this->currPos,
959 $r2
960
961 );
962 return $r2;
963 }
964 private function parseand_or($silence, $boolParams) {
965 $key = json_encode([6,$this->currPos,$boolParams & 0x1]);
966 $cached = $this->cache[$key] ?? null;
967 if ($cached) {
968 $this->currPos = $cached->nextPos;
969
970 return $cached->result;
971 }
972
973 $p2 = $this->currPos;
974 // start seq_1
975 $p3 = $this->currPos;
976 $r4 = $this->parsepipeline($silence, $boolParams);
977 // first <- $r4
978 if ($r4===self::$FAILED) {
979 $r1 = self::$FAILED;
980 goto seq_1;
981 }
982 $r5 = [];
983 for (;;) {
984 // start choice_1
985 $p7 = $this->currPos;
986 // start seq_2
987 $p8 = $this->currPos;
988 $r9 = $this->discardAND_IF($silence);
989 if ($r9===self::$FAILED) {
990 $r6 = self::$FAILED;
991 goto seq_2;
992 }
993 $r10 = $this->discardlinebreak($silence);
994 if ($r10===self::$FAILED) {
995 $this->currPos = $p8;
996 $r6 = self::$FAILED;
997 goto seq_2;
998 }
999 $r11 = $this->parsepipeline($silence, $boolParams);
1000 // pipeline <- $r11
1001 if ($r11===self::$FAILED) {
1002 $this->currPos = $p8;
1003 $r6 = self::$FAILED;
1004 goto seq_2;
1005 }
1006 $r6 = true;
1007 seq_2:
1008 if ($r6!==self::$FAILED) {
1009 $this->savedPos = $p7;
1010 $r6 = $this->a6($r4, $r11);
1011 goto choice_1;
1012 }
1013 // free $p8
1014 $p8 = $this->currPos;
1015 // start seq_3
1016 $p12 = $this->currPos;
1017 $r13 = $this->discardOR_IF($silence);
1018 if ($r13===self::$FAILED) {
1019 $r6 = self::$FAILED;
1020 goto seq_3;
1021 }
1022 $r14 = $this->discardlinebreak($silence);
1023 if ($r14===self::$FAILED) {
1024 $this->currPos = $p12;
1025 $r6 = self::$FAILED;
1026 goto seq_3;
1027 }
1028 $r15 = $this->parsepipeline($silence, $boolParams);
1029 // pipeline <- $r15
1030 if ($r15===self::$FAILED) {
1031 $this->currPos = $p12;
1032 $r6 = self::$FAILED;
1033 goto seq_3;
1034 }
1035 $r6 = true;
1036 seq_3:
1037 if ($r6!==self::$FAILED) {
1038 $this->savedPos = $p8;
1039 $r6 = $this->a7($r4, $r15);
1040 goto choice_1;
1041 }
1042 // free $p12
1043 $r6 = $this->parsepipeline($silence, $boolParams);
1044 choice_1:
1045 if ($r6!==self::$FAILED) {
1046 $r5[] = $r6;
1047 } else {
1048 break;
1049 }
1050 }
1051 // rest <- $r5
1052 // free $r6
1053 $r1 = true;
1054 seq_1:
1055 if ($r1!==self::$FAILED) {
1056 $this->savedPos = $p2;
1057 $r1 = $this->a8($r4, $r5);
1058 }
1059 // free $p3
1060 $this->cache[$key] = new PEGParserCacheEntry(
1061 $this->currPos,
1062 $r1
1063
1064 );
1065 return $r1;
1066 }
1067 private function discardseparator_op($silence) {
1068 $key = json_encode([79,$this->currPos]);
1069 $cached = $this->cache[$key] ?? null;
1070 if ($cached) {
1071 $this->currPos = $cached->nextPos;
1072
1073 return $cached->result;
1074 }
1075
1076 // start choice_1
1077 $r1 = $this->discardAND($silence);
1078 if ($r1!==self::$FAILED) {
1079 goto choice_1;
1080 }
1081 $r1 = $this->discardSEMI($silence);
1082 choice_1:
1083 $this->cache[$key] = new PEGParserCacheEntry(
1084 $this->currPos,
1085 $r1
1086
1087 );
1088 return $r1;
1089 }
1090 private function parsepipeline($silence, $boolParams) {
1091 $key = json_encode([8,$this->currPos,$boolParams & 0x1]);
1092 $cached = $this->cache[$key] ?? null;
1093 if ($cached) {
1094 $this->currPos = $cached->nextPos;
1095
1096 return $cached->result;
1097 }
1098
1099 $p2 = $this->currPos;
1100 // start seq_1
1101 $p3 = $this->currPos;
1102 $r4 = $this->parseBang($silence);
1103 if ($r4===self::$FAILED) {
1104 $r4 = null;
1105 }
1106 // bang <- $r4
1107 $r5 = $this->parsepipe_sequence($silence, $boolParams);
1108 // pipeline <- $r5
1109 if ($r5===self::$FAILED) {
1110 $this->currPos = $p3;
1111 $r1 = self::$FAILED;
1112 goto seq_1;
1113 }
1114 $r1 = true;
1115 seq_1:
1116 if ($r1!==self::$FAILED) {
1117 $this->savedPos = $p2;
1118 $r1 = $this->a9($r4, $r5);
1119 }
1120 // free $p3
1121 $this->cache[$key] = new PEGParserCacheEntry(
1122 $this->currPos,
1123 $r1
1124
1125 );
1126 return $r1;
1127 }
1128 private function discardAND_IF($silence) {
1129 $key = json_encode([85,$this->currPos]);
1130 $cached = $this->cache[$key] ?? null;
1131 if ($cached) {
1132 $this->currPos = $cached->nextPos;
1133
1134 return $cached->result;
1135 }
1136
1137 // start seq_1
1138 $p1 = $this->currPos;
1139 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "&&", $this->currPos, 2, false) === 0) {
1140 $r3 = "&&";
1141 $this->currPos += 2;
1142 } else {
1143 if (!$silence) {$this->fail(5);}
1144 $r3 = self::$FAILED;
1145 $r2 = self::$FAILED;
1146 goto seq_1;
1147 }
1148 $r4 = $this->discardOWS($silence);
1149 if ($r4===self::$FAILED) {
1150 $this->currPos = $p1;
1151 $r2 = self::$FAILED;
1152 goto seq_1;
1153 }
1154 $r2 = true;
1155 seq_1:
1156 // free $r2,$p1
1157 $this->cache[$key] = new PEGParserCacheEntry(
1158 $this->currPos,
1159 $r2
1160
1161 );
1162 return $r2;
1163 }
1164 private function discardOR_IF($silence) {
1165 $key = json_encode([87,$this->currPos]);
1166 $cached = $this->cache[$key] ?? null;
1167 if ($cached) {
1168 $this->currPos = $cached->nextPos;
1169
1170 return $cached->result;
1171 }
1172
1173 // start seq_1
1174 $p1 = $this->currPos;
1175 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "||", $this->currPos, 2, false) === 0) {
1176 $r3 = "||";
1177 $this->currPos += 2;
1178 } else {
1179 if (!$silence) {$this->fail(6);}
1180 $r3 = self::$FAILED;
1181 $r2 = self::$FAILED;
1182 goto seq_1;
1183 }
1184 $r4 = $this->discardOWS($silence);
1185 if ($r4===self::$FAILED) {
1186 $this->currPos = $p1;
1187 $r2 = self::$FAILED;
1188 goto seq_1;
1189 }
1190 $r2 = true;
1191 seq_1:
1192 // free $r2,$p1
1193 $this->cache[$key] = new PEGParserCacheEntry(
1194 $this->currPos,
1195 $r2
1196
1197 );
1198 return $r2;
1199 }
1200 private function discardAND($silence) {
1201 $key = json_encode([139,$this->currPos]);
1202 $cached = $this->cache[$key] ?? null;
1203 if ($cached) {
1204 $this->currPos = $cached->nextPos;
1205
1206 return $cached->result;
1207 }
1208
1209 // start seq_1
1210 $p1 = $this->currPos;
1211 $p3 = $this->currPos;
1212 $r4 = $this->discardAND_IF(true);
1213 if ($r4 === self::$FAILED) {
1214 $r4 = false;
1215 } else {
1216 $r4 = self::$FAILED;
1217 $this->currPos = $p3;
1218 $r2 = self::$FAILED;
1219 goto seq_1;
1220 }
1221 // free $p3
1222 if (($this->input[$this->currPos] ?? null) === "&") {
1223 $this->currPos++;
1224 $r5 = "&";
1225 } else {
1226 if (!$silence) {$this->fail(7);}
1227 $r5 = self::$FAILED;
1228 $this->currPos = $p1;
1229 $r2 = self::$FAILED;
1230 goto seq_1;
1231 }
1232 $r6 = $this->discardOWS($silence);
1233 if ($r6===self::$FAILED) {
1234 $this->currPos = $p1;
1235 $r2 = self::$FAILED;
1236 goto seq_1;
1237 }
1238 $r2 = true;
1239 seq_1:
1240 // free $r2,$p1
1241 $this->cache[$key] = new PEGParserCacheEntry(
1242 $this->currPos,
1243 $r2
1244
1245 );
1246 return $r2;
1247 }
1248 private function discardSEMI($silence) {
1249 $key = json_encode([141,$this->currPos]);
1250 $cached = $this->cache[$key] ?? null;
1251 if ($cached) {
1252 $this->currPos = $cached->nextPos;
1253
1254 return $cached->result;
1255 }
1256
1257 // start seq_1
1258 $p1 = $this->currPos;
1259 $p3 = $this->currPos;
1260 $r4 = $this->discardDSEMI(true);
1261 if ($r4 === self::$FAILED) {
1262 $r4 = false;
1263 } else {
1264 $r4 = self::$FAILED;
1265 $this->currPos = $p3;
1266 $r2 = self::$FAILED;
1267 goto seq_1;
1268 }
1269 // free $p3
1270 if (($this->input[$this->currPos] ?? null) === ";") {
1271 $this->currPos++;
1272 $r5 = ";";
1273 } else {
1274 if (!$silence) {$this->fail(8);}
1275 $r5 = self::$FAILED;
1276 $this->currPos = $p1;
1277 $r2 = self::$FAILED;
1278 goto seq_1;
1279 }
1280 $r6 = $this->discardOWS($silence);
1281 if ($r6===self::$FAILED) {
1282 $this->currPos = $p1;
1283 $r2 = self::$FAILED;
1284 goto seq_1;
1285 }
1286 $r2 = true;
1287 seq_1:
1288 // free $r2,$p1
1289 $this->cache[$key] = new PEGParserCacheEntry(
1290 $this->currPos,
1291 $r2
1292
1293 );
1294 return $r2;
1295 }
1296 private function parseBang($silence) {
1297 $key = json_encode([132,$this->currPos]);
1298 $cached = $this->cache[$key] ?? null;
1299 if ($cached) {
1300 $this->currPos = $cached->nextPos;
1301
1302 return $cached->result;
1303 }
1304
1305 // start seq_1
1306 $p1 = $this->currPos;
1307 if (($this->input[$this->currPos] ?? null) === "!") {
1308 $this->currPos++;
1309 $r3 = "!";
1310 } else {
1311 if (!$silence) {$this->fail(9);}
1312 $r3 = self::$FAILED;
1313 $r2 = self::$FAILED;
1314 goto seq_1;
1315 }
1316 $r4 = $this->parseDELIM($silence);
1317 if ($r4===self::$FAILED) {
1318 $this->currPos = $p1;
1319 $r2 = self::$FAILED;
1320 goto seq_1;
1321 }
1322 $r2 = [$r3,$r4];
1323 seq_1:
1324 // free $r2,$p1
1325 $this->cache[$key] = new PEGParserCacheEntry(
1326 $this->currPos,
1327 $r2
1328
1329 );
1330 return $r2;
1331 }
1332 private function parsepipe_sequence($silence, $boolParams) {
1333 $key = json_encode([10,$this->currPos,$boolParams & 0x1]);
1334 $cached = $this->cache[$key] ?? null;
1335 if ($cached) {
1336 $this->currPos = $cached->nextPos;
1337
1338 return $cached->result;
1339 }
1340
1341 $p2 = $this->currPos;
1342 // start seq_1
1343 $p3 = $this->currPos;
1344 $r4 = $this->parsecommand($silence, $boolParams);
1345 // first <- $r4
1346 if ($r4===self::$FAILED) {
1347 $r1 = self::$FAILED;
1348 goto seq_1;
1349 }
1350 $r5 = [];
1351 for (;;) {
1352 $p7 = $this->currPos;
1353 // start seq_2
1354 $p8 = $this->currPos;
1355 $r9 = $this->discardPIPE($silence);
1356 if ($r9===self::$FAILED) {
1357 $r6 = self::$FAILED;
1358 goto seq_2;
1359 }
1360 $r10 = $this->discardlinebreak($silence);
1361 if ($r10===self::$FAILED) {
1362 $this->currPos = $p8;
1363 $r6 = self::$FAILED;
1364 goto seq_2;
1365 }
1366 $r11 = $this->parsecommand($silence, $boolParams);
1367 // command <- $r11
1368 if ($r11===self::$FAILED) {
1369 $this->currPos = $p8;
1370 $r6 = self::$FAILED;
1371 goto seq_2;
1372 }
1373 $r6 = true;
1374 seq_2:
1375 if ($r6!==self::$FAILED) {
1376 $this->savedPos = $p7;
1377 $r6 = $this->a10($r4, $r11);
1378 $r5[] = $r6;
1379 } else {
1380 break;
1381 }
1382 // free $p8
1383 }
1384 // rest <- $r5
1385 // free $r6
1386 $r1 = true;
1387 seq_1:
1388 if ($r1!==self::$FAILED) {
1389 $this->savedPos = $p2;
1390 $r1 = $this->a11($r4, $r5);
1391 }
1392 // free $p3
1393 $this->cache[$key] = new PEGParserCacheEntry(
1394 $this->currPos,
1395 $r1
1396
1397 );
1398 return $r1;
1399 }
1400 private function discardDSEMI($silence) {
1401 $key = json_encode([89,$this->currPos]);
1402 $cached = $this->cache[$key] ?? null;
1403 if ($cached) {
1404 $this->currPos = $cached->nextPos;
1405
1406 return $cached->result;
1407 }
1408
1409 // start seq_1
1410 $p1 = $this->currPos;
1411 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, ";;", $this->currPos, 2, false) === 0) {
1412 $r3 = ";;";
1413 $this->currPos += 2;
1414 } else {
1415 if (!$silence) {$this->fail(10);}
1416 $r3 = self::$FAILED;
1417 $r2 = self::$FAILED;
1418 goto seq_1;
1419 }
1420 $r4 = $this->discardOWS($silence);
1421 if ($r4===self::$FAILED) {
1422 $this->currPos = $p1;
1423 $r2 = self::$FAILED;
1424 goto seq_1;
1425 }
1426 $r2 = true;
1427 seq_1:
1428 // free $r2,$p1
1429 $this->cache[$key] = new PEGParserCacheEntry(
1430 $this->currPos,
1431 $r2
1432
1433 );
1434 return $r2;
1435 }
1436 private function parseDELIM($silence) {
1437 $key = json_encode([154,$this->currPos]);
1438 $cached = $this->cache[$key] ?? null;
1439 if ($cached) {
1440 $this->currPos = $cached->nextPos;
1441
1442 return $cached->result;
1443 }
1444
1445 // start choice_1
1446 $r1 = [];
1447 for (;;) {
1448 if (strspn($this->input, " \x09\x0b\x0d\x0c", $this->currPos, 1) !== 0) {
1449 $r2 = $this->input[$this->currPos++];
1450 $r1[] = $r2;
1451 } else {
1452 $r2 = self::$FAILED;
1453 if (!$silence) {$this->fail(2);}
1454 break;
1455 }
1456 }
1457 if (count($r1) === 0) {
1458 $r1 = self::$FAILED;
1459 }
1460 if ($r1!==self::$FAILED) {
1461 goto choice_1;
1462 }
1463 // free $r2
1464 $p3 = $this->currPos;
1465 if ($this->currPos < $this->inputLength) {
1466 $r1 = self::consumeChar($this->input, $this->currPos);;
1467 } else {
1468 $r1 = self::$FAILED;
1469 }
1470 if ($r1 === self::$FAILED) {
1471 $r1 = false;
1472 goto choice_1;
1473 } else {
1474 $r1 = self::$FAILED;
1475 $this->currPos = $p3;
1476 }
1477 // free $p3
1478 $p3 = $this->currPos;
1479 if (($this->input[$this->currPos] ?? null) === "\x0a") {
1480 $this->currPos++;
1481 $r1 = "\x0a";
1482 $r1 = false;
1483 $this->currPos = $p3;
1484 } else {
1485 $r1 = self::$FAILED;
1486 }
1487 // free $p3
1488 choice_1:
1489 $this->cache[$key] = new PEGParserCacheEntry(
1490 $this->currPos,
1491 $r1
1492
1493 );
1494 return $r1;
1495 }
1496 private function parsecommand($silence, $boolParams) {
1497 $key = json_encode([12,$this->currPos,$boolParams & 0x1]);
1498 $cached = $this->cache[$key] ?? null;
1499 if ($cached) {
1500 $this->currPos = $cached->nextPos;
1501
1502 return $cached->result;
1503 }
1504
1505 // start choice_1
1506 $r1 = $this->parsefunction_definition($silence, $boolParams);
1507 if ($r1!==self::$FAILED) {
1508 goto choice_1;
1509 }
1510 $r1 = $this->parsesimple_command($silence, $boolParams);
1511 if ($r1!==self::$FAILED) {
1512 goto choice_1;
1513 }
1514 $p2 = $this->currPos;
1515 // start seq_1
1516 $p3 = $this->currPos;
1517 $r4 = $this->parsecompound_command($silence, $boolParams);
1518 // c <- $r4
1519 if ($r4===self::$FAILED) {
1520 $r1 = self::$FAILED;
1521 goto seq_1;
1522 }
1523 $r5 = $this->parseredirect_list($silence, $boolParams);
1524 if ($r5===self::$FAILED) {
1525 $r5 = null;
1526 }
1527 // r <- $r5
1528 $r1 = true;
1529 seq_1:
1530 if ($r1!==self::$FAILED) {
1531 $this->savedPos = $p2;
1532 $r1 = $this->a12($r4, $r5);
1533 }
1534 // free $p3
1535 choice_1:
1536 $this->cache[$key] = new PEGParserCacheEntry(
1537 $this->currPos,
1538 $r1
1539
1540 );
1541 return $r1;
1542 }
1543 private function discardPIPE($silence) {
1544 $key = json_encode([147,$this->currPos]);
1545 $cached = $this->cache[$key] ?? null;
1546 if ($cached) {
1547 $this->currPos = $cached->nextPos;
1548
1549 return $cached->result;
1550 }
1551
1552 // start seq_1
1553 $p1 = $this->currPos;
1554 $p3 = $this->currPos;
1555 $r4 = $this->discardOR_IF(true);
1556 if ($r4 === self::$FAILED) {
1557 $r4 = false;
1558 } else {
1559 $r4 = self::$FAILED;
1560 $this->currPos = $p3;
1561 $r2 = self::$FAILED;
1562 goto seq_1;
1563 }
1564 // free $p3
1565 if (($this->input[$this->currPos] ?? null) === "|") {
1566 $this->currPos++;
1567 $r5 = "|";
1568 } else {
1569 if (!$silence) {$this->fail(11);}
1570 $r5 = self::$FAILED;
1571 $this->currPos = $p1;
1572 $r2 = self::$FAILED;
1573 goto seq_1;
1574 }
1575 $r6 = $this->discardOWS($silence);
1576 if ($r6===self::$FAILED) {
1577 $this->currPos = $p1;
1578 $r2 = self::$FAILED;
1579 goto seq_1;
1580 }
1581 $r2 = true;
1582 seq_1:
1583 // free $r2,$p1
1584 $this->cache[$key] = new PEGParserCacheEntry(
1585 $this->currPos,
1586 $r2
1587
1588 );
1589 return $r2;
1590 }
1591 private function parsefunction_definition($silence, $boolParams) {
1592 $key = json_encode([48,$this->currPos,$boolParams & 0x1]);
1593 $cached = $this->cache[$key] ?? null;
1594 if ($cached) {
1595 $this->currPos = $cached->nextPos;
1596
1597 return $cached->result;
1598 }
1599
1600 $p2 = $this->currPos;
1601 // start seq_1
1602 $p3 = $this->currPos;
1603 $r4 = $this->parseNAME($silence);
1604 // fname <- $r4
1605 if ($r4===self::$FAILED) {
1606 $r1 = self::$FAILED;
1607 goto seq_1;
1608 }
1609 $r5 = $this->discardLPAREN($silence);
1610 if ($r5===self::$FAILED) {
1611 $this->currPos = $p3;
1612 $r1 = self::$FAILED;
1613 goto seq_1;
1614 }
1615 $r6 = $this->discardRPAREN($silence);
1616 if ($r6===self::$FAILED) {
1617 $this->currPos = $p3;
1618 $r1 = self::$FAILED;
1619 goto seq_1;
1620 }
1621 $r7 = $this->discardlinebreak($silence);
1622 if ($r7===self::$FAILED) {
1623 $this->currPos = $p3;
1624 $r1 = self::$FAILED;
1625 goto seq_1;
1626 }
1627 $r8 = $this->parsefunction_body($silence, $boolParams);
1628 // body <- $r8
1629 if ($r8===self::$FAILED) {
1630 $this->currPos = $p3;
1631 $r1 = self::$FAILED;
1632 goto seq_1;
1633 }
1634 $r1 = true;
1635 seq_1:
1636 if ($r1!==self::$FAILED) {
1637 $this->savedPos = $p2;
1638 $r1 = $this->a13($r4, $r8);
1639 }
1640 // free $p3
1641 $this->cache[$key] = new PEGParserCacheEntry(
1642 $this->currPos,
1643 $r1
1644
1645 );
1646 return $r1;
1647 }
1648 private function parsesimple_command($silence, $boolParams) {
1649 $key = json_encode([56,$this->currPos,$boolParams & 0x1]);
1650 $cached = $this->cache[$key] ?? null;
1651 if ($cached) {
1652 $this->currPos = $cached->nextPos;
1653
1654 return $cached->result;
1655 }
1656
1657 // start choice_1
1658 $p2 = $this->currPos;
1659 // start seq_1
1660 $p3 = $this->currPos;
1661 $r4 = $this->parsecmd_prefix($silence, $boolParams);
1662 // prefix <- $r4
1663 if ($r4===self::$FAILED) {
1664 $r1 = self::$FAILED;
1665 goto seq_1;
1666 }
1667 $r5 = $this->parseWORD($silence, $boolParams);
1668 // word <- $r5
1669 if ($r5===self::$FAILED) {
1670 $this->currPos = $p3;
1671 $r1 = self::$FAILED;
1672 goto seq_1;
1673 }
1674 $r6 = $this->parsecmd_suffix($silence, $boolParams);
1675 if ($r6===self::$FAILED) {
1676 $r6 = null;
1677 }
1678 // suffix <- $r6
1679 $r1 = true;
1680 seq_1:
1681 if ($r1!==self::$FAILED) {
1682 $this->savedPos = $p2;
1683 $r1 = $this->a14($r4, $r5, $r6);
1684 goto choice_1;
1685 }
1686 // free $p3
1687 $p3 = $this->currPos;
1688 $r7 = $this->parsecmd_prefix($silence, $boolParams);
1689 // prefix <- $r7
1690 $r1 = $r7;
1691 if ($r1!==self::$FAILED) {
1692 $this->savedPos = $p3;
1693 $r1 = $this->a15($r7);
1694 goto choice_1;
1695 }
1696 $p8 = $this->currPos;
1697 // start seq_2
1698 $p9 = $this->currPos;
1699 $r10 = $this->parsecmd_name($silence, $boolParams);
1700 // name <- $r10
1701 if ($r10===self::$FAILED) {
1702 $r1 = self::$FAILED;
1703 goto seq_2;
1704 }
1705 $r11 = $this->parsecmd_suffix($silence, $boolParams);
1706 if ($r11===self::$FAILED) {
1707 $r11 = null;
1708 }
1709 // suffix <- $r11
1710 $r1 = true;
1711 seq_2:
1712 if ($r1!==self::$FAILED) {
1713 $this->savedPos = $p8;
1714 $r1 = $this->a16($r10, $r11);
1715 }
1716 // free $p9
1717 choice_1:
1718 $this->cache[$key] = new PEGParserCacheEntry(
1719 $this->currPos,
1720 $r1
1721
1722 );
1723 return $r1;
1724 }
1725 private function parsecompound_command($silence, $boolParams) {
1726 $key = json_encode([14,$this->currPos,$boolParams & 0x1]);
1727 $cached = $this->cache[$key] ?? null;
1728 if ($cached) {
1729 $this->currPos = $cached->nextPos;
1730
1731 return $cached->result;
1732 }
1733
1734 // start choice_1
1735 $r1 = $this->parsebrace_group($silence, $boolParams);
1736 if ($r1!==self::$FAILED) {
1737 goto choice_1;
1738 }
1739 $r1 = $this->parsesubshell($silence, $boolParams);
1740 if ($r1!==self::$FAILED) {
1741 goto choice_1;
1742 }
1743 $r1 = $this->parsefor_clause($silence, $boolParams);
1744 if ($r1!==self::$FAILED) {
1745 goto choice_1;
1746 }
1747 $r1 = $this->parsecase_clause($silence, $boolParams);
1748 if ($r1!==self::$FAILED) {
1749 goto choice_1;
1750 }
1751 $r1 = $this->parseif_clause($silence, $boolParams);
1752 if ($r1!==self::$FAILED) {
1753 goto choice_1;
1754 }
1755 $r1 = $this->parsewhile_clause($silence, $boolParams);
1756 if ($r1!==self::$FAILED) {
1757 goto choice_1;
1758 }
1759 $r1 = $this->parseuntil_clause($silence, $boolParams);
1760 choice_1:
1761 $this->cache[$key] = new PEGParserCacheEntry(
1762 $this->currPos,
1763 $r1
1764
1765 );
1766 return $r1;
1767 }
1768 private function parseredirect_list($silence, $boolParams) {
1769 $key = json_encode([64,$this->currPos,$boolParams & 0x1]);
1770 $cached = $this->cache[$key] ?? null;
1771 if ($cached) {
1772 $this->currPos = $cached->nextPos;
1773
1774 return $cached->result;
1775 }
1776
1777 $r1 = [];
1778 for (;;) {
1779 $r2 = $this->parseio_redirect($silence, $boolParams);
1780 if ($r2!==self::$FAILED) {
1781 $r1[] = $r2;
1782 } else {
1783 break;
1784 }
1785 }
1786 if (count($r1) === 0) {
1787 $r1 = self::$FAILED;
1788 }
1789 // free $r2
1790 $this->cache[$key] = new PEGParserCacheEntry(
1791 $this->currPos,
1792 $r1
1793
1794 );
1795 return $r1;
1796 }
1797 private function parseNAME($silence) {
1798 $key = json_encode([202,$this->currPos]);
1799 $cached = $this->cache[$key] ?? null;
1800 if ($cached) {
1801 $this->currPos = $cached->nextPos;
1802
1803 return $cached->result;
1804 }
1805
1806 $p1 = $this->currPos;
1807 // start seq_1
1808 $p3 = $this->currPos;
1809 $r4 = $this->input[$this->currPos] ?? '';
1810 if (preg_match("/^[_a-zA-Z]/", $r4)) {
1811 $this->currPos++;
1812 } else {
1813 $r4 = self::$FAILED;
1814 if (!$silence) {$this->fail(12);}
1815 $r2 = self::$FAILED;
1816 goto seq_1;
1817 }
1818 for (;;) {
1819 $r6 = $this->input[$this->currPos] ?? '';
1820 if (preg_match("/^[_a-zA-Z0-9]/", $r6)) {
1821 $this->currPos++;
1822 } else {
1823 $r6 = self::$FAILED;
1824 if (!$silence) {$this->fail(13);}
1825 break;
1826 }
1827 }
1828 // free $r6
1829 $r5 = true;
1830 if ($r5===self::$FAILED) {
1831 $this->currPos = $p3;
1832 $r2 = self::$FAILED;
1833 goto seq_1;
1834 }
1835 // free $r5
1836 $r2 = true;
1837 seq_1:
1838 if ($r2!==self::$FAILED) {
1839 $r2 = substr($this->input, $p1, $this->currPos - $p1);
1840 } else {
1841 $r2 = self::$FAILED;
1842 }
1843 // free $p3
1844 // free $p1
1845 $this->cache[$key] = new PEGParserCacheEntry(
1846 $this->currPos,
1847 $r2
1848
1849 );
1850 return $r2;
1851 }
1852 private function discardLPAREN($silence) {
1853 $key = json_encode([149,$this->currPos]);
1854 $cached = $this->cache[$key] ?? null;
1855 if ($cached) {
1856 $this->currPos = $cached->nextPos;
1857
1858 return $cached->result;
1859 }
1860
1861 // start seq_1
1862 $p1 = $this->currPos;
1863 if (($this->input[$this->currPos] ?? null) === "(") {
1864 $this->currPos++;
1865 $r3 = "(";
1866 } else {
1867 if (!$silence) {$this->fail(14);}
1868 $r3 = self::$FAILED;
1869 $r2 = self::$FAILED;
1870 goto seq_1;
1871 }
1872 $r4 = $this->discardOWS($silence);
1873 if ($r4===self::$FAILED) {
1874 $this->currPos = $p1;
1875 $r2 = self::$FAILED;
1876 goto seq_1;
1877 }
1878 $r2 = true;
1879 seq_1:
1880 // free $r2,$p1
1881 $this->cache[$key] = new PEGParserCacheEntry(
1882 $this->currPos,
1883 $r2
1884
1885 );
1886 return $r2;
1887 }
1888 private function discardRPAREN($silence) {
1889 $key = json_encode([151,$this->currPos]);
1890 $cached = $this->cache[$key] ?? null;
1891 if ($cached) {
1892 $this->currPos = $cached->nextPos;
1893
1894 return $cached->result;
1895 }
1896
1897 // start seq_1
1898 $p1 = $this->currPos;
1899 if (($this->input[$this->currPos] ?? null) === ")") {
1900 $this->currPos++;
1901 $r3 = ")";
1902 } else {
1903 if (!$silence) {$this->fail(15);}
1904 $r3 = self::$FAILED;
1905 $r2 = self::$FAILED;
1906 goto seq_1;
1907 }
1908 $r4 = $this->discardOWS($silence);
1909 if ($r4===self::$FAILED) {
1910 $this->currPos = $p1;
1911 $r2 = self::$FAILED;
1912 goto seq_1;
1913 }
1914 $r2 = true;
1915 seq_1:
1916 // free $r2,$p1
1917 $this->cache[$key] = new PEGParserCacheEntry(
1918 $this->currPos,
1919 $r2
1920
1921 );
1922 return $r2;
1923 }
1924 private function parsefunction_body($silence, $boolParams) {
1925 $key = json_encode([50,$this->currPos,$boolParams & 0x1]);
1926 $cached = $this->cache[$key] ?? null;
1927 if ($cached) {
1928 $this->currPos = $cached->nextPos;
1929
1930 return $cached->result;
1931 }
1932
1933 $p2 = $this->currPos;
1934 // start seq_1
1935 $p3 = $this->currPos;
1936 $r4 = $this->parsecompound_command($silence, $boolParams);
1937 // c <- $r4
1938 if ($r4===self::$FAILED) {
1939 $r1 = self::$FAILED;
1940 goto seq_1;
1941 }
1942 $r5 = $this->parseredirect_list($silence, $boolParams);
1943 if ($r5===self::$FAILED) {
1944 $r5 = null;
1945 }
1946 // r <- $r5
1947 $r1 = true;
1948 seq_1:
1949 if ($r1!==self::$FAILED) {
1950 $this->savedPos = $p2;
1951 $r1 = $this->a17($r4, $r5);
1952 }
1953 // free $p3
1954 $this->cache[$key] = new PEGParserCacheEntry(
1955 $this->currPos,
1956 $r1
1957
1958 );
1959 return $r1;
1960 }
1961 private function parsecmd_prefix($silence, $boolParams) {
1962 $key = json_encode([60,$this->currPos,$boolParams & 0x1]);
1963 $cached = $this->cache[$key] ?? null;
1964 if ($cached) {
1965 $this->currPos = $cached->nextPos;
1966
1967 return $cached->result;
1968 }
1969
1970 $p2 = $this->currPos;
1971 $r3 = [];
1972 for (;;) {
1973 // start choice_1
1974 $r4 = $this->parseio_redirect($silence, $boolParams);
1975 if ($r4!==self::$FAILED) {
1976 goto choice_1;
1977 }
1978 $r4 = $this->parseASSIGNMENT_WORD($silence, $boolParams);
1979 choice_1:
1980 if ($r4!==self::$FAILED) {
1981 $r3[] = $r4;
1982 } else {
1983 break;
1984 }
1985 }
1986 if (count($r3) === 0) {
1987 $r3 = self::$FAILED;
1988 }
1989 // contents <- $r3
1990 // free $r4
1991 $r1 = $r3;
1992 if ($r1!==self::$FAILED) {
1993 $this->savedPos = $p2;
1994 $r1 = $this->a18($r3);
1995 }
1996 $this->cache[$key] = new PEGParserCacheEntry(
1997 $this->currPos,
1998 $r1
1999
2000 );
2001 return $r1;
2002 }
2003 private function parseWORD($silence, $boolParams) {
2004 $key = json_encode([156,$this->currPos,$boolParams & 0x1]);
2005 $cached = $this->cache[$key] ?? null;
2006 if ($cached) {
2007 $this->currPos = $cached->nextPos;
2008
2009 return $cached->result;
2010 }
2011
2012 $p2 = $this->currPos;
2013 // start seq_1
2014 $p3 = $this->currPos;
2015 $r4 = [];
2016 for (;;) {
2017 $r5 = $this->parseword_part($silence, $boolParams);
2018 if ($r5!==self::$FAILED) {
2019 $r4[] = $r5;
2020 } else {
2021 break;
2022 }
2023 }
2024 if (count($r4) === 0) {
2025 $r4 = self::$FAILED;
2026 }
2027 // parts <- $r4
2028 if ($r4===self::$FAILED) {
2029 $r1 = self::$FAILED;
2030 goto seq_1;
2031 }
2032 // free $r5
2033 $r5 = $this->discardOWS($silence);
2034 if ($r5===self::$FAILED) {
2035 $this->currPos = $p3;
2036 $r1 = self::$FAILED;
2037 goto seq_1;
2038 }
2039 $r1 = true;
2040 seq_1:
2041 if ($r1!==self::$FAILED) {
2042 $this->savedPos = $p2;
2043 $r1 = $this->a19($r4);
2044 }
2045 // free $p3
2046 $this->cache[$key] = new PEGParserCacheEntry(
2047 $this->currPos,
2048 $r1
2049
2050 );
2051 return $r1;
2052 }
2053 private function parsecmd_suffix($silence, $boolParams) {
2054 $key = json_encode([62,$this->currPos,$boolParams & 0x1]);
2055 $cached = $this->cache[$key] ?? null;
2056 if ($cached) {
2057 $this->currPos = $cached->nextPos;
2058
2059 return $cached->result;
2060 }
2061
2062 $r1 = [];
2063 for (;;) {
2064 // start choice_1
2065 $r2 = $this->parseio_redirect($silence, $boolParams);
2066 if ($r2!==self::$FAILED) {
2067 goto choice_1;
2068 }
2069 $r2 = $this->parseWORD($silence, $boolParams);
2070 choice_1:
2071 if ($r2!==self::$FAILED) {
2072 $r1[] = $r2;
2073 } else {
2074 break;
2075 }
2076 }
2077 if (count($r1) === 0) {
2078 $r1 = self::$FAILED;
2079 }
2080 // free $r2
2081 $this->cache[$key] = new PEGParserCacheEntry(
2082 $this->currPos,
2083 $r1
2084
2085 );
2086 return $r1;
2087 }
2088 private function parsecmd_name($silence, $boolParams) {
2089 $key = json_encode([58,$this->currPos,$boolParams & 0x1]);
2090 $cached = $this->cache[$key] ?? null;
2091 if ($cached) {
2092 $this->currPos = $cached->nextPos;
2093
2094 return $cached->result;
2095 }
2096
2097 $p2 = $this->currPos;
2098 // start seq_1
2099 $p3 = $this->currPos;
2100 $p4 = $this->currPos;
2101 $r5 = $this->discardreserved(true);
2102 if ($r5 === self::$FAILED) {
2103 $r5 = false;
2104 } else {
2105 $r5 = self::$FAILED;
2106 $this->currPos = $p4;
2107 $r1 = self::$FAILED;
2108 goto seq_1;
2109 }
2110 // free $p4
2111 $r6 = $this->parseWORD($silence, $boolParams);
2112 // word <- $r6
2113 if ($r6===self::$FAILED) {
2114 $this->currPos = $p3;
2115 $r1 = self::$FAILED;
2116 goto seq_1;
2117 }
2118 $r1 = true;
2119 seq_1:
2120 if ($r1!==self::$FAILED) {
2121 $this->savedPos = $p2;
2122 $r1 = $this->a20($r6);
2123 }
2124 // free $p3
2125 $this->cache[$key] = new PEGParserCacheEntry(
2126 $this->currPos,
2127 $r1
2128
2129 );
2130 return $r1;
2131 }
2132 private function parsebrace_group($silence, $boolParams) {
2133 $key = json_encode([52,$this->currPos,$boolParams & 0x1]);
2134 $cached = $this->cache[$key] ?? null;
2135 if ($cached) {
2136 $this->currPos = $cached->nextPos;
2137
2138 return $cached->result;
2139 }
2140
2141 $p2 = $this->currPos;
2142 // start seq_1
2143 $p3 = $this->currPos;
2144 $r4 = $this->discardLbrace($silence);
2145 if ($r4===self::$FAILED) {
2146 $r1 = self::$FAILED;
2147 goto seq_1;
2148 }
2149 $r5 = $this->parsecompound_list($silence, $boolParams);
2150 // list <- $r5
2151 if ($r5===self::$FAILED) {
2152 $this->currPos = $p3;
2153 $r1 = self::$FAILED;
2154 goto seq_1;
2155 }
2156 $r6 = $this->discardRbrace($silence);
2157 if ($r6===self::$FAILED) {
2158 $this->currPos = $p3;
2159 $r1 = self::$FAILED;
2160 goto seq_1;
2161 }
2162 $r1 = true;
2163 seq_1:
2164 if ($r1!==self::$FAILED) {
2165 $this->savedPos = $p2;
2166 $r1 = $this->a21($r5);
2167 }
2168 // free $p3
2169 $this->cache[$key] = new PEGParserCacheEntry(
2170 $this->currPos,
2171 $r1
2172
2173 );
2174 return $r1;
2175 }
2176 private function parsesubshell($silence, $boolParams) {
2177 $key = json_encode([16,$this->currPos,$boolParams & 0x1]);
2178 $cached = $this->cache[$key] ?? null;
2179 if ($cached) {
2180 $this->currPos = $cached->nextPos;
2181
2182 return $cached->result;
2183 }
2184
2185 $p2 = $this->currPos;
2186 // start seq_1
2187 $p3 = $this->currPos;
2188 $r4 = $this->discardLPAREN($silence);
2189 if ($r4===self::$FAILED) {
2190 $r1 = self::$FAILED;
2191 goto seq_1;
2192 }
2193 $r5 = $this->parsecompound_list($silence, $boolParams);
2194 // list <- $r5
2195 if ($r5===self::$FAILED) {
2196 $this->currPos = $p3;
2197 $r1 = self::$FAILED;
2198 goto seq_1;
2199 }
2200 $r6 = $this->discardRPAREN($silence);
2201 if ($r6===self::$FAILED) {
2202 $this->currPos = $p3;
2203 $r1 = self::$FAILED;
2204 goto seq_1;
2205 }
2206 $r1 = true;
2207 seq_1:
2208 if ($r1!==self::$FAILED) {
2209 $this->savedPos = $p2;
2210 $r1 = $this->a22($r5);
2211 }
2212 // free $p3
2213 $this->cache[$key] = new PEGParserCacheEntry(
2214 $this->currPos,
2215 $r1
2216
2217 );
2218 return $r1;
2219 }
2220 private function parsefor_clause($silence, $boolParams) {
2221 $key = json_encode([20,$this->currPos,$boolParams & 0x1]);
2222 $cached = $this->cache[$key] ?? null;
2223 if ($cached) {
2224 $this->currPos = $cached->nextPos;
2225
2226 return $cached->result;
2227 }
2228
2229 // start choice_1
2230 $p2 = $this->currPos;
2231 // start seq_1
2232 $p3 = $this->currPos;
2233 $r4 = $this->discardFor($silence);
2234 if ($r4===self::$FAILED) {
2235 $r1 = self::$FAILED;
2236 goto seq_1;
2237 }
2238 $r5 = $this->parsefor_name($silence);
2239 // name <- $r5
2240 if ($r5===self::$FAILED) {
2241 $this->currPos = $p3;
2242 $r1 = self::$FAILED;
2243 goto seq_1;
2244 }
2245 $r6 = $this->discardlinebreak($silence);
2246 if ($r6===self::$FAILED) {
2247 $this->currPos = $p3;
2248 $r1 = self::$FAILED;
2249 goto seq_1;
2250 }
2251 $r7 = $this->discardfor_case_in($silence);
2252 if ($r7===self::$FAILED) {
2253 $this->currPos = $p3;
2254 $r1 = self::$FAILED;
2255 goto seq_1;
2256 }
2257 $r8 = $this->parsewordlist($silence, $boolParams);
2258 if ($r8===self::$FAILED) {
2259 $r8 = null;
2260 }
2261 // wordlist <- $r8
2262 $r9 = $this->discardsequential_sep($silence);
2263 if ($r9===self::$FAILED) {
2264 $this->currPos = $p3;
2265 $r1 = self::$FAILED;
2266 goto seq_1;
2267 }
2268 $r10 = $this->parsedo_group($silence, $boolParams);
2269 // do_group <- $r10
2270 if ($r10===self::$FAILED) {
2271 $this->currPos = $p3;
2272 $r1 = self::$FAILED;
2273 goto seq_1;
2274 }
2275 $r1 = true;
2276 seq_1:
2277 if ($r1!==self::$FAILED) {
2278 $this->savedPos = $p2;
2279 $r1 = $this->a23($r5, $r8, $r10);
2280 goto choice_1;
2281 }
2282 // free $p3
2283 $p3 = $this->currPos;
2284 // start seq_2
2285 $p11 = $this->currPos;
2286 $r12 = $this->discardFor($silence);
2287 if ($r12===self::$FAILED) {
2288 $r1 = self::$FAILED;
2289 goto seq_2;
2290 }
2291 $r13 = $this->parsefor_name($silence);
2292 // name <- $r13
2293 if ($r13===self::$FAILED) {
2294 $this->currPos = $p11;
2295 $r1 = self::$FAILED;
2296 goto seq_2;
2297 }
2298 $r14 = $this->discardsequential_sep($silence);
2299 if ($r14===self::$FAILED) {
2300 $r14 = null;
2301 }
2302 $r15 = $this->parsedo_group($silence, $boolParams);
2303 // do_group <- $r15
2304 if ($r15===self::$FAILED) {
2305 $this->currPos = $p11;
2306 $r1 = self::$FAILED;
2307 goto seq_2;
2308 }
2309 $r1 = true;
2310 seq_2:
2311 if ($r1!==self::$FAILED) {
2312 $this->savedPos = $p3;
2313 $r1 = $this->a24($r13, $r15);
2314 }
2315 // free $p11
2316 choice_1:
2317 $this->cache[$key] = new PEGParserCacheEntry(
2318 $this->currPos,
2319 $r1
2320
2321 );
2322 return $r1;
2323 }
2324 private function parsecase_clause($silence, $boolParams) {
2325 $key = json_encode([28,$this->currPos,$boolParams & 0x1]);
2326 $cached = $this->cache[$key] ?? null;
2327 if ($cached) {
2328 $this->currPos = $cached->nextPos;
2329
2330 return $cached->result;
2331 }
2332
2333 $p2 = $this->currPos;
2334 // start seq_1
2335 $p3 = $this->currPos;
2336 $r4 = $this->discardCase($silence);
2337 if ($r4===self::$FAILED) {
2338 $r1 = self::$FAILED;
2339 goto seq_1;
2340 }
2341 $r5 = $this->parseWORD($silence, $boolParams);
2342 // word <- $r5
2343 if ($r5===self::$FAILED) {
2344 $this->currPos = $p3;
2345 $r1 = self::$FAILED;
2346 goto seq_1;
2347 }
2348 $r6 = $this->discardlinebreak($silence);
2349 if ($r6===self::$FAILED) {
2350 $this->currPos = $p3;
2351 $r1 = self::$FAILED;
2352 goto seq_1;
2353 }
2354 $r7 = $this->discardfor_case_in($silence);
2355 if ($r7===self::$FAILED) {
2356 $this->currPos = $p3;
2357 $r1 = self::$FAILED;
2358 goto seq_1;
2359 }
2360 $r8 = $this->discardlinebreak($silence);
2361 if ($r8===self::$FAILED) {
2362 $this->currPos = $p3;
2363 $r1 = self::$FAILED;
2364 goto seq_1;
2365 }
2366 // start choice_1
2367 // start seq_2
2368 $p10 = $this->currPos;
2369 $r11 = $this->parsecase_list($silence, $boolParams);
2370 if ($r11===self::$FAILED) {
2371 $r9 = self::$FAILED;
2372 goto seq_2;
2373 }
2374 $p12 = $this->currPos;
2375 $r13 = $this->discardEsac($silence);
2376 if ($r13!==self::$FAILED) {
2377 $r13 = substr($this->input, $p12, $this->currPos - $p12);
2378 } else {
2379 $r13 = self::$FAILED;
2380 $this->currPos = $p10;
2381 $r9 = self::$FAILED;
2382 goto seq_2;
2383 }
2384 // free $p12
2385 $r9 = [$r11,$r13];
2386 seq_2:
2387 if ($r9!==self::$FAILED) {
2388 goto choice_1;
2389 }
2390 // free $p10
2391 // start seq_3
2392 $p10 = $this->currPos;
2393 $r14 = $this->parsecase_list_ns($silence, $boolParams);
2394 if ($r14===self::$FAILED) {
2395 $r9 = self::$FAILED;
2396 goto seq_3;
2397 }
2398 $p12 = $this->currPos;
2399 $r15 = $this->discardEsac($silence);
2400 if ($r15!==self::$FAILED) {
2401 $r15 = substr($this->input, $p12, $this->currPos - $p12);
2402 } else {
2403 $r15 = self::$FAILED;
2404 $this->currPos = $p10;
2405 $r9 = self::$FAILED;
2406 goto seq_3;
2407 }
2408 // free $p12
2409 $r9 = [$r14,$r15];
2410 seq_3:
2411 if ($r9!==self::$FAILED) {
2412 goto choice_1;
2413 }
2414 // free $p10
2415 $p10 = $this->currPos;
2416 $r9 = $this->discardEsac($silence);
2417 if ($r9!==self::$FAILED) {
2418 $r9 = substr($this->input, $p10, $this->currPos - $p10);
2419 } else {
2420 $r9 = self::$FAILED;
2421 }
2422 // free $p10
2423 choice_1:
2424 // list_esac <- $r9
2425 if ($r9===self::$FAILED) {
2426 $this->currPos = $p3;
2427 $r1 = self::$FAILED;
2428 goto seq_1;
2429 }
2430 $r1 = true;
2431 seq_1:
2432 if ($r1!==self::$FAILED) {
2433 $this->savedPos = $p2;
2434 $r1 = $this->a25($r5, $r9);
2435 }
2436 // free $p3
2437 $this->cache[$key] = new PEGParserCacheEntry(
2438 $this->currPos,
2439 $r1
2440
2441 );
2442 return $r1;
2443 }
2444 private function parseif_clause($silence, $boolParams) {
2445 $key = json_encode([40,$this->currPos,$boolParams & 0x1]);
2446 $cached = $this->cache[$key] ?? null;
2447 if ($cached) {
2448 $this->currPos = $cached->nextPos;
2449
2450 return $cached->result;
2451 }
2452
2453 $p2 = $this->currPos;
2454 // start seq_1
2455 $p3 = $this->currPos;
2456 $r4 = $this->discardIf($silence);
2457 if ($r4===self::$FAILED) {
2458 $r1 = self::$FAILED;
2459 goto seq_1;
2460 }
2461 $r5 = $this->parsecompound_list($silence, $boolParams);
2462 // condition <- $r5
2463 if ($r5===self::$FAILED) {
2464 $this->currPos = $p3;
2465 $r1 = self::$FAILED;
2466 goto seq_1;
2467 }
2468 $r6 = $this->discardThen($silence);
2469 if ($r6===self::$FAILED) {
2470 $this->currPos = $p3;
2471 $r1 = self::$FAILED;
2472 goto seq_1;
2473 }
2474 $r7 = $this->parsecompound_list($silence, $boolParams);
2475 // consequent <- $r7
2476 if ($r7===self::$FAILED) {
2477 $this->currPos = $p3;
2478 $r1 = self::$FAILED;
2479 goto seq_1;
2480 }
2481 $r8 = $this->parseelse_part($silence, $boolParams);
2482 if ($r8===self::$FAILED) {
2483 $r8 = null;
2484 }
2485 // else_part <- $r8
2486 $r9 = $this->discardFi($silence);
2487 if ($r9===self::$FAILED) {
2488 $this->currPos = $p3;
2489 $r1 = self::$FAILED;
2490 goto seq_1;
2491 }
2492 $r1 = true;
2493 seq_1:
2494 if ($r1!==self::$FAILED) {
2495 $this->savedPos = $p2;
2496 $r1 = $this->a26($r5, $r7, $r8);
2497 }
2498 // free $p3
2499 $this->cache[$key] = new PEGParserCacheEntry(
2500 $this->currPos,
2501 $r1
2502
2503 );
2504 return $r1;
2505 }
2506 private function parsewhile_clause($silence, $boolParams) {
2507 $key = json_encode([44,$this->currPos,$boolParams & 0x1]);
2508 $cached = $this->cache[$key] ?? null;
2509 if ($cached) {
2510 $this->currPos = $cached->nextPos;
2511
2512 return $cached->result;
2513 }
2514
2515 $p2 = $this->currPos;
2516 // start seq_1
2517 $p3 = $this->currPos;
2518 $r4 = $this->discardWhile($silence);
2519 if ($r4===self::$FAILED) {
2520 $r1 = self::$FAILED;
2521 goto seq_1;
2522 }
2523 $r5 = $this->parsecompound_list($silence, $boolParams);
2524 // list <- $r5
2525 if ($r5===self::$FAILED) {
2526 $this->currPos = $p3;
2527 $r1 = self::$FAILED;
2528 goto seq_1;
2529 }
2530 $r6 = $this->parsedo_group($silence, $boolParams);
2531 // body <- $r6
2532 if ($r6===self::$FAILED) {
2533 $this->currPos = $p3;
2534 $r1 = self::$FAILED;
2535 goto seq_1;
2536 }
2537 $r1 = true;
2538 seq_1:
2539 if ($r1!==self::$FAILED) {
2540 $this->savedPos = $p2;
2541 $r1 = $this->a27($r5, $r6);
2542 }
2543 // free $p3
2544 $this->cache[$key] = new PEGParserCacheEntry(
2545 $this->currPos,
2546 $r1
2547
2548 );
2549 return $r1;
2550 }
2551 private function parseuntil_clause($silence, $boolParams) {
2552 $key = json_encode([46,$this->currPos,$boolParams & 0x1]);
2553 $cached = $this->cache[$key] ?? null;
2554 if ($cached) {
2555 $this->currPos = $cached->nextPos;
2556
2557 return $cached->result;
2558 }
2559
2560 $p2 = $this->currPos;
2561 // start seq_1
2562 $p3 = $this->currPos;
2563 $r4 = $this->discardUntil($silence);
2564 if ($r4===self::$FAILED) {
2565 $r1 = self::$FAILED;
2566 goto seq_1;
2567 }
2568 $r5 = $this->parsecompound_list($silence, $boolParams);
2569 // list <- $r5
2570 if ($r5===self::$FAILED) {
2571 $this->currPos = $p3;
2572 $r1 = self::$FAILED;
2573 goto seq_1;
2574 }
2575 $r6 = $this->parsedo_group($silence, $boolParams);
2576 // body <- $r6
2577 if ($r6===self::$FAILED) {
2578 $this->currPos = $p3;
2579 $r1 = self::$FAILED;
2580 goto seq_1;
2581 }
2582 $r1 = true;
2583 seq_1:
2584 if ($r1!==self::$FAILED) {
2585 $this->savedPos = $p2;
2586 $r1 = $this->a28($r5, $r6);
2587 }
2588 // free $p3
2589 $this->cache[$key] = new PEGParserCacheEntry(
2590 $this->currPos,
2591 $r1
2592
2593 );
2594 return $r1;
2595 }
2596 private function parseio_redirect($silence, $boolParams) {
2597 $key = json_encode([66,$this->currPos,$boolParams & 0x1]);
2598 $cached = $this->cache[$key] ?? null;
2599 if ($cached) {
2600 $this->currPos = $cached->nextPos;
2601
2602 return $cached->result;
2603 }
2604
2605 $p2 = $this->currPos;
2606 // start seq_1
2607 $p3 = $this->currPos;
2608 $r4 = $this->parseIO_NUMBER($silence);
2609 if ($r4===self::$FAILED) {
2610 $r4 = null;
2611 }
2612 // number <- $r4
2613 // start choice_1
2614 $r5 = $this->parseio_file($silence, $boolParams);
2615 if ($r5!==self::$FAILED) {
2616 goto choice_1;
2617 }
2618 $r5 = $this->parseio_here($silence, $boolParams);
2619 choice_1:
2620 // file_or_here <- $r5
2621 if ($r5===self::$FAILED) {
2622 $this->currPos = $p3;
2623 $r1 = self::$FAILED;
2624 goto seq_1;
2625 }
2626 $r1 = true;
2627 seq_1:
2628 if ($r1!==self::$FAILED) {
2629 $this->savedPos = $p2;
2630 $r1 = $this->a29($r4, $r5);
2631 }
2632 // free $p3
2633 $this->cache[$key] = new PEGParserCacheEntry(
2634 $this->currPos,
2635 $r1
2636
2637 );
2638 return $r1;
2639 }
2640 private function parseASSIGNMENT_WORD($silence, $boolParams) {
2641 $key = json_encode([200,$this->currPos,$boolParams & 0x1]);
2642 $cached = $this->cache[$key] ?? null;
2643 if ($cached) {
2644 $this->currPos = $cached->nextPos;
2645
2646 return $cached->result;
2647 }
2648
2649 $p2 = $this->currPos;
2650 // start seq_1
2651 $p3 = $this->currPos;
2652 $r4 = $this->parseNAME($silence);
2653 // name <- $r4
2654 if ($r4===self::$FAILED) {
2655 $r1 = self::$FAILED;
2656 goto seq_1;
2657 }
2658 if (($this->input[$this->currPos] ?? null) === "=") {
2659 $this->currPos++;
2660 $r5 = "=";
2661 } else {
2662 if (!$silence) {$this->fail(16);}
2663 $r5 = self::$FAILED;
2664 $this->currPos = $p3;
2665 $r1 = self::$FAILED;
2666 goto seq_1;
2667 }
2668 $r6 = $this->parseWORD($silence, $boolParams);
2669 // word <- $r6
2670 if ($r6===self::$FAILED) {
2671 $this->currPos = $p3;
2672 $r1 = self::$FAILED;
2673 goto seq_1;
2674 }
2675 $r1 = true;
2676 seq_1:
2677 if ($r1!==self::$FAILED) {
2678 $this->savedPos = $p2;
2679 $r1 = $this->a30($r4, $r6);
2680 }
2681 // free $p3
2682 $this->cache[$key] = new PEGParserCacheEntry(
2683 $this->currPos,
2684 $r1
2685
2686 );
2687 return $r1;
2688 }
2689 private function parseword_part($silence, $boolParams) {
2690 $key = json_encode([158,$this->currPos,$boolParams & 0x1]);
2691 $cached = $this->cache[$key] ?? null;
2692 if ($cached) {
2693 $this->currPos = $cached->nextPos;
2694
2695 return $cached->result;
2696 }
2697
2698 // start choice_1
2699 $r1 = $this->parsesingle_quoted_part($silence);
2700 if ($r1!==self::$FAILED) {
2701 goto choice_1;
2702 }
2703 $r1 = $this->parsedouble_quoted_part($silence, $boolParams);
2704 if ($r1!==self::$FAILED) {
2705 goto choice_1;
2706 }
2707 $r1 = $this->parsebare_escape_sequence($silence);
2708 if ($r1!==self::$FAILED) {
2709 goto choice_1;
2710 }
2711 $r1 = $this->parsebackquote_expansion($silence, $boolParams);
2712 if ($r1!==self::$FAILED) {
2713 goto choice_1;
2714 }
2715 $r1 = $this->parsedollar_expansion($silence, $boolParams);
2716 if ($r1!==self::$FAILED) {
2717 goto choice_1;
2718 }
2719 $r1 = $this->parseplain_part($silence, $boolParams);
2720 choice_1:
2721 $this->cache[$key] = new PEGParserCacheEntry(
2722 $this->currPos,
2723 $r1
2724
2725 );
2726 return $r1;
2727 }
2728 private function discardreserved($silence) {
2729 $key = json_encode([137,$this->currPos]);
2730 $cached = $this->cache[$key] ?? null;
2731 if ($cached) {
2732 $this->currPos = $cached->nextPos;
2733
2734 return $cached->result;
2735 }
2736
2737 // start choice_1
2738 $r1 = $this->discardIf($silence);
2739 if ($r1!==self::$FAILED) {
2740 goto choice_1;
2741 }
2742 $r1 = $this->discardThen($silence);
2743 if ($r1!==self::$FAILED) {
2744 goto choice_1;
2745 }
2746 $r1 = $this->discardElse($silence);
2747 if ($r1!==self::$FAILED) {
2748 goto choice_1;
2749 }
2750 $r1 = $this->discardElif($silence);
2751 if ($r1!==self::$FAILED) {
2752 goto choice_1;
2753 }
2754 $r1 = $this->discardFi($silence);
2755 if ($r1!==self::$FAILED) {
2756 goto choice_1;
2757 }
2758 $r1 = $this->discardDo($silence);
2759 if ($r1!==self::$FAILED) {
2760 goto choice_1;
2761 }
2762 $r1 = $this->discardDone($silence);
2763 if ($r1!==self::$FAILED) {
2764 goto choice_1;
2765 }
2766 $r1 = $this->discardCase($silence);
2767 if ($r1!==self::$FAILED) {
2768 goto choice_1;
2769 }
2770 $r1 = $this->discardEsac($silence);
2771 if ($r1!==self::$FAILED) {
2772 goto choice_1;
2773 }
2774 $r1 = $this->discardWhile($silence);
2775 if ($r1!==self::$FAILED) {
2776 goto choice_1;
2777 }
2778 $r1 = $this->discardUntil($silence);
2779 if ($r1!==self::$FAILED) {
2780 goto choice_1;
2781 }
2782 $r1 = $this->discardFor($silence);
2783 if ($r1!==self::$FAILED) {
2784 goto choice_1;
2785 }
2786 $r1 = $this->discardLbrace($silence);
2787 if ($r1!==self::$FAILED) {
2788 goto choice_1;
2789 }
2790 $r1 = $this->discardRbrace($silence);
2791 if ($r1!==self::$FAILED) {
2792 goto choice_1;
2793 }
2794 $r1 = $this->discardBang($silence);
2795 if ($r1!==self::$FAILED) {
2796 goto choice_1;
2797 }
2798 $r1 = $this->discardIn($silence);
2799 choice_1:
2800 $this->cache[$key] = new PEGParserCacheEntry(
2801 $this->currPos,
2802 $r1
2803
2804 );
2805 return $r1;
2806 }
2807 private function discardLbrace($silence) {
2808 $key = json_encode([129,$this->currPos]);
2809 $cached = $this->cache[$key] ?? null;
2810 if ($cached) {
2811 $this->currPos = $cached->nextPos;
2812
2813 return $cached->result;
2814 }
2815
2816 // start seq_1
2817 $p1 = $this->currPos;
2818 if (($this->input[$this->currPos] ?? null) === "{") {
2819 $this->currPos++;
2820 $r3 = "{";
2821 } else {
2822 if (!$silence) {$this->fail(17);}
2823 $r3 = self::$FAILED;
2824 $r2 = self::$FAILED;
2825 goto seq_1;
2826 }
2827 $r4 = $this->discardDELIM($silence);
2828 if ($r4===self::$FAILED) {
2829 $this->currPos = $p1;
2830 $r2 = self::$FAILED;
2831 goto seq_1;
2832 }
2833 $r2 = true;
2834 seq_1:
2835 // free $r2,$p1
2836 $this->cache[$key] = new PEGParserCacheEntry(
2837 $this->currPos,
2838 $r2
2839
2840 );
2841 return $r2;
2842 }
2843 private function parsecompound_list($silence, $boolParams) {
2844 $key = json_encode([18,$this->currPos,$boolParams & 0x1]);
2845 $cached = $this->cache[$key] ?? null;
2846 if ($cached) {
2847 $this->currPos = $cached->nextPos;
2848
2849 return $cached->result;
2850 }
2851
2852 // start choice_1
2853 $p2 = $this->currPos;
2854 // start seq_1
2855 $p3 = $this->currPos;
2856 $r4 = $this->discardlinebreak($silence);
2857 if ($r4===self::$FAILED) {
2858 $r1 = self::$FAILED;
2859 goto seq_1;
2860 }
2861 $r5 = [];
2862 for (;;) {
2863 $p7 = $this->currPos;
2864 // start seq_2
2865 $p8 = $this->currPos;
2866 $r9 = $this->parseand_or($silence, $boolParams);
2867 // term <- $r9
2868 if ($r9===self::$FAILED) {
2869 $r6 = self::$FAILED;
2870 goto seq_2;
2871 }
2872 $p11 = $this->currPos;
2873 $r10 = $this->discardseparator($silence);
2874 // separator <- $r10
2875 if ($r10!==self::$FAILED) {
2876 $r10 = substr($this->input, $p11, $this->currPos - $p11);
2877 } else {
2878 $r10 = self::$FAILED;
2879 $this->currPos = $p8;
2880 $r6 = self::$FAILED;
2881 goto seq_2;
2882 }
2883 // free $p11
2884 $r6 = true;
2885 seq_2:
2886 if ($r6!==self::$FAILED) {
2887 $this->savedPos = $p7;
2888 $r6 = $this->a31($r9, $r10);
2889 $r5[] = $r6;
2890 } else {
2891 break;
2892 }
2893 // free $p8
2894 }
2895 if (count($r5) === 0) {
2896 $r5 = self::$FAILED;
2897 }
2898 // terms <- $r5
2899 if ($r5===self::$FAILED) {
2900 $this->currPos = $p3;
2901 $r1 = self::$FAILED;
2902 goto seq_1;
2903 }
2904 // free $r6
2905 $r6 = $this->parseand_or($silence, $boolParams);
2906 if ($r6===self::$FAILED) {
2907 $r6 = null;
2908 }
2909 // last <- $r6
2910 $r1 = true;
2911 seq_1:
2912 if ($r1!==self::$FAILED) {
2913 $this->savedPos = $p2;
2914 $r1 = $this->a32($r5, $r6);
2915 goto choice_1;
2916 }
2917 // free $p3
2918 $p3 = $this->currPos;
2919 // start seq_3
2920 $p8 = $this->currPos;
2921 $r12 = $this->discardlinebreak($silence);
2922 if ($r12===self::$FAILED) {
2923 $r1 = self::$FAILED;
2924 goto seq_3;
2925 }
2926 $r13 = $this->parseand_or($silence, $boolParams);
2927 // term <- $r13
2928 if ($r13===self::$FAILED) {
2929 $this->currPos = $p8;
2930 $r1 = self::$FAILED;
2931 goto seq_3;
2932 }
2933 $r1 = true;
2934 seq_3:
2935 if ($r1!==self::$FAILED) {
2936 $this->savedPos = $p3;
2937 $r1 = $this->a33($r13);
2938 }
2939 // free $p8
2940 choice_1:
2941 $this->cache[$key] = new PEGParserCacheEntry(
2942 $this->currPos,
2943 $r1
2944
2945 );
2946 return $r1;
2947 }
2948 private function discardRbrace($silence) {
2949 $key = json_encode([131,$this->currPos]);
2950 $cached = $this->cache[$key] ?? null;
2951 if ($cached) {
2952 $this->currPos = $cached->nextPos;
2953
2954 return $cached->result;
2955 }
2956
2957 // start seq_1
2958 $p1 = $this->currPos;
2959 if (($this->input[$this->currPos] ?? null) === "}") {
2960 $this->currPos++;
2961 $r3 = "}";
2962 } else {
2963 if (!$silence) {$this->fail(18);}
2964 $r3 = self::$FAILED;
2965 $r2 = self::$FAILED;
2966 goto seq_1;
2967 }
2968 $r4 = $this->discardDELIM($silence);
2969 if ($r4===self::$FAILED) {
2970 $this->currPos = $p1;
2971 $r2 = self::$FAILED;
2972 goto seq_1;
2973 }
2974 $r2 = true;
2975 seq_1:
2976 // free $r2,$p1
2977 $this->cache[$key] = new PEGParserCacheEntry(
2978 $this->currPos,
2979 $r2
2980
2981 );
2982 return $r2;
2983 }
2984 private function discardFor($silence) {
2985 $key = json_encode([127,$this->currPos]);
2986 $cached = $this->cache[$key] ?? null;
2987 if ($cached) {
2988 $this->currPos = $cached->nextPos;
2989
2990 return $cached->result;
2991 }
2992
2993 // start seq_1
2994 $p1 = $this->currPos;
2995 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "for", $this->currPos, 3, false) === 0) {
2996 $r3 = "for";
2997 $this->currPos += 3;
2998 } else {
2999 if (!$silence) {$this->fail(19);}
3000 $r3 = self::$FAILED;
3001 $r2 = self::$FAILED;
3002 goto seq_1;
3003 }
3004 $r4 = $this->discardDELIM($silence);
3005 if ($r4===self::$FAILED) {
3006 $this->currPos = $p1;
3007 $r2 = self::$FAILED;
3008 goto seq_1;
3009 }
3010 $r2 = true;
3011 seq_1:
3012 // free $r2,$p1
3013 $this->cache[$key] = new PEGParserCacheEntry(
3014 $this->currPos,
3015 $r2
3016
3017 );
3018 return $r2;
3019 }
3020 private function parsefor_name($silence) {
3021 $key = json_encode([22,$this->currPos]);
3022 $cached = $this->cache[$key] ?? null;
3023 if ($cached) {
3024 $this->currPos = $cached->nextPos;
3025
3026 return $cached->result;
3027 }
3028
3029 $p2 = $this->currPos;
3030 // start seq_1
3031 $p3 = $this->currPos;
3032 $r4 = $this->parseNAME($silence);
3033 // name <- $r4
3034 if ($r4===self::$FAILED) {
3035 $r1 = self::$FAILED;
3036 goto seq_1;
3037 }
3038 $r5 = $this->discardOWS($silence);
3039 if ($r5===self::$FAILED) {
3040 $this->currPos = $p3;
3041 $r1 = self::$FAILED;
3042 goto seq_1;
3043 }
3044 $r1 = true;
3045 seq_1:
3046 if ($r1!==self::$FAILED) {
3047 $this->savedPos = $p2;
3048 $r1 = $this->a34($r4);
3049 }
3050 // free $p3
3051 $this->cache[$key] = new PEGParserCacheEntry(
3052 $this->currPos,
3053 $r1
3054
3055 );
3056 return $r1;
3057 }
3058 private function discardfor_case_in($silence) {
3059 $key = json_encode([25,$this->currPos]);
3060 $cached = $this->cache[$key] ?? null;
3061 if ($cached) {
3062 $this->currPos = $cached->nextPos;
3063
3064 return $cached->result;
3065 }
3066
3067 // start seq_1
3068 $p1 = $this->currPos;
3069 $r3 = $this->discardIn($silence);
3070 if ($r3===self::$FAILED) {
3071 $r2 = self::$FAILED;
3072 goto seq_1;
3073 }
3074 $r4 = $this->discardOWS($silence);
3075 if ($r4===self::$FAILED) {
3076 $this->currPos = $p1;
3077 $r2 = self::$FAILED;
3078 goto seq_1;
3079 }
3080 $r2 = true;
3081 seq_1:
3082 // free $r2,$p1
3083 $this->cache[$key] = new PEGParserCacheEntry(
3084 $this->currPos,
3085 $r2
3086
3087 );
3088 return $r2;
3089 }
3090 private function parsewordlist($silence, $boolParams) {
3091 $key = json_encode([26,$this->currPos,$boolParams & 0x1]);
3092 $cached = $this->cache[$key] ?? null;
3093 if ($cached) {
3094 $this->currPos = $cached->nextPos;
3095
3096 return $cached->result;
3097 }
3098
3099 $r1 = [];
3100 for (;;) {
3101 $r2 = $this->parseWORD($silence, $boolParams);
3102 if ($r2!==self::$FAILED) {
3103 $r1[] = $r2;
3104 } else {
3105 break;
3106 }
3107 }
3108 if (count($r1) === 0) {
3109 $r1 = self::$FAILED;
3110 }
3111 // free $r2
3112 $this->cache[$key] = new PEGParserCacheEntry(
3113 $this->currPos,
3114 $r1
3115
3116 );
3117 return $r1;
3118 }
3119 private function discardsequential_sep($silence) {
3120 $key = json_encode([83,$this->currPos]);
3121 $cached = $this->cache[$key] ?? null;
3122 if ($cached) {
3123 $this->currPos = $cached->nextPos;
3124
3125 return $cached->result;
3126 }
3127
3128 // start choice_1
3129 // start seq_1
3130 $p2 = $this->currPos;
3131 $r3 = $this->discardSEMI($silence);
3132 if ($r3===self::$FAILED) {
3133 $r1 = self::$FAILED;
3134 goto seq_1;
3135 }
3136 $r4 = $this->discardlinebreak($silence);
3137 if ($r4===self::$FAILED) {
3138 $this->currPos = $p2;
3139 $r1 = self::$FAILED;
3140 goto seq_1;
3141 }
3142 $r1 = true;
3143 seq_1:
3144 if ($r1!==self::$FAILED) {
3145 goto choice_1;
3146 }
3147 // free $p2
3148 $r1 = $this->discardnewline_list($silence);
3149 choice_1:
3150 $this->cache[$key] = new PEGParserCacheEntry(
3151 $this->currPos,
3152 $r1
3153
3154 );
3155 return $r1;
3156 }
3157 private function parsedo_group($silence, $boolParams) {
3158 $key = json_encode([54,$this->currPos,$boolParams & 0x1]);
3159 $cached = $this->cache[$key] ?? null;
3160 if ($cached) {
3161 $this->currPos = $cached->nextPos;
3162
3163 return $cached->result;
3164 }
3165
3166 $p2 = $this->currPos;
3167 // start seq_1
3168 $p3 = $this->currPos;
3169 $r4 = $this->discardDo($silence);
3170 if ($r4===self::$FAILED) {
3171 $r1 = self::$FAILED;
3172 goto seq_1;
3173 }
3174 $r5 = $this->parsecompound_list($silence, $boolParams);
3175 // list <- $r5
3176 if ($r5===self::$FAILED) {
3177 $this->currPos = $p3;
3178 $r1 = self::$FAILED;
3179 goto seq_1;
3180 }
3181 $r6 = $this->discardDone($silence);
3182 if ($r6===self::$FAILED) {
3183 $this->currPos = $p3;
3184 $r1 = self::$FAILED;
3185 goto seq_1;
3186 }
3187 $r1 = true;
3188 seq_1:
3189 if ($r1!==self::$FAILED) {
3190 $this->savedPos = $p2;
3191 $r1 = $this->a35($r5);
3192 }
3193 // free $p3
3194 $this->cache[$key] = new PEGParserCacheEntry(
3195 $this->currPos,
3196 $r1
3197
3198 );
3199 return $r1;
3200 }
3201 private function discardCase($silence) {
3202 $key = json_encode([119,$this->currPos]);
3203 $cached = $this->cache[$key] ?? null;
3204 if ($cached) {
3205 $this->currPos = $cached->nextPos;
3206
3207 return $cached->result;
3208 }
3209
3210 // start seq_1
3211 $p1 = $this->currPos;
3212 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "case", $this->currPos, 4, false) === 0) {
3213 $r3 = "case";
3214 $this->currPos += 4;
3215 } else {
3216 if (!$silence) {$this->fail(20);}
3217 $r3 = self::$FAILED;
3218 $r2 = self::$FAILED;
3219 goto seq_1;
3220 }
3221 $r4 = $this->discardDELIM($silence);
3222 if ($r4===self::$FAILED) {
3223 $this->currPos = $p1;
3224 $r2 = self::$FAILED;
3225 goto seq_1;
3226 }
3227 $r2 = true;
3228 seq_1:
3229 // free $r2,$p1
3230 $this->cache[$key] = new PEGParserCacheEntry(
3231 $this->currPos,
3232 $r2
3233
3234 );
3235 return $r2;
3236 }
3237 private function parsecase_list($silence, $boolParams) {
3238 $key = json_encode([32,$this->currPos,$boolParams & 0x1]);
3239 $cached = $this->cache[$key] ?? null;
3240 if ($cached) {
3241 $this->currPos = $cached->nextPos;
3242
3243 return $cached->result;
3244 }
3245
3246 $r1 = [];
3247 for (;;) {
3248 $r2 = $this->parsecase_item($silence, $boolParams);
3249 if ($r2!==self::$FAILED) {
3250 $r1[] = $r2;
3251 } else {
3252 break;
3253 }
3254 }
3255 if (count($r1) === 0) {
3256 $r1 = self::$FAILED;
3257 }
3258 // free $r2
3259 $this->cache[$key] = new PEGParserCacheEntry(
3260 $this->currPos,
3261 $r1
3262
3263 );
3264 return $r1;
3265 }
3266 private function discardEsac($silence) {
3267 $key = json_encode([121,$this->currPos]);
3268 $cached = $this->cache[$key] ?? null;
3269 if ($cached) {
3270 $this->currPos = $cached->nextPos;
3271
3272 return $cached->result;
3273 }
3274
3275 // start seq_1
3276 $p1 = $this->currPos;
3277 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "esac", $this->currPos, 4, false) === 0) {
3278 $r3 = "esac";
3279 $this->currPos += 4;
3280 } else {
3281 if (!$silence) {$this->fail(21);}
3282 $r3 = self::$FAILED;
3283 $r2 = self::$FAILED;
3284 goto seq_1;
3285 }
3286 $r4 = $this->discardDELIM($silence);
3287 if ($r4===self::$FAILED) {
3288 $this->currPos = $p1;
3289 $r2 = self::$FAILED;
3290 goto seq_1;
3291 }
3292 $r2 = true;
3293 seq_1:
3294 // free $r2,$p1
3295 $this->cache[$key] = new PEGParserCacheEntry(
3296 $this->currPos,
3297 $r2
3298
3299 );
3300 return $r2;
3301 }
3302 private function parsecase_list_ns($silence, $boolParams) {
3303 $key = json_encode([30,$this->currPos,$boolParams & 0x1]);
3304 $cached = $this->cache[$key] ?? null;
3305 if ($cached) {
3306 $this->currPos = $cached->nextPos;
3307
3308 return $cached->result;
3309 }
3310
3311 // start choice_1
3312 $p2 = $this->currPos;
3313 // start seq_1
3314 $p3 = $this->currPos;
3315 $r4 = $this->parsecase_list($silence, $boolParams);
3316 // list <- $r4
3317 if ($r4===self::$FAILED) {
3318 $r1 = self::$FAILED;
3319 goto seq_1;
3320 }
3321 $r5 = $this->parsecase_item_ns($silence, $boolParams);
3322 // item <- $r5
3323 if ($r5===self::$FAILED) {
3324 $this->currPos = $p3;
3325 $r1 = self::$FAILED;
3326 goto seq_1;
3327 }
3328 $r1 = true;
3329 seq_1:
3330 if ($r1!==self::$FAILED) {
3331 $this->savedPos = $p2;
3332 $r1 = $this->a36($r4, $r5);
3333 goto choice_1;
3334 }
3335 // free $p3
3336 $p3 = $this->currPos;
3337 $r6 = $this->parsecase_item_ns($silence, $boolParams);
3338 // item <- $r6
3339 $r1 = $r6;
3340 if ($r1!==self::$FAILED) {
3341 $this->savedPos = $p3;
3342 $r1 = $this->a37($r6);
3343 }
3344 choice_1:
3345 $this->cache[$key] = new PEGParserCacheEntry(
3346 $this->currPos,
3347 $r1
3348
3349 );
3350 return $r1;
3351 }
3352 private function discardIf($silence) {
3353 $key = json_encode([105,$this->currPos]);
3354 $cached = $this->cache[$key] ?? null;
3355 if ($cached) {
3356 $this->currPos = $cached->nextPos;
3357
3358 return $cached->result;
3359 }
3360
3361 // start seq_1
3362 $p1 = $this->currPos;
3363 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "if", $this->currPos, 2, false) === 0) {
3364 $r3 = "if";
3365 $this->currPos += 2;
3366 } else {
3367 if (!$silence) {$this->fail(22);}
3368 $r3 = self::$FAILED;
3369 $r2 = self::$FAILED;
3370 goto seq_1;
3371 }
3372 $r4 = $this->discardDELIM($silence);
3373 if ($r4===self::$FAILED) {
3374 $this->currPos = $p1;
3375 $r2 = self::$FAILED;
3376 goto seq_1;
3377 }
3378 $r2 = true;
3379 seq_1:
3380 // free $r2,$p1
3381 $this->cache[$key] = new PEGParserCacheEntry(
3382 $this->currPos,
3383 $r2
3384
3385 );
3386 return $r2;
3387 }
3388 private function discardThen($silence) {
3389 $key = json_encode([107,$this->currPos]);
3390 $cached = $this->cache[$key] ?? null;
3391 if ($cached) {
3392 $this->currPos = $cached->nextPos;
3393
3394 return $cached->result;
3395 }
3396
3397 // start seq_1
3398 $p1 = $this->currPos;
3399 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "then", $this->currPos, 4, false) === 0) {
3400 $r3 = "then";
3401 $this->currPos += 4;
3402 } else {
3403 if (!$silence) {$this->fail(23);}
3404 $r3 = self::$FAILED;
3405 $r2 = self::$FAILED;
3406 goto seq_1;
3407 }
3408 $r4 = $this->discardDELIM($silence);
3409 if ($r4===self::$FAILED) {
3410 $this->currPos = $p1;
3411 $r2 = self::$FAILED;
3412 goto seq_1;
3413 }
3414 $r2 = true;
3415 seq_1:
3416 // free $r2,$p1
3417 $this->cache[$key] = new PEGParserCacheEntry(
3418 $this->currPos,
3419 $r2
3420
3421 );
3422 return $r2;
3423 }
3424 private function parseelse_part($silence, $boolParams) {
3425 $key = json_encode([42,$this->currPos,$boolParams & 0x1]);
3426 $cached = $this->cache[$key] ?? null;
3427 if ($cached) {
3428 $this->currPos = $cached->nextPos;
3429
3430 return $cached->result;
3431 }
3432
3433 // start choice_1
3434 $p2 = $this->currPos;
3435 // start seq_1
3436 $p3 = $this->currPos;
3437 $r4 = $this->discardElif($silence);
3438 if ($r4===self::$FAILED) {
3439 $r1 = self::$FAILED;
3440 goto seq_1;
3441 }
3442 $r5 = $this->parsecompound_list($silence, $boolParams);
3443 // condition <- $r5
3444 if ($r5===self::$FAILED) {
3445 $this->currPos = $p3;
3446 $r1 = self::$FAILED;
3447 goto seq_1;
3448 }
3449 $r6 = $this->discardThen($silence);
3450 if ($r6===self::$FAILED) {
3451 $this->currPos = $p3;
3452 $r1 = self::$FAILED;
3453 goto seq_1;
3454 }
3455 $r7 = $this->parsecompound_list($silence, $boolParams);
3456 // consequent <- $r7
3457 if ($r7===self::$FAILED) {
3458 $this->currPos = $p3;
3459 $r1 = self::$FAILED;
3460 goto seq_1;
3461 }
3462 $r8 = $this->parseelse_part($silence, $boolParams);
3463 if ($r8===self::$FAILED) {
3464 $r8 = null;
3465 }
3466 // else_part <- $r8
3467 $r1 = true;
3468 seq_1:
3469 if ($r1!==self::$FAILED) {
3470 $this->savedPos = $p2;
3471 $r1 = $this->a38($r5, $r7, $r8);
3472 goto choice_1;
3473 }
3474 // free $p3
3475 $p3 = $this->currPos;
3476 // start seq_2
3477 $p9 = $this->currPos;
3478 $r10 = $this->discardElse($silence);
3479 if ($r10===self::$FAILED) {
3480 $r1 = self::$FAILED;
3481 goto seq_2;
3482 }
3483 $r11 = $this->parsecompound_list($silence, $boolParams);
3484 // alternative <- $r11
3485 if ($r11===self::$FAILED) {
3486 $this->currPos = $p9;
3487 $r1 = self::$FAILED;
3488 goto seq_2;
3489 }
3490 $r1 = true;
3491 seq_2:
3492 if ($r1!==self::$FAILED) {
3493 $this->savedPos = $p3;
3494 $r1 = $this->a39($r11);
3495 }
3496 // free $p9
3497 choice_1:
3498 $this->cache[$key] = new PEGParserCacheEntry(
3499 $this->currPos,
3500 $r1
3501
3502 );
3503 return $r1;
3504 }
3505 private function discardFi($silence) {
3506 $key = json_encode([113,$this->currPos]);
3507 $cached = $this->cache[$key] ?? null;
3508 if ($cached) {
3509 $this->currPos = $cached->nextPos;
3510
3511 return $cached->result;
3512 }
3513
3514 // start seq_1
3515 $p1 = $this->currPos;
3516 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "fi", $this->currPos, 2, false) === 0) {
3517 $r3 = "fi";
3518 $this->currPos += 2;
3519 } else {
3520 if (!$silence) {$this->fail(24);}
3521 $r3 = self::$FAILED;
3522 $r2 = self::$FAILED;
3523 goto seq_1;
3524 }
3525 $r4 = $this->discardDELIM($silence);
3526 if ($r4===self::$FAILED) {
3527 $this->currPos = $p1;
3528 $r2 = self::$FAILED;
3529 goto seq_1;
3530 }
3531 $r2 = true;
3532 seq_1:
3533 // free $r2,$p1
3534 $this->cache[$key] = new PEGParserCacheEntry(
3535 $this->currPos,
3536 $r2
3537
3538 );
3539 return $r2;
3540 }
3541 private function discardWhile($silence) {
3542 $key = json_encode([123,$this->currPos]);
3543 $cached = $this->cache[$key] ?? null;
3544 if ($cached) {
3545 $this->currPos = $cached->nextPos;
3546
3547 return $cached->result;
3548 }
3549
3550 // start seq_1
3551 $p1 = $this->currPos;
3552 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "while", $this->currPos, 5, false) === 0) {
3553 $r3 = "while";
3554 $this->currPos += 5;
3555 } else {
3556 if (!$silence) {$this->fail(25);}
3557 $r3 = self::$FAILED;
3558 $r2 = self::$FAILED;
3559 goto seq_1;
3560 }
3561 $r4 = $this->discardDELIM($silence);
3562 if ($r4===self::$FAILED) {
3563 $this->currPos = $p1;
3564 $r2 = self::$FAILED;
3565 goto seq_1;
3566 }
3567 $r2 = true;
3568 seq_1:
3569 // free $r2,$p1
3570 $this->cache[$key] = new PEGParserCacheEntry(
3571 $this->currPos,
3572 $r2
3573
3574 );
3575 return $r2;
3576 }
3577 private function discardUntil($silence) {
3578 $key = json_encode([125,$this->currPos]);
3579 $cached = $this->cache[$key] ?? null;
3580 if ($cached) {
3581 $this->currPos = $cached->nextPos;
3582
3583 return $cached->result;
3584 }
3585
3586 // start seq_1
3587 $p1 = $this->currPos;
3588 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "until", $this->currPos, 5, false) === 0) {
3589 $r3 = "until";
3590 $this->currPos += 5;
3591 } else {
3592 if (!$silence) {$this->fail(26);}
3593 $r3 = self::$FAILED;
3594 $r2 = self::$FAILED;
3595 goto seq_1;
3596 }
3597 $r4 = $this->discardDELIM($silence);
3598 if ($r4===self::$FAILED) {
3599 $this->currPos = $p1;
3600 $r2 = self::$FAILED;
3601 goto seq_1;
3602 }
3603 $r2 = true;
3604 seq_1:
3605 // free $r2,$p1
3606 $this->cache[$key] = new PEGParserCacheEntry(
3607 $this->currPos,
3608 $r2
3609
3610 );
3611 return $r2;
3612 }
3613 private function parseIO_NUMBER($silence) {
3614 $key = json_encode([206,$this->currPos]);
3615 $cached = $this->cache[$key] ?? null;
3616 if ($cached) {
3617 $this->currPos = $cached->nextPos;
3618
3619 return $cached->result;
3620 }
3621
3622 $p1 = $this->currPos;
3623 $r2 = self::$FAILED;
3624 for (;;) {
3625 $r3 = $this->input[$this->currPos] ?? '';
3626 if (preg_match("/^[0-9]/", $r3)) {
3627 $this->currPos++;
3628 $r2 = true;
3629 } else {
3630 $r3 = self::$FAILED;
3631 if (!$silence) {$this->fail(27);}
3632 break;
3633 }
3634 }
3635 if ($r2!==self::$FAILED) {
3636 $r2 = substr($this->input, $p1, $this->currPos - $p1);
3637 } else {
3638 $r2 = self::$FAILED;
3639 }
3640 // free $r3
3641 // free $p1
3642 $this->cache[$key] = new PEGParserCacheEntry(
3643 $this->currPos,
3644 $r2
3645
3646 );
3647 return $r2;
3648 }
3649 private function parseio_file($silence, $boolParams) {
3650 $key = json_encode([68,$this->currPos,$boolParams & 0x1]);
3651 $cached = $this->cache[$key] ?? null;
3652 if ($cached) {
3653 $this->currPos = $cached->nextPos;
3654
3655 return $cached->result;
3656 }
3657
3658 // start choice_1
3659 $p2 = $this->currPos;
3660 // start seq_1
3661 $p3 = $this->currPos;
3662 $r4 = $this->discardLESSAND($silence);
3663 if ($r4===self::$FAILED) {
3664 $r1 = self::$FAILED;
3665 goto seq_1;
3666 }
3667 $r5 = $this->parseWORD($silence, $boolParams);
3668 // filename <- $r5
3669 if ($r5===self::$FAILED) {
3670 $this->currPos = $p3;
3671 $r1 = self::$FAILED;
3672 goto seq_1;
3673 }
3674 $r1 = true;
3675 seq_1:
3676 if ($r1!==self::$FAILED) {
3677 $this->savedPos = $p2;
3678 $r1 = $this->a40($r5);
3679 goto choice_1;
3680 }
3681 // free $p3
3682 $p3 = $this->currPos;
3683 // start seq_2
3684 $p6 = $this->currPos;
3685 $r7 = $this->discardLESSGREAT($silence);
3686 if ($r7===self::$FAILED) {
3687 $r1 = self::$FAILED;
3688 goto seq_2;
3689 }
3690 $r8 = $this->parseWORD($silence, $boolParams);
3691 // filename <- $r8
3692 if ($r8===self::$FAILED) {
3693 $this->currPos = $p6;
3694 $r1 = self::$FAILED;
3695 goto seq_2;
3696 }
3697 $r1 = true;
3698 seq_2:
3699 if ($r1!==self::$FAILED) {
3700 $this->savedPos = $p3;
3701 $r1 = $this->a41($r8);
3702 goto choice_1;
3703 }
3704 // free $p6
3705 $p6 = $this->currPos;
3706 // start seq_3
3707 $p9 = $this->currPos;
3708 $r10 = $this->discardLESS($silence);
3709 if ($r10===self::$FAILED) {
3710 $r1 = self::$FAILED;
3711 goto seq_3;
3712 }
3713 $r11 = $this->parseWORD($silence, $boolParams);
3714 // filename <- $r11
3715 if ($r11===self::$FAILED) {
3716 $this->currPos = $p9;
3717 $r1 = self::$FAILED;
3718 goto seq_3;
3719 }
3720 $r1 = true;
3721 seq_3:
3722 if ($r1!==self::$FAILED) {
3723 $this->savedPos = $p6;
3724 $r1 = $this->a42($r11);
3725 goto choice_1;
3726 }
3727 // free $p9
3728 $p9 = $this->currPos;
3729 // start seq_4
3730 $p12 = $this->currPos;
3731 $r13 = $this->discardGREATAND($silence);
3732 if ($r13===self::$FAILED) {
3733 $r1 = self::$FAILED;
3734 goto seq_4;
3735 }
3736 $r14 = $this->parseWORD($silence, $boolParams);
3737 // filename <- $r14
3738 if ($r14===self::$FAILED) {
3739 $this->currPos = $p12;
3740 $r1 = self::$FAILED;
3741 goto seq_4;
3742 }
3743 $r1 = true;
3744 seq_4:
3745 if ($r1!==self::$FAILED) {
3746 $this->savedPos = $p9;
3747 $r1 = $this->a43($r14);
3748 goto choice_1;
3749 }
3750 // free $p12
3751 $p12 = $this->currPos;
3752 // start seq_5
3753 $p15 = $this->currPos;
3754 $r16 = $this->discardDGREAT($silence);
3755 if ($r16===self::$FAILED) {
3756 $r1 = self::$FAILED;
3757 goto seq_5;
3758 }
3759 $r17 = $this->parseWORD($silence, $boolParams);
3760 // filename <- $r17
3761 if ($r17===self::$FAILED) {
3762 $this->currPos = $p15;
3763 $r1 = self::$FAILED;
3764 goto seq_5;
3765 }
3766 $r1 = true;
3767 seq_5:
3768 if ($r1!==self::$FAILED) {
3769 $this->savedPos = $p12;
3770 $r1 = $this->a44($r17);
3771 goto choice_1;
3772 }
3773 // free $p15
3774 $p15 = $this->currPos;
3775 // start seq_6
3776 $p18 = $this->currPos;
3777 $r19 = $this->discardCLOBBER($silence);
3778 if ($r19===self::$FAILED) {
3779 $r1 = self::$FAILED;
3780 goto seq_6;
3781 }
3782 $r20 = $this->parseWORD($silence, $boolParams);
3783 // filename <- $r20
3784 if ($r20===self::$FAILED) {
3785 $this->currPos = $p18;
3786 $r1 = self::$FAILED;
3787 goto seq_6;
3788 }
3789 $r1 = true;
3790 seq_6:
3791 if ($r1!==self::$FAILED) {
3792 $this->savedPos = $p15;
3793 $r1 = $this->a45($r20);
3794 goto choice_1;
3795 }
3796 // free $p18
3797 $p18 = $this->currPos;
3798 // start seq_7
3799 $p21 = $this->currPos;
3800 $r22 = $this->discardGREAT($silence);
3801 if ($r22===self::$FAILED) {
3802 $r1 = self::$FAILED;
3803 goto seq_7;
3804 }
3805 $r23 = $this->parseWORD($silence, $boolParams);
3806 // filename <- $r23
3807 if ($r23===self::$FAILED) {
3808 $this->currPos = $p21;
3809 $r1 = self::$FAILED;
3810 goto seq_7;
3811 }
3812 $r1 = true;
3813 seq_7:
3814 if ($r1!==self::$FAILED) {
3815 $this->savedPos = $p18;
3816 $r1 = $this->a46($r23);
3817 }
3818 // free $p21
3819 choice_1:
3820 $this->cache[$key] = new PEGParserCacheEntry(
3821 $this->currPos,
3822 $r1
3823
3824 );
3825 return $r1;
3826 }
3827 private function parseio_here($silence, $boolParams) {
3828 $key = json_encode([70,$this->currPos,$boolParams & 0x1]);
3829 $cached = $this->cache[$key] ?? null;
3830 if ($cached) {
3831 $this->currPos = $cached->nextPos;
3832
3833 return $cached->result;
3834 }
3835
3836 $p2 = $this->currPos;
3837 // start seq_1
3838 $p3 = $this->currPos;
3839 // start choice_1
3840 $p5 = $this->currPos;
3841 $r4 = $this->discardDLESSDASH($silence);
3842 if ($r4!==self::$FAILED) {
3843 $this->savedPos = $p5;
3844 $r4 = $this->a47();
3845 goto choice_1;
3846 }
3847 $p6 = $this->currPos;
3848 $r4 = $this->discardDLESS($silence);
3849 if ($r4!==self::$FAILED) {
3850 $this->savedPos = $p6;
3851 $r4 = $this->a48();
3852 }
3853 choice_1:
3854 // op <- $r4
3855 if ($r4===self::$FAILED) {
3856 $r1 = self::$FAILED;
3857 goto seq_1;
3858 }
3859 $r7 = $this->parsehere_end($silence, $boolParams);
3860 // end <- $r7
3861 if ($r7===self::$FAILED) {
3862 $this->currPos = $p3;
3863 $r1 = self::$FAILED;
3864 goto seq_1;
3865 }
3866 $r1 = true;
3867 seq_1:
3868 if ($r1!==self::$FAILED) {
3869 $this->savedPos = $p2;
3870 $r1 = $this->a49($r4, $r7);
3871 }
3872 // free $p3
3873 $this->cache[$key] = new PEGParserCacheEntry(
3874 $this->currPos,
3875 $r1
3876
3877 );
3878 return $r1;
3879 }
3880 private function parsesingle_quoted_part($silence) {
3881 $key = json_encode([160,$this->currPos]);
3882 $cached = $this->cache[$key] ?? null;
3883 if ($cached) {
3884 $this->currPos = $cached->nextPos;
3885
3886 return $cached->result;
3887 }
3888
3889 $p2 = $this->currPos;
3890 // start seq_1
3891 $p3 = $this->currPos;
3892 if (($this->input[$this->currPos] ?? null) === "'") {
3893 $this->currPos++;
3894 $r4 = "'";
3895 } else {
3896 if (!$silence) {$this->fail(28);}
3897 $r4 = self::$FAILED;
3898 $r1 = self::$FAILED;
3899 goto seq_1;
3900 }
3901 $p6 = $this->currPos;
3902 for (;;) {
3903 $r7 = self::charAt($this->input, $this->currPos);
3904 if ($r7 !== '' && !($r7 === "'")) {
3905 $this->currPos += strlen($r7);
3906 } else {
3907 $r7 = self::$FAILED;
3908 if (!$silence) {$this->fail(29);}
3909 break;
3910 }
3911 }
3912 // free $r7
3913 $r5 = true;
3914 // contents <- $r5
3915 if ($r5!==self::$FAILED) {
3916 $r5 = substr($this->input, $p6, $this->currPos - $p6);
3917 } else {
3918 $r5 = self::$FAILED;
3919 $this->currPos = $p3;
3920 $r1 = self::$FAILED;
3921 goto seq_1;
3922 }
3923 // free $p6
3924 if (($this->input[$this->currPos] ?? null) === "'") {
3925 $this->currPos++;
3926 $r7 = "'";
3927 } else {
3928 if (!$silence) {$this->fail(28);}
3929 $r7 = self::$FAILED;
3930 $this->currPos = $p3;
3931 $r1 = self::$FAILED;
3932 goto seq_1;
3933 }
3934 $r1 = true;
3935 seq_1:
3936 if ($r1!==self::$FAILED) {
3937 $this->savedPos = $p2;
3938 $r1 = $this->a50($r5);
3939 }
3940 // free $p3
3941 $this->cache[$key] = new PEGParserCacheEntry(
3942 $this->currPos,
3943 $r1
3944
3945 );
3946 return $r1;
3947 }
3948 private function parsedouble_quoted_part($silence, $boolParams) {
3949 $key = json_encode([162,$this->currPos,$boolParams & 0x1]);
3950 $cached = $this->cache[$key] ?? null;
3951 if ($cached) {
3952 $this->currPos = $cached->nextPos;
3953
3954 return $cached->result;
3955 }
3956
3957 $p2 = $this->currPos;
3958 // start seq_1
3959 $p3 = $this->currPos;
3960 if (($this->input[$this->currPos] ?? null) === "\"") {
3961 $this->currPos++;
3962 $r4 = "\"";
3963 } else {
3964 if (!$silence) {$this->fail(30);}
3965 $r4 = self::$FAILED;
3966 $r1 = self::$FAILED;
3967 goto seq_1;
3968 }
3969 $r5 = [];
3970 for (;;) {
3971 // start choice_1
3972 $r6 = $this->parsedquoted_escape($silence);
3973 if ($r6!==self::$FAILED) {
3974 goto choice_1;
3975 }
3976 $r6 = $this->parsebackquote_expansion($silence, $boolParams);
3977 if ($r6!==self::$FAILED) {
3978 goto choice_1;
3979 }
3980 $r6 = $this->parsedollar_expansion($silence, $boolParams);
3981 if ($r6!==self::$FAILED) {
3982 goto choice_1;
3983 }
3984 if (($this->input[$this->currPos] ?? null) === "\\") {
3985 $this->currPos++;
3986 $r6 = "\\";
3987 goto choice_1;
3988 } else {
3989 if (!$silence) {$this->fail(31);}
3990 $r6 = self::$FAILED;
3991 }
3992 $p7 = $this->currPos;
3993 $r6 = self::$FAILED;
3994 for (;;) {
3995 if (strcspn($this->input, "\"`\$\\", $this->currPos, 1) !== 0) {
3996 $r8 = self::consumeChar($this->input, $this->currPos);
3997 $r6 = true;
3998 } else {
3999 $r8 = self::$FAILED;
4000 if (!$silence) {$this->fail(32);}
4001 break;
4002 }
4003 }
4004 if ($r6!==self::$FAILED) {
4005 $r6 = substr($this->input, $p7, $this->currPos - $p7);
4006 } else {
4007 $r6 = self::$FAILED;
4008 }
4009 // free $r8
4010 // free $p7
4011 choice_1:
4012 if ($r6!==self::$FAILED) {
4013 $r5[] = $r6;
4014 } else {
4015 break;
4016 }
4017 }
4018 // contents <- $r5
4019 // free $r6
4020 if (($this->input[$this->currPos] ?? null) === "\"") {
4021 $this->currPos++;
4022 $r6 = "\"";
4023 } else {
4024 if (!$silence) {$this->fail(30);}
4025 $r6 = self::$FAILED;
4026 $this->currPos = $p3;
4027 $r1 = self::$FAILED;
4028 goto seq_1;
4029 }
4030 $r1 = true;
4031 seq_1:
4032 if ($r1!==self::$FAILED) {
4033 $this->savedPos = $p2;
4034 $r1 = $this->a51($r5);
4035 }
4036 // free $p3
4037 $this->cache[$key] = new PEGParserCacheEntry(
4038 $this->currPos,
4039 $r1
4040
4041 );
4042 return $r1;
4043 }
4044 private function parsebare_escape_sequence($silence) {
4045 $key = json_encode([166,$this->currPos]);
4046 $cached = $this->cache[$key] ?? null;
4047 if ($cached) {
4048 $this->currPos = $cached->nextPos;
4049
4050 return $cached->result;
4051 }
4052
4053 $p2 = $this->currPos;
4054 // start seq_1
4055 $p3 = $this->currPos;
4056 if (($this->input[$this->currPos] ?? null) === "\\") {
4057 $this->currPos++;
4058 $r4 = "\\";
4059 } else {
4060 if (!$silence) {$this->fail(31);}
4061 $r4 = self::$FAILED;
4062 $r1 = self::$FAILED;
4063 goto seq_1;
4064 }
4065 $r5 = self::charAt($this->input, $this->currPos);
4066 // contents <- $r5
4067 if ($r5 !== '' && !($r5 === "\x0a")) {
4068 $this->currPos += strlen($r5);
4069 } else {
4070 $r5 = self::$FAILED;
4071 if (!$silence) {$this->fail(4);}
4072 $this->currPos = $p3;
4073 $r1 = self::$FAILED;
4074 goto seq_1;
4075 }
4076 $r1 = true;
4077 seq_1:
4078 if ($r1!==self::$FAILED) {
4079 $this->savedPos = $p2;
4080 $r1 = $this->a52($r5);
4081 }
4082 // free $p3
4083 $this->cache[$key] = new PEGParserCacheEntry(
4084 $this->currPos,
4085 $r1
4086
4087 );
4088 return $r1;
4089 }
4090 private function parsebackquote_expansion($silence, $boolParams) {
4091 $key = json_encode([168,$this->currPos,$boolParams & 0x1]);
4092 $cached = $this->cache[$key] ?? null;
4093 if ($cached) {
4094 $this->currPos = $cached->nextPos;
4095
4096 return $cached->result;
4097 }
4098
4099 $p2 = $this->currPos;
4100 // start seq_1
4101 $p3 = $this->currPos;
4102 if (($this->input[$this->currPos] ?? null) === "`") {
4103 $this->currPos++;
4104 $r4 = "`";
4105 } else {
4106 if (!$silence) {$this->fail(33);}
4107 $r4 = self::$FAILED;
4108 $r1 = self::$FAILED;
4109 goto seq_1;
4110 }
4111 $r5 = [];
4112 for (;;) {
4113 // start choice_1
4114 $r6 = $this->parsebackquoted_escape($silence);
4115 if ($r6!==self::$FAILED) {
4116 goto choice_1;
4117 }
4118 $r6 = $this->parsedollar_expansion($silence, $boolParams);
4119 if ($r6!==self::$FAILED) {
4120 goto choice_1;
4121 }
4122 $r6 = $this->parsedouble_backquote_expansion($silence, $boolParams);
4123 if ($r6!==self::$FAILED) {
4124 goto choice_1;
4125 }
4126 if (($this->input[$this->currPos] ?? null) === "\$") {
4127 $this->currPos++;
4128 $r6 = "\$";
4129 goto choice_1;
4130 } else {
4131 if (!$silence) {$this->fail(34);}
4132 $r6 = self::$FAILED;
4133 }
4134 if (($this->input[$this->currPos] ?? null) === "\\") {
4135 $this->currPos++;
4136 $r6 = "\\";
4137 goto choice_1;
4138 } else {
4139 if (!$silence) {$this->fail(31);}
4140 $r6 = self::$FAILED;
4141 }
4142 $p7 = $this->currPos;
4143 $r6 = self::$FAILED;
4144 for (;;) {
4145 if (strcspn($this->input, "`\$\\", $this->currPos, 1) !== 0) {
4146 $r8 = self::consumeChar($this->input, $this->currPos);
4147 $r6 = true;
4148 } else {
4149 $r8 = self::$FAILED;
4150 if (!$silence) {$this->fail(35);}
4151 break;
4152 }
4153 }
4154 if ($r6!==self::$FAILED) {
4155 $r6 = substr($this->input, $p7, $this->currPos - $p7);
4156 } else {
4157 $r6 = self::$FAILED;
4158 }
4159 // free $r8
4160 // free $p7
4161 choice_1:
4162 if ($r6!==self::$FAILED) {
4163 $r5[] = $r6;
4164 } else {
4165 break;
4166 }
4167 }
4168 // parts <- $r5
4169 // free $r6
4170 if (($this->input[$this->currPos] ?? null) === "`") {
4171 $this->currPos++;
4172 $r6 = "`";
4173 } else {
4174 if (!$silence) {$this->fail(33);}
4175 $r6 = self::$FAILED;
4176 $this->currPos = $p3;
4177 $r1 = self::$FAILED;
4178 goto seq_1;
4179 }
4180 $r1 = true;
4181 seq_1:
4182 if ($r1!==self::$FAILED) {
4183 $this->savedPos = $p2;
4184 $r1 = $this->a53($r5);
4185 }
4186 // free $p3
4187 $this->cache[$key] = new PEGParserCacheEntry(
4188 $this->currPos,
4189 $r1
4190
4191 );
4192 return $r1;
4193 }
4194 private function parsedollar_expansion($silence, $boolParams) {
4195 $key = json_encode([174,$this->currPos,$boolParams & 0x1]);
4196 $cached = $this->cache[$key] ?? null;
4197 if ($cached) {
4198 $this->currPos = $cached->nextPos;
4199
4200 return $cached->result;
4201 }
4202
4203 $p2 = $this->currPos;
4204 // start seq_1
4205 $p3 = $this->currPos;
4206 if (($this->input[$this->currPos] ?? null) === "\$") {
4207 $this->currPos++;
4208 $r4 = "\$";
4209 } else {
4210 if (!$silence) {$this->fail(34);}
4211 $r4 = self::$FAILED;
4212 $r1 = self::$FAILED;
4213 goto seq_1;
4214 }
4215 // start choice_1
4216 $r5 = $this->parsespecial_parameter($silence);
4217 if ($r5!==self::$FAILED) {
4218 goto choice_1;
4219 }
4220 $r5 = $this->parseshort_positional_parameter($silence);
4221 if ($r5!==self::$FAILED) {
4222 goto choice_1;
4223 }
4224 $r5 = $this->parsebrace_expansion($silence);
4225 if ($r5!==self::$FAILED) {
4226 goto choice_1;
4227 }
4228 $r5 = $this->parsearithmetic_expansion($silence, $boolParams);
4229 if ($r5!==self::$FAILED) {
4230 goto choice_1;
4231 }
4232 $r5 = $this->parsecommand_expansion($silence, $boolParams);
4233 if ($r5!==self::$FAILED) {
4234 goto choice_1;
4235 }
4236 $r5 = $this->parsenamed_parameter($silence);
4237 choice_1:
4238 // contents <- $r5
4239 if ($r5===self::$FAILED) {
4240 $this->currPos = $p3;
4241 $r1 = self::$FAILED;
4242 goto seq_1;
4243 }
4244 $r1 = true;
4245 seq_1:
4246 if ($r1!==self::$FAILED) {
4247 $this->savedPos = $p2;
4248 $r1 = $this->a54($r5);
4249 }
4250 // free $p3
4251 $this->cache[$key] = new PEGParserCacheEntry(
4252 $this->currPos,
4253 $r1
4254
4255 );
4256 return $r1;
4257 }
4258 private function parseplain_part($silence, $boolParams) {
4259 $key = json_encode([198,$this->currPos,$boolParams & 0x1]);
4260 $cached = $this->cache[$key] ?? null;
4261 if ($cached) {
4262 $this->currPos = $cached->nextPos;
4263
4264 return $cached->result;
4265 }
4266
4267 $p2 = $this->currPos;
4268 // start choice_1
4269 $p4 = $this->currPos;
4270 // start seq_1
4271 $p5 = $this->currPos;
4272 if (/*no_rbrace*/($boolParams & 0x1) !== 0) {
4273 $r6 = false;
4274 } else {
4275 $r6 = self::$FAILED;
4276 $r3 = self::$FAILED;
4277 goto seq_1;
4278 }
4279 $r7 = self::$FAILED;
4280 for (;;) {
4281 if (strcspn($this->input, "'\"\\`\$ \x09\x0b\x0d\x0c\x0a&|;<>(){}", $this->currPos, 1) !== 0) {
4282 $r8 = self::consumeChar($this->input, $this->currPos);
4283 $r7 = true;
4284 } else {
4285 $r8 = self::$FAILED;
4286 if (!$silence) {$this->fail(36);}
4287 break;
4288 }
4289 }
4290 if ($r7===self::$FAILED) {
4291 $this->currPos = $p5;
4292 $r3 = self::$FAILED;
4293 goto seq_1;
4294 }
4295 // free $r8
4296 $r3 = true;
4297 seq_1:
4298 if ($r3!==self::$FAILED) {
4299 $r3 = substr($this->input, $p4, $this->currPos - $p4);
4300 goto choice_1;
4301 } else {
4302 $r3 = self::$FAILED;
4303 }
4304 // free $p5
4305 // free $p4
4306 $p4 = $this->currPos;
4307 // start seq_2
4308 $p5 = $this->currPos;
4309 if (!(/*no_rbrace*/($boolParams & 0x1) !== 0)) {
4310 $r8 = false;
4311 } else {
4312 $r8 = self::$FAILED;
4313 $r3 = self::$FAILED;
4314 goto seq_2;
4315 }
4316 $r9 = self::$FAILED;
4317 for (;;) {
4318 if (strcspn($this->input, "'\"\\`\$ \x09\x0b\x0d\x0c\x0a&|;<>()", $this->currPos, 1) !== 0) {
4319 $r10 = self::consumeChar($this->input, $this->currPos);
4320 $r9 = true;
4321 } else {
4322 $r10 = self::$FAILED;
4323 if (!$silence) {$this->fail(37);}
4324 break;
4325 }
4326 }
4327 if ($r9===self::$FAILED) {
4328 $this->currPos = $p5;
4329 $r3 = self::$FAILED;
4330 goto seq_2;
4331 }
4332 // free $r10
4333 $r3 = true;
4334 seq_2:
4335 if ($r3!==self::$FAILED) {
4336 $r3 = substr($this->input, $p4, $this->currPos - $p4);
4337 } else {
4338 $r3 = self::$FAILED;
4339 }
4340 // free $p5
4341 // free $p4
4342 choice_1:
4343 // plain <- $r3
4344 $r1 = $r3;
4345 if ($r1!==self::$FAILED) {
4346 $this->savedPos = $p2;
4347 $r1 = $this->a55($r3);
4348 }
4349 $this->cache[$key] = new PEGParserCacheEntry(
4350 $this->currPos,
4351 $r1
4352
4353 );
4354 return $r1;
4355 }
4356 private function discardElse($silence) {
4357 $key = json_encode([109,$this->currPos]);
4358 $cached = $this->cache[$key] ?? null;
4359 if ($cached) {
4360 $this->currPos = $cached->nextPos;
4361
4362 return $cached->result;
4363 }
4364
4365 // start seq_1
4366 $p1 = $this->currPos;
4367 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "else", $this->currPos, 4, false) === 0) {
4368 $r3 = "else";
4369 $this->currPos += 4;
4370 } else {
4371 if (!$silence) {$this->fail(38);}
4372 $r3 = self::$FAILED;
4373 $r2 = self::$FAILED;
4374 goto seq_1;
4375 }
4376 $r4 = $this->discardDELIM($silence);
4377 if ($r4===self::$FAILED) {
4378 $this->currPos = $p1;
4379 $r2 = self::$FAILED;
4380 goto seq_1;
4381 }
4382 $r2 = true;
4383 seq_1:
4384 // free $r2,$p1
4385 $this->cache[$key] = new PEGParserCacheEntry(
4386 $this->currPos,
4387 $r2
4388
4389 );
4390 return $r2;
4391 }
4392 private function discardElif($silence) {
4393 $key = json_encode([111,$this->currPos]);
4394 $cached = $this->cache[$key] ?? null;
4395 if ($cached) {
4396 $this->currPos = $cached->nextPos;
4397
4398 return $cached->result;
4399 }
4400
4401 // start seq_1
4402 $p1 = $this->currPos;
4403 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "elif", $this->currPos, 4, false) === 0) {
4404 $r3 = "elif";
4405 $this->currPos += 4;
4406 } else {
4407 if (!$silence) {$this->fail(39);}
4408 $r3 = self::$FAILED;
4409 $r2 = self::$FAILED;
4410 goto seq_1;
4411 }
4412 $r4 = $this->discardDELIM($silence);
4413 if ($r4===self::$FAILED) {
4414 $this->currPos = $p1;
4415 $r2 = self::$FAILED;
4416 goto seq_1;
4417 }
4418 $r2 = true;
4419 seq_1:
4420 // free $r2,$p1
4421 $this->cache[$key] = new PEGParserCacheEntry(
4422 $this->currPos,
4423 $r2
4424
4425 );
4426 return $r2;
4427 }
4428 private function discardDo($silence) {
4429 $key = json_encode([115,$this->currPos]);
4430 $cached = $this->cache[$key] ?? null;
4431 if ($cached) {
4432 $this->currPos = $cached->nextPos;
4433
4434 return $cached->result;
4435 }
4436
4437 // start seq_1
4438 $p1 = $this->currPos;
4439 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "do", $this->currPos, 2, false) === 0) {
4440 $r3 = "do";
4441 $this->currPos += 2;
4442 } else {
4443 if (!$silence) {$this->fail(40);}
4444 $r3 = self::$FAILED;
4445 $r2 = self::$FAILED;
4446 goto seq_1;
4447 }
4448 $r4 = $this->discardDELIM($silence);
4449 if ($r4===self::$FAILED) {
4450 $this->currPos = $p1;
4451 $r2 = self::$FAILED;
4452 goto seq_1;
4453 }
4454 $r2 = true;
4455 seq_1:
4456 // free $r2,$p1
4457 $this->cache[$key] = new PEGParserCacheEntry(
4458 $this->currPos,
4459 $r2
4460
4461 );
4462 return $r2;
4463 }
4464 private function discardDone($silence) {
4465 $key = json_encode([117,$this->currPos]);
4466 $cached = $this->cache[$key] ?? null;
4467 if ($cached) {
4468 $this->currPos = $cached->nextPos;
4469
4470 return $cached->result;
4471 }
4472
4473 // start seq_1
4474 $p1 = $this->currPos;
4475 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "done", $this->currPos, 4, false) === 0) {
4476 $r3 = "done";
4477 $this->currPos += 4;
4478 } else {
4479 if (!$silence) {$this->fail(41);}
4480 $r3 = self::$FAILED;
4481 $r2 = self::$FAILED;
4482 goto seq_1;
4483 }
4484 $r4 = $this->discardDELIM($silence);
4485 if ($r4===self::$FAILED) {
4486 $this->currPos = $p1;
4487 $r2 = self::$FAILED;
4488 goto seq_1;
4489 }
4490 $r2 = true;
4491 seq_1:
4492 // free $r2,$p1
4493 $this->cache[$key] = new PEGParserCacheEntry(
4494 $this->currPos,
4495 $r2
4496
4497 );
4498 return $r2;
4499 }
4500 private function discardBang($silence) {
4501 $key = json_encode([133,$this->currPos]);
4502 $cached = $this->cache[$key] ?? null;
4503 if ($cached) {
4504 $this->currPos = $cached->nextPos;
4505
4506 return $cached->result;
4507 }
4508
4509 // start seq_1
4510 $p1 = $this->currPos;
4511 if (($this->input[$this->currPos] ?? null) === "!") {
4512 $this->currPos++;
4513 $r3 = "!";
4514 } else {
4515 if (!$silence) {$this->fail(9);}
4516 $r3 = self::$FAILED;
4517 $r2 = self::$FAILED;
4518 goto seq_1;
4519 }
4520 $r4 = $this->discardDELIM($silence);
4521 if ($r4===self::$FAILED) {
4522 $this->currPos = $p1;
4523 $r2 = self::$FAILED;
4524 goto seq_1;
4525 }
4526 $r2 = true;
4527 seq_1:
4528 // free $r2,$p1
4529 $this->cache[$key] = new PEGParserCacheEntry(
4530 $this->currPos,
4531 $r2
4532
4533 );
4534 return $r2;
4535 }
4536 private function discardIn($silence) {
4537 $key = json_encode([135,$this->currPos]);
4538 $cached = $this->cache[$key] ?? null;
4539 if ($cached) {
4540 $this->currPos = $cached->nextPos;
4541
4542 return $cached->result;
4543 }
4544
4545 // start seq_1
4546 $p1 = $this->currPos;
4547 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "in", $this->currPos, 2, false) === 0) {
4548 $r3 = "in";
4549 $this->currPos += 2;
4550 } else {
4551 if (!$silence) {$this->fail(42);}
4552 $r3 = self::$FAILED;
4553 $r2 = self::$FAILED;
4554 goto seq_1;
4555 }
4556 $r4 = $this->discardDELIM($silence);
4557 if ($r4===self::$FAILED) {
4558 $this->currPos = $p1;
4559 $r2 = self::$FAILED;
4560 goto seq_1;
4561 }
4562 $r2 = true;
4563 seq_1:
4564 // free $r2,$p1
4565 $this->cache[$key] = new PEGParserCacheEntry(
4566 $this->currPos,
4567 $r2
4568
4569 );
4570 return $r2;
4571 }
4572 private function discardDELIM($silence) {
4573 $key = json_encode([155,$this->currPos]);
4574 $cached = $this->cache[$key] ?? null;
4575 if ($cached) {
4576 $this->currPos = $cached->nextPos;
4577
4578 return $cached->result;
4579 }
4580
4581 // start choice_1
4582 $r1 = self::$FAILED;
4583 for (;;) {
4584 if (strspn($this->input, " \x09\x0b\x0d\x0c", $this->currPos, 1) !== 0) {
4585 $r2 = $this->input[$this->currPos++];
4586 $r1 = true;
4587 } else {
4588 $r2 = self::$FAILED;
4589 if (!$silence) {$this->fail(2);}
4590 break;
4591 }
4592 }
4593 if ($r1!==self::$FAILED) {
4594 goto choice_1;
4595 }
4596 // free $r2
4597 $p3 = $this->currPos;
4598 if ($this->currPos < $this->inputLength) {
4599 $r1 = self::consumeChar($this->input, $this->currPos);;
4600 } else {
4601 $r1 = self::$FAILED;
4602 }
4603 if ($r1 === self::$FAILED) {
4604 $r1 = false;
4605 goto choice_1;
4606 } else {
4607 $r1 = self::$FAILED;
4608 $this->currPos = $p3;
4609 }
4610 // free $p3
4611 $p3 = $this->currPos;
4612 if (($this->input[$this->currPos] ?? null) === "\x0a") {
4613 $this->currPos++;
4614 $r1 = "\x0a";
4615 $r1 = false;
4616 $this->currPos = $p3;
4617 } else {
4618 $r1 = self::$FAILED;
4619 }
4620 // free $p3
4621 choice_1:
4622 $this->cache[$key] = new PEGParserCacheEntry(
4623 $this->currPos,
4624 $r1
4625
4626 );
4627 return $r1;
4628 }
4629 private function discardseparator($silence) {
4630 $key = json_encode([81,$this->currPos]);
4631 $cached = $this->cache[$key] ?? null;
4632 if ($cached) {
4633 $this->currPos = $cached->nextPos;
4634
4635 return $cached->result;
4636 }
4637
4638 // start choice_1
4639 // start seq_1
4640 $p2 = $this->currPos;
4641 $r3 = $this->discardseparator_op($silence);
4642 if ($r3===self::$FAILED) {
4643 $r1 = self::$FAILED;
4644 goto seq_1;
4645 }
4646 $r4 = $this->discardlinebreak($silence);
4647 if ($r4===self::$FAILED) {
4648 $this->currPos = $p2;
4649 $r1 = self::$FAILED;
4650 goto seq_1;
4651 }
4652 $r1 = true;
4653 seq_1:
4654 if ($r1!==self::$FAILED) {
4655 goto choice_1;
4656 }
4657 // free $p2
4658 $r1 = $this->discardnewline_list($silence);
4659 choice_1:
4660 $this->cache[$key] = new PEGParserCacheEntry(
4661 $this->currPos,
4662 $r1
4663
4664 );
4665 return $r1;
4666 }
4667 private function parsecase_item($silence, $boolParams) {
4668 $key = json_encode([36,$this->currPos,$boolParams & 0x1]);
4669 $cached = $this->cache[$key] ?? null;
4670 if ($cached) {
4671 $this->currPos = $cached->nextPos;
4672
4673 return $cached->result;
4674 }
4675
4676 // start choice_1
4677 $p2 = $this->currPos;
4678 // start seq_1
4679 $p3 = $this->currPos;
4680 $r4 = $this->discardLPAREN($silence);
4681 if ($r4===self::$FAILED) {
4682 $r4 = null;
4683 }
4684 $r5 = $this->parsepattern($silence, $boolParams);
4685 // pattern <- $r5
4686 if ($r5===self::$FAILED) {
4687 $this->currPos = $p3;
4688 $r1 = self::$FAILED;
4689 goto seq_1;
4690 }
4691 $r6 = $this->discardRPAREN($silence);
4692 if ($r6===self::$FAILED) {
4693 $this->currPos = $p3;
4694 $r1 = self::$FAILED;
4695 goto seq_1;
4696 }
4697 $r7 = $this->parsecompound_list($silence, $boolParams);
4698 // list <- $r7
4699 if ($r7===self::$FAILED) {
4700 $this->currPos = $p3;
4701 $r1 = self::$FAILED;
4702 goto seq_1;
4703 }
4704 $r8 = $this->discardDSEMI($silence);
4705 if ($r8===self::$FAILED) {
4706 $this->currPos = $p3;
4707 $r1 = self::$FAILED;
4708 goto seq_1;
4709 }
4710 $r9 = $this->discardlinebreak($silence);
4711 if ($r9===self::$FAILED) {
4712 $this->currPos = $p3;
4713 $r1 = self::$FAILED;
4714 goto seq_1;
4715 }
4716 $r1 = true;
4717 seq_1:
4718 if ($r1!==self::$FAILED) {
4719 $this->savedPos = $p2;
4720 $r1 = $this->a56($r5, $r7);
4721 goto choice_1;
4722 }
4723 // free $p3
4724 $p3 = $this->currPos;
4725 // start seq_2
4726 $p10 = $this->currPos;
4727 $r11 = $this->discardLPAREN($silence);
4728 if ($r11===self::$FAILED) {
4729 $r11 = null;
4730 }
4731 $r12 = $this->parsepattern($silence, $boolParams);
4732 // pattern <- $r12
4733 if ($r12===self::$FAILED) {
4734 $this->currPos = $p10;
4735 $r1 = self::$FAILED;
4736 goto seq_2;
4737 }
4738 $r13 = $this->discardRPAREN($silence);
4739 if ($r13===self::$FAILED) {
4740 $this->currPos = $p10;
4741 $r1 = self::$FAILED;
4742 goto seq_2;
4743 }
4744 $r14 = $this->discardlinebreak($silence);
4745 if ($r14===self::$FAILED) {
4746 $this->currPos = $p10;
4747 $r1 = self::$FAILED;
4748 goto seq_2;
4749 }
4750 $r15 = $this->discardDSEMI($silence);
4751 if ($r15===self::$FAILED) {
4752 $this->currPos = $p10;
4753 $r1 = self::$FAILED;
4754 goto seq_2;
4755 }
4756 $r16 = $this->discardlinebreak($silence);
4757 if ($r16===self::$FAILED) {
4758 $this->currPos = $p10;
4759 $r1 = self::$FAILED;
4760 goto seq_2;
4761 }
4762 $r1 = true;
4763 seq_2:
4764 if ($r1!==self::$FAILED) {
4765 $this->savedPos = $p3;
4766 $r1 = $this->a57($r12);
4767 }
4768 // free $p10
4769 choice_1:
4770 $this->cache[$key] = new PEGParserCacheEntry(
4771 $this->currPos,
4772 $r1
4773
4774 );
4775 return $r1;
4776 }
4777 private function parsecase_item_ns($silence, $boolParams) {
4778 $key = json_encode([34,$this->currPos,$boolParams & 0x1]);
4779 $cached = $this->cache[$key] ?? null;
4780 if ($cached) {
4781 $this->currPos = $cached->nextPos;
4782
4783 return $cached->result;
4784 }
4785
4786 // start choice_1
4787 $p2 = $this->currPos;
4788 // start seq_1
4789 $p3 = $this->currPos;
4790 $r4 = $this->discardLPAREN($silence);
4791 if ($r4===self::$FAILED) {
4792 $r4 = null;
4793 }
4794 $r5 = $this->parsepattern($silence, $boolParams);
4795 // pattern <- $r5
4796 if ($r5===self::$FAILED) {
4797 $this->currPos = $p3;
4798 $r1 = self::$FAILED;
4799 goto seq_1;
4800 }
4801 $r6 = $this->discardRPAREN($silence);
4802 if ($r6===self::$FAILED) {
4803 $this->currPos = $p3;
4804 $r1 = self::$FAILED;
4805 goto seq_1;
4806 }
4807 $r7 = $this->parsecompound_list($silence, $boolParams);
4808 // list <- $r7
4809 if ($r7===self::$FAILED) {
4810 $this->currPos = $p3;
4811 $r1 = self::$FAILED;
4812 goto seq_1;
4813 }
4814 $r1 = true;
4815 seq_1:
4816 if ($r1!==self::$FAILED) {
4817 $this->savedPos = $p2;
4818 $r1 = $this->a56($r5, $r7);
4819 goto choice_1;
4820 }
4821 // free $p3
4822 $p3 = $this->currPos;
4823 // start seq_2
4824 $p8 = $this->currPos;
4825 $r9 = $this->discardLPAREN($silence);
4826 if ($r9===self::$FAILED) {
4827 $r9 = null;
4828 }
4829 $r10 = $this->parsepattern($silence, $boolParams);
4830 // pattern <- $r10
4831 if ($r10===self::$FAILED) {
4832 $this->currPos = $p8;
4833 $r1 = self::$FAILED;
4834 goto seq_2;
4835 }
4836 $r11 = $this->discardRPAREN($silence);
4837 if ($r11===self::$FAILED) {
4838 $this->currPos = $p8;
4839 $r1 = self::$FAILED;
4840 goto seq_2;
4841 }
4842 $r12 = $this->discardlinebreak($silence);
4843 if ($r12===self::$FAILED) {
4844 $this->currPos = $p8;
4845 $r1 = self::$FAILED;
4846 goto seq_2;
4847 }
4848 $r1 = true;
4849 seq_2:
4850 if ($r1!==self::$FAILED) {
4851 $this->savedPos = $p3;
4852 $r1 = $this->a58($r10);
4853 }
4854 // free $p8
4855 choice_1:
4856 $this->cache[$key] = new PEGParserCacheEntry(
4857 $this->currPos,
4858 $r1
4859
4860 );
4861 return $r1;
4862 }
4863 private function discardLESSAND($silence) {
4864 $key = json_encode([95,$this->currPos]);
4865 $cached = $this->cache[$key] ?? null;
4866 if ($cached) {
4867 $this->currPos = $cached->nextPos;
4868
4869 return $cached->result;
4870 }
4871
4872 // start seq_1
4873 $p1 = $this->currPos;
4874 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "<&", $this->currPos, 2, false) === 0) {
4875 $r3 = "<&";
4876 $this->currPos += 2;
4877 } else {
4878 if (!$silence) {$this->fail(43);}
4879 $r3 = self::$FAILED;
4880 $r2 = self::$FAILED;
4881 goto seq_1;
4882 }
4883 $r4 = $this->discardOWS($silence);
4884 if ($r4===self::$FAILED) {
4885 $this->currPos = $p1;
4886 $r2 = self::$FAILED;
4887 goto seq_1;
4888 }
4889 $r2 = true;
4890 seq_1:
4891 // free $r2,$p1
4892 $this->cache[$key] = new PEGParserCacheEntry(
4893 $this->currPos,
4894 $r2
4895
4896 );
4897 return $r2;
4898 }
4899 private function discardLESSGREAT($silence) {
4900 $key = json_encode([99,$this->currPos]);
4901 $cached = $this->cache[$key] ?? null;
4902 if ($cached) {
4903 $this->currPos = $cached->nextPos;
4904
4905 return $cached->result;
4906 }
4907
4908 // start seq_1
4909 $p1 = $this->currPos;
4910 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "<>", $this->currPos, 2, false) === 0) {
4911 $r3 = "<>";
4912 $this->currPos += 2;
4913 } else {
4914 if (!$silence) {$this->fail(44);}
4915 $r3 = self::$FAILED;
4916 $r2 = self::$FAILED;
4917 goto seq_1;
4918 }
4919 $r4 = $this->discardOWS($silence);
4920 if ($r4===self::$FAILED) {
4921 $this->currPos = $p1;
4922 $r2 = self::$FAILED;
4923 goto seq_1;
4924 }
4925 $r2 = true;
4926 seq_1:
4927 // free $r2,$p1
4928 $this->cache[$key] = new PEGParserCacheEntry(
4929 $this->currPos,
4930 $r2
4931
4932 );
4933 return $r2;
4934 }
4935 private function discardLESS($silence) {
4936 $key = json_encode([143,$this->currPos]);
4937 $cached = $this->cache[$key] ?? null;
4938 if ($cached) {
4939 $this->currPos = $cached->nextPos;
4940
4941 return $cached->result;
4942 }
4943
4944 // start seq_1
4945 $p1 = $this->currPos;
4946 $p3 = $this->currPos;
4947 $r4 = $this->discardDLESS(true);
4948 if ($r4 === self::$FAILED) {
4949 $r4 = false;
4950 } else {
4951 $r4 = self::$FAILED;
4952 $this->currPos = $p3;
4953 $r2 = self::$FAILED;
4954 goto seq_1;
4955 }
4956 // free $p3
4957 $p3 = $this->currPos;
4958 $r5 = $this->discardLESSAND(true);
4959 if ($r5 === self::$FAILED) {
4960 $r5 = false;
4961 } else {
4962 $r5 = self::$FAILED;
4963 $this->currPos = $p3;
4964 $this->currPos = $p1;
4965 $r2 = self::$FAILED;
4966 goto seq_1;
4967 }
4968 // free $p3
4969 $p3 = $this->currPos;
4970 $r6 = $this->discardLESSGREAT(true);
4971 if ($r6 === self::$FAILED) {
4972 $r6 = false;
4973 } else {
4974 $r6 = self::$FAILED;
4975 $this->currPos = $p3;
4976 $this->currPos = $p1;
4977 $r2 = self::$FAILED;
4978 goto seq_1;
4979 }
4980 // free $p3
4981 $p3 = $this->currPos;
4982 $r7 = $this->discardDLESSDASH(true);
4983 if ($r7 === self::$FAILED) {
4984 $r7 = false;
4985 } else {
4986 $r7 = self::$FAILED;
4987 $this->currPos = $p3;
4988 $this->currPos = $p1;
4989 $r2 = self::$FAILED;
4990 goto seq_1;
4991 }
4992 // free $p3
4993 if (($this->input[$this->currPos] ?? null) === "<") {
4994 $this->currPos++;
4995 $r8 = "<";
4996 } else {
4997 if (!$silence) {$this->fail(45);}
4998 $r8 = self::$FAILED;
4999 $this->currPos = $p1;
5000 $r2 = self::$FAILED;
5001 goto seq_1;
5002 }
5003 $r9 = $this->discardOWS($silence);
5004 if ($r9===self::$FAILED) {
5005 $this->currPos = $p1;
5006 $r2 = self::$FAILED;
5007 goto seq_1;
5008 }
5009 $r2 = true;
5010 seq_1:
5011 // free $r2,$p1
5012 $this->cache[$key] = new PEGParserCacheEntry(
5013 $this->currPos,
5014 $r2
5015
5016 );
5017 return $r2;
5018 }
5019 private function discardGREATAND($silence) {
5020 $key = json_encode([97,$this->currPos]);
5021 $cached = $this->cache[$key] ?? null;
5022 if ($cached) {
5023 $this->currPos = $cached->nextPos;
5024
5025 return $cached->result;
5026 }
5027
5028 // start seq_1
5029 $p1 = $this->currPos;
5030 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, ">&", $this->currPos, 2, false) === 0) {
5031 $r3 = ">&";
5032 $this->currPos += 2;
5033 } else {
5034 if (!$silence) {$this->fail(46);}
5035 $r3 = self::$FAILED;
5036 $r2 = self::$FAILED;
5037 goto seq_1;
5038 }
5039 $r4 = $this->discardOWS($silence);
5040 if ($r4===self::$FAILED) {
5041 $this->currPos = $p1;
5042 $r2 = self::$FAILED;
5043 goto seq_1;
5044 }
5045 $r2 = true;
5046 seq_1:
5047 // free $r2,$p1
5048 $this->cache[$key] = new PEGParserCacheEntry(
5049 $this->currPos,
5050 $r2
5051
5052 );
5053 return $r2;
5054 }
5055 private function discardDGREAT($silence) {
5056 $key = json_encode([93,$this->currPos]);
5057 $cached = $this->cache[$key] ?? null;
5058 if ($cached) {
5059 $this->currPos = $cached->nextPos;
5060
5061 return $cached->result;
5062 }
5063
5064 // start seq_1
5065 $p1 = $this->currPos;
5066 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, ">>", $this->currPos, 2, false) === 0) {
5067 $r3 = ">>";
5068 $this->currPos += 2;
5069 } else {
5070 if (!$silence) {$this->fail(47);}
5071 $r3 = self::$FAILED;
5072 $r2 = self::$FAILED;
5073 goto seq_1;
5074 }
5075 $r4 = $this->discardOWS($silence);
5076 if ($r4===self::$FAILED) {
5077 $this->currPos = $p1;
5078 $r2 = self::$FAILED;
5079 goto seq_1;
5080 }
5081 $r2 = true;
5082 seq_1:
5083 // free $r2,$p1
5084 $this->cache[$key] = new PEGParserCacheEntry(
5085 $this->currPos,
5086 $r2
5087
5088 );
5089 return $r2;
5090 }
5091 private function discardCLOBBER($silence) {
5092 $key = json_encode([103,$this->currPos]);
5093 $cached = $this->cache[$key] ?? null;
5094 if ($cached) {
5095 $this->currPos = $cached->nextPos;
5096
5097 return $cached->result;
5098 }
5099
5100 // start seq_1
5101 $p1 = $this->currPos;
5102 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, ">|", $this->currPos, 2, false) === 0) {
5103 $r3 = ">|";
5104 $this->currPos += 2;
5105 } else {
5106 if (!$silence) {$this->fail(48);}
5107 $r3 = self::$FAILED;
5108 $r2 = self::$FAILED;
5109 goto seq_1;
5110 }
5111 $r4 = $this->discardOWS($silence);
5112 if ($r4===self::$FAILED) {
5113 $this->currPos = $p1;
5114 $r2 = self::$FAILED;
5115 goto seq_1;
5116 }
5117 $r2 = true;
5118 seq_1:
5119 // free $r2,$p1
5120 $this->cache[$key] = new PEGParserCacheEntry(
5121 $this->currPos,
5122 $r2
5123
5124 );
5125 return $r2;
5126 }
5127 private function discardGREAT($silence) {
5128 $key = json_encode([145,$this->currPos]);
5129 $cached = $this->cache[$key] ?? null;
5130 if ($cached) {
5131 $this->currPos = $cached->nextPos;
5132
5133 return $cached->result;
5134 }
5135
5136 // start seq_1
5137 $p1 = $this->currPos;
5138 $p3 = $this->currPos;
5139 $r4 = $this->discardDGREAT(true);
5140 if ($r4 === self::$FAILED) {
5141 $r4 = false;
5142 } else {
5143 $r4 = self::$FAILED;
5144 $this->currPos = $p3;
5145 $r2 = self::$FAILED;
5146 goto seq_1;
5147 }
5148 // free $p3
5149 $p3 = $this->currPos;
5150 $r5 = $this->discardGREATAND(true);
5151 if ($r5 === self::$FAILED) {
5152 $r5 = false;
5153 } else {
5154 $r5 = self::$FAILED;
5155 $this->currPos = $p3;
5156 $this->currPos = $p1;
5157 $r2 = self::$FAILED;
5158 goto seq_1;
5159 }
5160 // free $p3
5161 $p3 = $this->currPos;
5162 $r6 = $this->discardCLOBBER(true);
5163 if ($r6 === self::$FAILED) {
5164 $r6 = false;
5165 } else {
5166 $r6 = self::$FAILED;
5167 $this->currPos = $p3;
5168 $this->currPos = $p1;
5169 $r2 = self::$FAILED;
5170 goto seq_1;
5171 }
5172 // free $p3
5173 if (($this->input[$this->currPos] ?? null) === ">") {
5174 $this->currPos++;
5175 $r7 = ">";
5176 } else {
5177 if (!$silence) {$this->fail(49);}
5178 $r7 = self::$FAILED;
5179 $this->currPos = $p1;
5180 $r2 = self::$FAILED;
5181 goto seq_1;
5182 }
5183 $r8 = $this->discardOWS($silence);
5184 if ($r8===self::$FAILED) {
5185 $this->currPos = $p1;
5186 $r2 = self::$FAILED;
5187 goto seq_1;
5188 }
5189 $r2 = true;
5190 seq_1:
5191 // free $r2,$p1
5192 $this->cache[$key] = new PEGParserCacheEntry(
5193 $this->currPos,
5194 $r2
5195
5196 );
5197 return $r2;
5198 }
5199 private function discardDLESSDASH($silence) {
5200 $key = json_encode([101,$this->currPos]);
5201 $cached = $this->cache[$key] ?? null;
5202 if ($cached) {
5203 $this->currPos = $cached->nextPos;
5204
5205 return $cached->result;
5206 }
5207
5208 // start seq_1
5209 $p1 = $this->currPos;
5210 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "<<-", $this->currPos, 3, false) === 0) {
5211 $r3 = "<<-";
5212 $this->currPos += 3;
5213 } else {
5214 if (!$silence) {$this->fail(50);}
5215 $r3 = self::$FAILED;
5216 $r2 = self::$FAILED;
5217 goto seq_1;
5218 }
5219 $r4 = $this->discardOWS($silence);
5220 if ($r4===self::$FAILED) {
5221 $this->currPos = $p1;
5222 $r2 = self::$FAILED;
5223 goto seq_1;
5224 }
5225 $r2 = true;
5226 seq_1:
5227 // free $r2,$p1
5228 $this->cache[$key] = new PEGParserCacheEntry(
5229 $this->currPos,
5230 $r2
5231
5232 );
5233 return $r2;
5234 }
5235 private function discardDLESS($silence) {
5236 $key = json_encode([91,$this->currPos]);
5237 $cached = $this->cache[$key] ?? null;
5238 if ($cached) {
5239 $this->currPos = $cached->nextPos;
5240
5241 return $cached->result;
5242 }
5243
5244 // start seq_1
5245 $p1 = $this->currPos;
5246 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "<<", $this->currPos, 2, false) === 0) {
5247 $r3 = "<<";
5248 $this->currPos += 2;
5249 } else {
5250 if (!$silence) {$this->fail(51);}
5251 $r3 = self::$FAILED;
5252 $r2 = self::$FAILED;
5253 goto seq_1;
5254 }
5255 $r4 = $this->discardOWS($silence);
5256 if ($r4===self::$FAILED) {
5257 $this->currPos = $p1;
5258 $r2 = self::$FAILED;
5259 goto seq_1;
5260 }
5261 $r2 = true;
5262 seq_1:
5263 // free $r2,$p1
5264 $this->cache[$key] = new PEGParserCacheEntry(
5265 $this->currPos,
5266 $r2
5267
5268 );
5269 return $r2;
5270 }
5271 private function parsehere_end($silence, $boolParams) {
5272 $key = json_encode([72,$this->currPos,$boolParams & 0x1]);
5273 $cached = $this->cache[$key] ?? null;
5274 if ($cached) {
5275 $this->currPos = $cached->nextPos;
5276
5277 return $cached->result;
5278 }
5279
5280 $p1 = $this->currPos;
5281 $r2 = $this->discardWORD($silence, $boolParams);
5282 if ($r2!==self::$FAILED) {
5283 $r2 = substr($this->input, $p1, $this->currPos - $p1);
5284 } else {
5285 $r2 = self::$FAILED;
5286 }
5287 // free $p1
5288 $this->cache[$key] = new PEGParserCacheEntry(
5289 $this->currPos,
5290 $r2
5291
5292 );
5293 return $r2;
5294 }
5295 private function parsedquoted_escape($silence) {
5296 $key = json_encode([164,$this->currPos]);
5297 $cached = $this->cache[$key] ?? null;
5298 if ($cached) {
5299 $this->currPos = $cached->nextPos;
5300
5301 return $cached->result;
5302 }
5303
5304 $p2 = $this->currPos;
5305 // start seq_1
5306 $p3 = $this->currPos;
5307 if (($this->input[$this->currPos] ?? null) === "\\") {
5308 $this->currPos++;
5309 $r4 = "\\";
5310 } else {
5311 if (!$silence) {$this->fail(31);}
5312 $r4 = self::$FAILED;
5313 $r1 = self::$FAILED;
5314 goto seq_1;
5315 }
5316 // contents <- $r5
5317 if (strspn($this->input, "\$`\"\\\x0a", $this->currPos, 1) !== 0) {
5318 $r5 = $this->input[$this->currPos++];
5319 } else {
5320 $r5 = self::$FAILED;
5321 if (!$silence) {$this->fail(52);}
5322 $this->currPos = $p3;
5323 $r1 = self::$FAILED;
5324 goto seq_1;
5325 }
5326 $r1 = true;
5327 seq_1:
5328 if ($r1!==self::$FAILED) {
5329 $this->savedPos = $p2;
5330 $r1 = $this->a59($r5);
5331 }
5332 // free $p3
5333 $this->cache[$key] = new PEGParserCacheEntry(
5334 $this->currPos,
5335 $r1
5336
5337 );
5338 return $r1;
5339 }
5340 private function parsebackquoted_escape($silence) {
5341 $key = json_encode([170,$this->currPos]);
5342 $cached = $this->cache[$key] ?? null;
5343 if ($cached) {
5344 $this->currPos = $cached->nextPos;
5345
5346 return $cached->result;
5347 }
5348
5349 $p2 = $this->currPos;
5350 // start seq_1
5351 $p3 = $this->currPos;
5352 if (($this->input[$this->currPos] ?? null) === "\\") {
5353 $this->currPos++;
5354 $r4 = "\\";
5355 } else {
5356 if (!$silence) {$this->fail(31);}
5357 $r4 = self::$FAILED;
5358 $r1 = self::$FAILED;
5359 goto seq_1;
5360 }
5361 $r5 = $this->input[$this->currPos] ?? '';
5362 // contents <- $r5
5363 if ($r5 === "\$" || $r5 === "\\") {
5364 $this->currPos++;
5365 } else {
5366 $r5 = self::$FAILED;
5367 if (!$silence) {$this->fail(53);}
5368 $this->currPos = $p3;
5369 $r1 = self::$FAILED;
5370 goto seq_1;
5371 }
5372 $r1 = true;
5373 seq_1:
5374 if ($r1!==self::$FAILED) {
5375 $this->savedPos = $p2;
5376 $r1 = $this->a60($r5);
5377 }
5378 // free $p3
5379 $this->cache[$key] = new PEGParserCacheEntry(
5380 $this->currPos,
5381 $r1
5382
5383 );
5384 return $r1;
5385 }
5386 private function parsedouble_backquote_expansion($silence, $boolParams) {
5387 $key = json_encode([172,$this->currPos,$boolParams & 0x1]);
5388 $cached = $this->cache[$key] ?? null;
5389 if ($cached) {
5390 $this->currPos = $cached->nextPos;
5391
5392 return $cached->result;
5393 }
5394
5395 $p2 = $this->currPos;
5396 // start seq_1
5397 $p3 = $this->currPos;
5398 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "\\`", $this->currPos, 2, false) === 0) {
5399 $r4 = "\\`";
5400 $this->currPos += 2;
5401 } else {
5402 if (!$silence) {$this->fail(54);}
5403 $r4 = self::$FAILED;
5404 $r1 = self::$FAILED;
5405 goto seq_1;
5406 }
5407 // start choice_1
5408 $r5 = $this->parsebackquoted_escape($silence);
5409 if ($r5!==self::$FAILED) {
5410 goto choice_1;
5411 }
5412 $r5 = $this->parsedollar_expansion($silence, $boolParams);
5413 if ($r5!==self::$FAILED) {
5414 goto choice_1;
5415 }
5416 if (($this->input[$this->currPos] ?? null) === "\$") {
5417 $this->currPos++;
5418 $r5 = "\$";
5419 goto choice_1;
5420 } else {
5421 if (!$silence) {$this->fail(34);}
5422 $r5 = self::$FAILED;
5423 }
5424 // start seq_2
5425 $p6 = $this->currPos;
5426 if (($this->input[$this->currPos] ?? null) === "\\") {
5427 $this->currPos++;
5428 $r7 = "\\";
5429 } else {
5430 if (!$silence) {$this->fail(31);}
5431 $r7 = self::$FAILED;
5432 $r5 = self::$FAILED;
5433 goto seq_2;
5434 }
5435 $p8 = $this->currPos;
5436 if (($this->input[$this->currPos] ?? null) === "`") {
5437 $this->currPos++;
5438 $r9 = "`";
5439 } else {
5440 $r9 = self::$FAILED;
5441 }
5442 if ($r9 === self::$FAILED) {
5443 $r9 = false;
5444 } else {
5445 $r9 = self::$FAILED;
5446 $this->currPos = $p8;
5447 $this->currPos = $p6;
5448 $r5 = self::$FAILED;
5449 goto seq_2;
5450 }
5451 // free $p8
5452 $r5 = [$r7,$r9];
5453 seq_2:
5454 if ($r5!==self::$FAILED) {
5455 goto choice_1;
5456 }
5457 // free $p6
5458 $p6 = $this->currPos;
5459 $r5 = self::$FAILED;
5460 for (;;) {
5461 if (strcspn($this->input, "`\$\\", $this->currPos, 1) !== 0) {
5462 $r10 = self::consumeChar($this->input, $this->currPos);
5463 $r5 = true;
5464 } else {
5465 $r10 = self::$FAILED;
5466 if (!$silence) {$this->fail(35);}
5467 break;
5468 }
5469 }
5470 if ($r5!==self::$FAILED) {
5471 $r5 = substr($this->input, $p6, $this->currPos - $p6);
5472 } else {
5473 $r5 = self::$FAILED;
5474 }
5475 // free $r10
5476 // free $p6
5477 choice_1:
5478 // parts <- $r5
5479 if ($r5===self::$FAILED) {
5480 $this->currPos = $p3;
5481 $r1 = self::$FAILED;
5482 goto seq_1;
5483 }
5484 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "\\`", $this->currPos, 2, false) === 0) {
5485 $r10 = "\\`";
5486 $this->currPos += 2;
5487 } else {
5488 if (!$silence) {$this->fail(54);}
5489 $r10 = self::$FAILED;
5490 $this->currPos = $p3;
5491 $r1 = self::$FAILED;
5492 goto seq_1;
5493 }
5494 $r1 = true;
5495 seq_1:
5496 if ($r1!==self::$FAILED) {
5497 $this->savedPos = $p2;
5498 $r1 = $this->a61($r5);
5499 }
5500 // free $p3
5501 $this->cache[$key] = new PEGParserCacheEntry(
5502 $this->currPos,
5503 $r1
5504
5505 );
5506 return $r1;
5507 }
5508 private function parsespecial_parameter($silence) {
5509 $key = json_encode([176,$this->currPos]);
5510 $cached = $this->cache[$key] ?? null;
5511 if ($cached) {
5512 $this->currPos = $cached->nextPos;
5513
5514 return $cached->result;
5515 }
5516
5517 $p2 = $this->currPos;
5518 // contents <- $r3
5519 if (strspn($this->input, "@*#?-\$!0", $this->currPos, 1) !== 0) {
5520 $r3 = $this->input[$this->currPos++];
5521 } else {
5522 $r3 = self::$FAILED;
5523 if (!$silence) {$this->fail(55);}
5524 }
5525 $r1 = $r3;
5526 if ($r1!==self::$FAILED) {
5527 $this->savedPos = $p2;
5528 $r1 = $this->a62($r3);
5529 }
5530 $this->cache[$key] = new PEGParserCacheEntry(
5531 $this->currPos,
5532 $r1
5533
5534 );
5535 return $r1;
5536 }
5537 private function parseshort_positional_parameter($silence) {
5538 $key = json_encode([178,$this->currPos]);
5539 $cached = $this->cache[$key] ?? null;
5540 if ($cached) {
5541 $this->currPos = $cached->nextPos;
5542
5543 return $cached->result;
5544 }
5545
5546 $p2 = $this->currPos;
5547 $r3 = $this->input[$this->currPos] ?? '';
5548 // contents <- $r3
5549 if (preg_match("/^[1-9]/", $r3)) {
5550 $this->currPos++;
5551 } else {
5552 $r3 = self::$FAILED;
5553 if (!$silence) {$this->fail(56);}
5554 }
5555 $r1 = $r3;
5556 if ($r1!==self::$FAILED) {
5557 $this->savedPos = $p2;
5558 $r1 = $this->a63($r3);
5559 }
5560 $this->cache[$key] = new PEGParserCacheEntry(
5561 $this->currPos,
5562 $r1
5563
5564 );
5565 return $r1;
5566 }
5567 private function parsebrace_expansion($silence) {
5568 $key = json_encode([180,$this->currPos]);
5569 $cached = $this->cache[$key] ?? null;
5570 if ($cached) {
5571 $this->currPos = $cached->nextPos;
5572
5573 return $cached->result;
5574 }
5575
5576 $p2 = $this->currPos;
5577 // start seq_1
5578 $p3 = $this->currPos;
5579 if (($this->input[$this->currPos] ?? null) === "{") {
5580 $this->currPos++;
5581 $r4 = "{";
5582 } else {
5583 if (!$silence) {$this->fail(17);}
5584 $r4 = self::$FAILED;
5585 $r1 = self::$FAILED;
5586 goto seq_1;
5587 }
5588 // start choice_1
5589 $r5 = $this->parsebinary_expansion($silence);
5590 if ($r5!==self::$FAILED) {
5591 goto choice_1;
5592 }
5593 $r5 = $this->parsestring_length($silence);
5594 if ($r5!==self::$FAILED) {
5595 goto choice_1;
5596 }
5597 $r5 = $this->parsebraced_parameter_expansion($silence);
5598 choice_1:
5599 // contents <- $r5
5600 if ($r5===self::$FAILED) {
5601 $this->currPos = $p3;
5602 $r1 = self::$FAILED;
5603 goto seq_1;
5604 }
5605 if (($this->input[$this->currPos] ?? null) === "}") {
5606 $this->currPos++;
5607 $r6 = "}";
5608 } else {
5609 if (!$silence) {$this->fail(18);}
5610 $r6 = self::$FAILED;
5611 $this->currPos = $p3;
5612 $r1 = self::$FAILED;
5613 goto seq_1;
5614 }
5615 $r1 = true;
5616 seq_1:
5617 if ($r1!==self::$FAILED) {
5618 $this->savedPos = $p2;
5619 $r1 = $this->a54($r5);
5620 }
5621 // free $p3
5622 $this->cache[$key] = new PEGParserCacheEntry(
5623 $this->currPos,
5624 $r1
5625
5626 );
5627 return $r1;
5628 }
5629 private function parsearithmetic_expansion($silence, $boolParams) {
5630 $key = json_encode([186,$this->currPos,$boolParams & 0x1]);
5631 $cached = $this->cache[$key] ?? null;
5632 if ($cached) {
5633 $this->currPos = $cached->nextPos;
5634
5635 return $cached->result;
5636 }
5637
5638 $p2 = $this->currPos;
5639 // start seq_1
5640 $p3 = $this->currPos;
5641 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "((", $this->currPos, 2, false) === 0) {
5642 $r4 = "((";
5643 $this->currPos += 2;
5644 } else {
5645 if (!$silence) {$this->fail(57);}
5646 $r4 = self::$FAILED;
5647 $r1 = self::$FAILED;
5648 goto seq_1;
5649 }
5650 $r5 = $this->discardOWS($silence);
5651 if ($r5===self::$FAILED) {
5652 $this->currPos = $p3;
5653 $r1 = self::$FAILED;
5654 goto seq_1;
5655 }
5656 $r6 = [];
5657 for (;;) {
5658 $r7 = $this->parseWORD($silence, $boolParams);
5659 if ($r7!==self::$FAILED) {
5660 $r6[] = $r7;
5661 } else {
5662 break;
5663 }
5664 }
5665 if (count($r6) === 0) {
5666 $r6 = self::$FAILED;
5667 }
5668 // words <- $r6
5669 if ($r6===self::$FAILED) {
5670 $this->currPos = $p3;
5671 $r1 = self::$FAILED;
5672 goto seq_1;
5673 }
5674 // free $r7
5675 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "))", $this->currPos, 2, false) === 0) {
5676 $r7 = "))";
5677 $this->currPos += 2;
5678 } else {
5679 if (!$silence) {$this->fail(58);}
5680 $r7 = self::$FAILED;
5681 $this->currPos = $p3;
5682 $r1 = self::$FAILED;
5683 goto seq_1;
5684 }
5685 $r1 = true;
5686 seq_1:
5687 if ($r1!==self::$FAILED) {
5688 $this->savedPos = $p2;
5689 $r1 = $this->a64($r6);
5690 }
5691 // free $p3
5692 $this->cache[$key] = new PEGParserCacheEntry(
5693 $this->currPos,
5694 $r1
5695
5696 );
5697 return $r1;
5698 }
5699 private function parsecommand_expansion($silence, $boolParams) {
5700 $key = json_encode([188,$this->currPos,$boolParams & 0x1]);
5701 $cached = $this->cache[$key] ?? null;
5702 if ($cached) {
5703 $this->currPos = $cached->nextPos;
5704
5705 return $cached->result;
5706 }
5707
5708 $p2 = $this->currPos;
5709 // start seq_1
5710 $p3 = $this->currPos;
5711 if (($this->input[$this->currPos] ?? null) === "(") {
5712 $this->currPos++;
5713 $r4 = "(";
5714 } else {
5715 if (!$silence) {$this->fail(14);}
5716 $r4 = self::$FAILED;
5717 $r1 = self::$FAILED;
5718 goto seq_1;
5719 }
5720 $r5 = $this->parsecomplete_command($silence, $boolParams);
5721 // command <- $r5
5722 if ($r5===self::$FAILED) {
5723 $this->currPos = $p3;
5724 $r1 = self::$FAILED;
5725 goto seq_1;
5726 }
5727 if (($this->input[$this->currPos] ?? null) === ")") {
5728 $this->currPos++;
5729 $r6 = ")";
5730 } else {
5731 if (!$silence) {$this->fail(15);}
5732 $r6 = self::$FAILED;
5733 $this->currPos = $p3;
5734 $r1 = self::$FAILED;
5735 goto seq_1;
5736 }
5737 $r1 = true;
5738 seq_1:
5739 if ($r1!==self::$FAILED) {
5740 $this->savedPos = $p2;
5741 $r1 = $this->a65($r5);
5742 }
5743 // free $p3
5744 $this->cache[$key] = new PEGParserCacheEntry(
5745 $this->currPos,
5746 $r1
5747
5748 );
5749 return $r1;
5750 }
5751 private function parsenamed_parameter($silence) {
5752 $key = json_encode([196,$this->currPos]);
5753 $cached = $this->cache[$key] ?? null;
5754 if ($cached) {
5755 $this->currPos = $cached->nextPos;
5756
5757 return $cached->result;
5758 }
5759
5760 $p2 = $this->currPos;
5761 $r3 = $this->parseNAME($silence);
5762 // name <- $r3
5763 $r1 = $r3;
5764 if ($r1!==self::$FAILED) {
5765 $this->savedPos = $p2;
5766 $r1 = $this->a66($r3);
5767 }
5768 $this->cache[$key] = new PEGParserCacheEntry(
5769 $this->currPos,
5770 $r1
5771
5772 );
5773 return $r1;
5774 }
5775 private function parsepattern($silence, $boolParams) {
5776 $key = json_encode([38,$this->currPos,$boolParams & 0x1]);
5777 $cached = $this->cache[$key] ?? null;
5778 if ($cached) {
5779 $this->currPos = $cached->nextPos;
5780
5781 return $cached->result;
5782 }
5783
5784 $p2 = $this->currPos;
5785 // start seq_1
5786 $p3 = $this->currPos;
5787 $r4 = $this->parseWORD($silence, $boolParams);
5788 // first <- $r4
5789 if ($r4===self::$FAILED) {
5790 $r1 = self::$FAILED;
5791 goto seq_1;
5792 }
5793 $r5 = [];
5794 for (;;) {
5795 // start seq_2
5796 $p7 = $this->currPos;
5797 $r8 = $this->parsePIPE($silence);
5798 if ($r8===self::$FAILED) {
5799 $r6 = self::$FAILED;
5800 goto seq_2;
5801 }
5802 $r9 = $this->parseWORD($silence, $boolParams);
5803 if ($r9===self::$FAILED) {
5804 $this->currPos = $p7;
5805 $r6 = self::$FAILED;
5806 goto seq_2;
5807 }
5808 $r6 = [$r8,$r9];
5809 seq_2:
5810 if ($r6!==self::$FAILED) {
5811 $r5[] = $r6;
5812 } else {
5813 break;
5814 }
5815 // free $p7
5816 }
5817 // rest <- $r5
5818 // free $r6
5819 $r1 = true;
5820 seq_1:
5821 if ($r1!==self::$FAILED) {
5822 $this->savedPos = $p2;
5823 $r1 = $this->a67($r4, $r5);
5824 }
5825 // free $p3
5826 $this->cache[$key] = new PEGParserCacheEntry(
5827 $this->currPos,
5828 $r1
5829
5830 );
5831 return $r1;
5832 }
5833 private function discardWORD($silence, $boolParams) {
5834 $key = json_encode([157,$this->currPos,$boolParams & 0x1]);
5835 $cached = $this->cache[$key] ?? null;
5836 if ($cached) {
5837 $this->currPos = $cached->nextPos;
5838
5839 return $cached->result;
5840 }
5841
5842 $p2 = $this->currPos;
5843 // start seq_1
5844 $p3 = $this->currPos;
5845 $r4 = [];
5846 for (;;) {
5847 $r5 = $this->parseword_part($silence, $boolParams);
5848 if ($r5!==self::$FAILED) {
5849 $r4[] = $r5;
5850 } else {
5851 break;
5852 }
5853 }
5854 if (count($r4) === 0) {
5855 $r4 = self::$FAILED;
5856 }
5857 // parts <- $r4
5858 if ($r4===self::$FAILED) {
5859 $r1 = self::$FAILED;
5860 goto seq_1;
5861 }
5862 // free $r5
5863 $r5 = $this->discardOWS($silence);
5864 if ($r5===self::$FAILED) {
5865 $this->currPos = $p3;
5866 $r1 = self::$FAILED;
5867 goto seq_1;
5868 }
5869 $r1 = true;
5870 seq_1:
5871 if ($r1!==self::$FAILED) {
5872 $this->savedPos = $p2;
5873 $r1 = $this->a19($r4);
5874 }
5875 // free $p3
5876 $this->cache[$key] = new PEGParserCacheEntry(
5877 $this->currPos,
5878 $r1
5879
5880 );
5881 return $r1;
5882 }
5883 private function parsebinary_expansion($silence) {
5884 $key = json_encode([182,$this->currPos]);
5885 $cached = $this->cache[$key] ?? null;
5886 if ($cached) {
5887 $this->currPos = $cached->nextPos;
5888
5889 return $cached->result;
5890 }
5891
5892 $p2 = $this->currPos;
5893 // start seq_1
5894 $p3 = $this->currPos;
5895 $r4 = $this->parseparameter($silence);
5896 // parameter <- $r4
5897 if ($r4===self::$FAILED) {
5898 $r1 = self::$FAILED;
5899 goto seq_1;
5900 }
5901 // start choice_1
5902 $p6 = $this->currPos;
5903 // start seq_2
5904 $p7 = $this->currPos;
5905 if (($this->input[$this->currPos] ?? null) === ":") {
5906 $this->currPos++;
5907 $r8 = ":";
5908 } else {
5909 if (!$silence) {$this->fail(59);}
5910 $r8 = self::$FAILED;
5911 $r5 = self::$FAILED;
5912 goto seq_2;
5913 }
5914 if (strspn($this->input, "-=?+", $this->currPos, 1) !== 0) {
5915 $r9 = $this->input[$this->currPos++];
5916 } else {
5917 $r9 = self::$FAILED;
5918 if (!$silence) {$this->fail(60);}
5919 $this->currPos = $p7;
5920 $r5 = self::$FAILED;
5921 goto seq_2;
5922 }
5923 $r5 = true;
5924 seq_2:
5925 if ($r5!==self::$FAILED) {
5926 $r5 = substr($this->input, $p6, $this->currPos - $p6);
5927 goto choice_1;
5928 } else {
5929 $r5 = self::$FAILED;
5930 }
5931 // free $p7
5932 // free $p6
5933 $p6 = $this->currPos;
5934 // start choice_2
5935 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "%%", $this->currPos, 2, false) === 0) {
5936 $r5 = "%%";
5937 $this->currPos += 2;
5938 goto choice_2;
5939 } else {
5940 if (!$silence) {$this->fail(61);}
5941 $r5 = self::$FAILED;
5942 }
5943 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "##", $this->currPos, 2, false) === 0) {
5944 $r5 = "##";
5945 $this->currPos += 2;
5946 goto choice_2;
5947 } else {
5948 if (!$silence) {$this->fail(62);}
5949 $r5 = self::$FAILED;
5950 }
5951 if (strspn($this->input, "%#-=?+", $this->currPos, 1) !== 0) {
5952 $r5 = $this->input[$this->currPos++];
5953 } else {
5954 $r5 = self::$FAILED;
5955 if (!$silence) {$this->fail(63);}
5956 }
5957 choice_2:
5958 if ($r5!==self::$FAILED) {
5959 $r5 = substr($this->input, $p6, $this->currPos - $p6);
5960 } else {
5961 $r5 = self::$FAILED;
5962 }
5963 // free $p6
5964 choice_1:
5965 // operator <- $r5
5966 if ($r5===self::$FAILED) {
5967 $this->currPos = $p3;
5968 $r1 = self::$FAILED;
5969 goto seq_1;
5970 }
5971 $r10 = $this->discardOWS($silence);
5972 if ($r10===self::$FAILED) {
5973 $this->currPos = $p3;
5974 $r1 = self::$FAILED;
5975 goto seq_1;
5976 }
5977 $r11 = $this->parseWORD($silence, 0x1);
5978 if ($r11===self::$FAILED) {
5979 $r11 = null;
5980 }
5981 // word <- $r11
5982 $r1 = true;
5983 seq_1:
5984 if ($r1!==self::$FAILED) {
5985 $this->savedPos = $p2;
5986 $r1 = $this->a68($r4, $r5, $r11);
5987 }
5988 // free $p3
5989 $this->cache[$key] = new PEGParserCacheEntry(
5990 $this->currPos,
5991 $r1
5992
5993 );
5994 return $r1;
5995 }
5996 private function parsestring_length($silence) {
5997 $key = json_encode([184,$this->currPos]);
5998 $cached = $this->cache[$key] ?? null;
5999 if ($cached) {
6000 $this->currPos = $cached->nextPos;
6001
6002 return $cached->result;
6003 }
6004
6005 $p2 = $this->currPos;
6006 // start seq_1
6007 $p3 = $this->currPos;
6008 if (($this->input[$this->currPos] ?? null) === "#") {
6009 $this->currPos++;
6010 $r4 = "#";
6011 } else {
6012 if (!$silence) {$this->fail(3);}
6013 $r4 = self::$FAILED;
6014 $r1 = self::$FAILED;
6015 goto seq_1;
6016 }
6017 $r5 = $this->parseparameter($silence);
6018 // parameter <- $r5
6019 if ($r5===self::$FAILED) {
6020 $this->currPos = $p3;
6021 $r1 = self::$FAILED;
6022 goto seq_1;
6023 }
6024 $r1 = true;
6025 seq_1:
6026 if ($r1!==self::$FAILED) {
6027 $this->savedPos = $p2;
6028 $r1 = $this->a69($r5);
6029 }
6030 // free $p3
6031 $this->cache[$key] = new PEGParserCacheEntry(
6032 $this->currPos,
6033 $r1
6034
6035 );
6036 return $r1;
6037 }
6038 private function parsebraced_parameter_expansion($silence) {
6039 $key = json_encode([190,$this->currPos]);
6040 $cached = $this->cache[$key] ?? null;
6041 if ($cached) {
6042 $this->currPos = $cached->nextPos;
6043
6044 return $cached->result;
6045 }
6046
6047 $p2 = $this->currPos;
6048 $r3 = $this->parseparameter($silence);
6049 // parameter <- $r3
6050 $r1 = $r3;
6051 if ($r1!==self::$FAILED) {
6052 $this->savedPos = $p2;
6053 $r1 = $this->a70($r3);
6054 }
6055 $this->cache[$key] = new PEGParserCacheEntry(
6056 $this->currPos,
6057 $r1
6058
6059 );
6060 return $r1;
6061 }
6062 private function parsePIPE($silence) {
6063 $key = json_encode([146,$this->currPos]);
6064 $cached = $this->cache[$key] ?? null;
6065 if ($cached) {
6066 $this->currPos = $cached->nextPos;
6067
6068 return $cached->result;
6069 }
6070
6071 // start seq_1
6072 $p1 = $this->currPos;
6073 $p3 = $this->currPos;
6074 $r4 = $this->discardOR_IF(true);
6075 if ($r4 === self::$FAILED) {
6076 $r4 = false;
6077 } else {
6078 $r4 = self::$FAILED;
6079 $this->currPos = $p3;
6080 $r2 = self::$FAILED;
6081 goto seq_1;
6082 }
6083 // free $p3
6084 if (($this->input[$this->currPos] ?? null) === "|") {
6085 $this->currPos++;
6086 $r5 = "|";
6087 } else {
6088 if (!$silence) {$this->fail(11);}
6089 $r5 = self::$FAILED;
6090 $this->currPos = $p1;
6091 $r2 = self::$FAILED;
6092 goto seq_1;
6093 }
6094 $r6 = $this->parseOWS($silence);
6095 if ($r6===self::$FAILED) {
6096 $this->currPos = $p1;
6097 $r2 = self::$FAILED;
6098 goto seq_1;
6099 }
6100 $r2 = [$r4,$r5,$r6];
6101 seq_1:
6102 // free $r2,$p1
6103 $this->cache[$key] = new PEGParserCacheEntry(
6104 $this->currPos,
6105 $r2
6106
6107 );
6108 return $r2;
6109 }
6110 private function parseparameter($silence) {
6111 $key = json_encode([192,$this->currPos]);
6112 $cached = $this->cache[$key] ?? null;
6113 if ($cached) {
6114 $this->currPos = $cached->nextPos;
6115
6116 return $cached->result;
6117 }
6118
6119 // start choice_1
6120 $r1 = $this->parsespecial_parameter($silence);
6121 if ($r1!==self::$FAILED) {
6122 goto choice_1;
6123 }
6124 $r1 = $this->parselong_positional_parameter($silence);
6125 if ($r1!==self::$FAILED) {
6126 goto choice_1;
6127 }
6128 $r1 = $this->parsenamed_parameter($silence);
6129 choice_1:
6130 $this->cache[$key] = new PEGParserCacheEntry(
6131 $this->currPos,
6132 $r1
6133
6134 );
6135 return $r1;
6136 }
6137 private function parseOWS($silence) {
6138 $key = json_encode([152,$this->currPos]);
6139 $cached = $this->cache[$key] ?? null;
6140 if ($cached) {
6141 $this->currPos = $cached->nextPos;
6142
6143 return $cached->result;
6144 }
6145
6146 // start seq_1
6147 $p1 = $this->currPos;
6148 $r3 = [];
6149 for (;;) {
6150 if (strspn($this->input, " \x09\x0b\x0d\x0c", $this->currPos, 1) !== 0) {
6151 $r4 = $this->input[$this->currPos++];
6152 $r3[] = $r4;
6153 } else {
6154 $r4 = self::$FAILED;
6155 if (!$silence) {$this->fail(2);}
6156 break;
6157 }
6158 }
6159 // free $r4
6160 // start seq_2
6161 $p5 = $this->currPos;
6162 if (($this->input[$this->currPos] ?? null) === "#") {
6163 $this->currPos++;
6164 $r6 = "#";
6165 } else {
6166 if (!$silence) {$this->fail(3);}
6167 $r6 = self::$FAILED;
6168 $r4 = self::$FAILED;
6169 goto seq_2;
6170 }
6171 $r7 = [];
6172 for (;;) {
6173 $r8 = self::charAt($this->input, $this->currPos);
6174 if ($r8 !== '' && !($r8 === "\x0a")) {
6175 $this->currPos += strlen($r8);
6176 $r7[] = $r8;
6177 } else {
6178 $r8 = self::$FAILED;
6179 if (!$silence) {$this->fail(4);}
6180 break;
6181 }
6182 }
6183 // free $r8
6184 $r4 = [$r6,$r7];
6185 seq_2:
6186 if ($r4===self::$FAILED) {
6187 $r4 = null;
6188 }
6189 // free $p5
6190 $r2 = [$r3,$r4];
6191 seq_1:
6192 // free $r2,$p1
6193 $this->cache[$key] = new PEGParserCacheEntry(
6194 $this->currPos,
6195 $r2
6196
6197 );
6198 return $r2;
6199 }
6200 private function parselong_positional_parameter($silence) {
6201 $key = json_encode([194,$this->currPos]);
6202 $cached = $this->cache[$key] ?? null;
6203 if ($cached) {
6204 $this->currPos = $cached->nextPos;
6205
6206 return $cached->result;
6207 }
6208
6209 $p2 = $this->currPos;
6210 $p4 = $this->currPos;
6211 $r3 = self::$FAILED;
6212 for (;;) {
6213 $r5 = $this->input[$this->currPos] ?? '';
6214 if (preg_match("/^[0-9]/", $r5)) {
6215 $this->currPos++;
6216 $r3 = true;
6217 } else {
6218 $r5 = self::$FAILED;
6219 if (!$silence) {$this->fail(27);}
6220 break;
6221 }
6222 }
6223 // parameter <- $r3
6224 if ($r3!==self::$FAILED) {
6225 $r3 = substr($this->input, $p4, $this->currPos - $p4);
6226 } else {
6227 $r3 = self::$FAILED;
6228 }
6229 // free $r5
6230 // free $p4
6231 $r1 = $r3;
6232 if ($r1!==self::$FAILED) {
6233 $this->savedPos = $p2;
6234 $r1 = $this->a71($r3);
6235 }
6236 $this->cache[$key] = new PEGParserCacheEntry(
6237 $this->currPos,
6238 $r1
6239
6240 );
6241 return $r1;
6242 }
6243
6244 public function parse( $input, $options = [] ) {
6245 $this->initInternal( $input, $options );
6246 $startRule = $options['startRule'] ?? '(DEFAULT)';
6247 $result = null;
6248
6249 if ( !empty( $options['stream'] ) ) {
6250 switch ( $startRule ) {
6251
6252 default:
6253 throw new \Wikimedia\WikiPEG\InternalError( "Can't stream rule $startRule." );
6254 }
6255 } else {
6256 switch ( $startRule ) {
6257 case '(DEFAULT)':
6258 case "program":
6259 $result = $this->parseprogram(false);
6260 break;
6261 default:
6262 throw new \Wikimedia\WikiPEG\InternalError( "Can't start parsing from rule $startRule." );
6263 }
6264 }
6265
6266 if ( $result !== self::$FAILED && $this->currPos === $this->inputLength ) {
6267 return $result;
6268 } else {
6269 if ( $result !== self::$FAILED && $this->currPos < $this->inputLength ) {
6270 $this->fail( 0 );
6271 }
6272 throw $this->buildParseException();
6273 }
6274 }
6275 }
6276