Debian Codegraph @

vendor/wikimedia/parsoid/src/Wt2Html/Grammar.php

raw
1 <?php
2 /*
3 * DO NOT EDIT MANUALLY.
4 * File generated from Grammar.pegphp with `npm run regen-php-tokenizer`.
5 */
6
7
8 namespace Wikimedia\Parsoid\Wt2Html;
9
10
11 use Wikimedia\Assert\UnreachableException;
12 use Wikimedia\JsonCodec\JsonCodec;
13 use Wikimedia\Parsoid\Config\Env;
14 use Wikimedia\Parsoid\Config\SiteConfig;
15 use Wikimedia\Parsoid\Core\DomSourceRange;
16 use Wikimedia\Parsoid\NodeData\DataMw;
17 use Wikimedia\Parsoid\NodeData\DataParsoid;
18 use Wikimedia\Parsoid\NodeData\TempData;
19 use Wikimedia\Parsoid\Tokens\CommentTk;
20 use Wikimedia\Parsoid\Tokens\EOFTk;
21 use Wikimedia\Parsoid\Tokens\EndTagTk;
22 use Wikimedia\Parsoid\Tokens\KV;
23 use Wikimedia\Parsoid\Tokens\KVSourceRange;
24 use Wikimedia\Parsoid\Tokens\NlTk;
25 use Wikimedia\Parsoid\Tokens\SelfclosingTagTk;
26 use Wikimedia\Parsoid\Tokens\SourceRange;
27 use Wikimedia\Parsoid\Tokens\TagTk;
28 use Wikimedia\Parsoid\Tokens\Token;
29 use Wikimedia\Parsoid\Utils\DOMDataUtils;
30 use Wikimedia\Parsoid\Utils\PHPUtils;
31 use Wikimedia\Parsoid\Utils\TokenUtils;
32 use Wikimedia\Parsoid\Utils\Utils;
33 use Wikimedia\Parsoid\Utils\WTUtils;
34 use Wikimedia\Parsoid\Wikitext\Consts;
35
36
37
38 class GrammarCacheEntry {
39 public $nextPos;
40 public $result;
41 public $preproc;
42 public $th;
43
44
45 public function __construct( $nextPos, $result, $preproc, $th ) {
46 $this->nextPos = $nextPos;
47 $this->result = $result;
48 $this->preproc = $preproc;
49 $this->th = $th;
50
51 }
52 }
53
54
55 class Grammar extends \Wikimedia\WikiPEG\PEGParserBase {
56 // initializer
57
58 /** @var Env */
59 private $env;
60
61 /** @var SiteConfig */
62 private $siteConfig;
63
64 /** @var array */
65 private $pipelineOpts;
66
67 /** @var int */
68 private $pipelineOffset;
69
70 private $extTags;
71
72 private $startTime;
73
74 /** @var string */
75 private $reUrltextLookahead;
76
77 /** @var string */
78 private $urltextPlainSegment = '';
79
80 /** @var bool */
81 private $urltextFoundAutolink = false;
82
83 protected function initialize() {
84 $this->env = $this->options['env'];
85 $this->siteConfig = $this->env->getSiteConfig();
86
87 $tokenizer = $this->options['pegTokenizer'];
88 $this->pipelineOpts = $tokenizer->getOptions();
89 // FIXME: inTemplate option may not always be set in
90 // standalone tokenizers user by some pipelines handlers.
91 $this->pipelineOffset = $this->options['pipelineOffset'] ?? 0;
92 $this->extTags = $this->siteConfig->getExtensionTagNameMap();
93
94 // Non-greedy text_char sequence: stop at ampersand, double-underscore,
95 // magic link prefix or protocol
96 $this->reUrltextLookahead = '!(?:' .
97 '([^-\'<[{\n\r:;\]}|\!=&]*?)' .
98 '(?:__|$|[-\'<[{\n\r:;\]}|\!=&]|(RFC|PMID|ISBN|' .
99 '(?i)' . $this->siteConfig->getProtocolsRegex( true ) .
100 ')))!A';
101 }
102
103 private $prevOffset = 0;
104 private $headingIndex = 0;
105
106 public function resetState() {
107 $this->prevOffset = 0;
108 $this->headingIndex = 0;
109 }
110
111 private function assert( $condition, $text ) {
112 if ( !$condition ) {
113 throw new \RuntimeException( "Grammar.pegphp assertion failure: $text" );
114 }
115 }
116
117 private function unreachable() {
118 throw new UnreachableException( "Grammar.pegphp: this should be unreachable" );
119 }
120
121 // Some shorthands for legibility
122 private function startOffset() {
123 return $this->savedPos;
124 }
125
126 private function endOffset() {
127 return $this->currPos;
128 }
129
130 private function tsrOffsets( $flag = 'default' ): SourceRange {
131 switch ( $flag ) {
132 case 'start':
133 return new SourceRange( $this->savedPos, $this->savedPos );
134 case 'end':
135 return new SourceRange( $this->currPos, $this->currPos );
136 default:
137 return new SourceRange( $this->savedPos, $this->currPos );
138 }
139 }
140
141 /*
142 * Emit a chunk of tokens to our consumers. Once this has been done, the
143 * current expression can return an empty list (true).
144 */
145 private function emitChunk( $tokens ) {
146 // FIXME: We don't expect nulls here, but looks like
147 // hack from I1c695ab6cdd3655e98877c175ddbabdee9dc44b7
148 // introduces them. Work around it for now!
149 if ( !$tokens ) {
150 return [];
151 }
152
153 // Shift tsr of all tokens by the pipeline offset
154 TokenUtils::shiftTokenTSR( $tokens, $this->pipelineOffset );
155 $this->env->log( 'trace/peg', $this->options['pipelineId'] ?? '0', '----> ', $tokens );
156
157 $i = null;
158 $n = count( $tokens );
159
160 // Enforce parsing resource limits
161 for ( $i = 0; $i < $n; $i++ ) {
162 TokenizerUtils::enforceParserResourceLimits( $this->env, $tokens[ $i ] );
163 }
164
165 return $tokens;
166 }
167
168 /* ------------------------------------------------------------------------
169 * Extension tags should be parsed with higher priority than anything else.
170 *
171 * The trick we use is to strip out the content inside a matching tag-pair
172 * and not tokenize it. The content, if it needs to parsed (for example,
173 * for <ref>, <*include*> tags), is parsed in a fresh tokenizer context
174 * which means any error correction that needs to happen is restricted to
175 * the scope of the extension content and doesn't spill over to the higher
176 * level. Ex: <math><!--foo</math>.
177 *
178 * IGNORE: {{ this just balances the blocks in this comment for pegjs
179 *
180 * This trick also lets us prevent extension content (that don't accept WT)
181 * from being parsed as wikitext (Ex: <math>\frac{foo\frac{bar}}</math>)
182 * We don't want the "}}" being treated as a template closing tag and
183 * closing outer templates.
184 * --------------------------------------------------------------------- */
185
186 private function isXMLTag( string $name ): bool {
187 $lName = mb_strtolower( $name );
188 return isset( Consts::$HTML['HTML5Tags'][$lName] ) ||
189 isset( Consts::$HTML['OlderHTMLTags'][$lName] );
190 }
191
192 private function maybeAnnotationOrExtensionTag( Token $t, ?bool $end, array $attribs, SourceRange $tsr ) {
193 $tagName = mb_strtolower( $t->getName() );
194
195 $isAnnotationTag = $this->siteConfig->isAnnotationTag( $tagName );
196 if ( !$isAnnotationTag ) {
197 $pipepos = strpos( $tagName, '|' );
198 if ( $pipepos ) {
199 $strBeforePipe = substr( $tagName, 0, $pipepos );
200 $isAnnotationTag = $this->siteConfig->isAnnotationTag( $strBeforePipe );
201 if ( $isAnnotationTag ) {
202 $attribs = [ new KV( "name", substr( $tagName, $pipepos + 1, strlen( $tagName ) - $pipepos - 1 ) ) ];
203 $tagName = $strBeforePipe;
204 }
205 }
206 }
207
208 if ( $isAnnotationTag ) {
209 $metaAttrs = [ new KV( 'typeof', 'mw:Annotation/' . $tagName . ($end ? '/End' : '') ) ];
210 $datamw = null;
211 if ( count( $attribs ) > 0 ) {
212 $attrMap = [];
213 foreach ( $attribs as $attr ) {
214 // If the key or the value is not a string, we replace it by the thing that generated it and
215 // consider that wikitext as a raw string instead.
216 $k = is_string( $attr->k ) ? $attr->k : $attr->ksrc;
217 $v = is_string( $attr->v ) ? $attr->v : $attr->vsrc;
218 $attrMap[$k] = $v;
219 }
220 // Possible follow-up in T295168 for attribute sanitation
221 // T367616: 'attrs' should be renamed to 'extAttrs'
222 $datamw = new DataMw( [ 'attrs' => (object)$attrMap ] );
223 }
224 $dp = new DataParsoid();
225 $dp->tsr = $tsr;
226 $this->env->hasAnnotations = true;
227 // FIXME: Suppress annotation meta tokens from template pipelines
228 // since they may not have TSR values and won't get recognized as
229 // annotation ranges. Without TSR, they might end up stuck in
230 // fosterable positions and cause havoc on edits by breaking selser.
231 if ( empty( $this->pipelineOpts['inTemplate'] ) ) {
232 return [ new SelfclosingTagTk ( 'meta', $metaAttrs, $dp, $datamw ) ];
233 } else {
234 return [];
235 }
236 }
237
238 $isInstalledExt = isset( $this->extTags[$tagName] );
239 $isIncludeTag = WTUtils::isIncludeTag( $tagName );
240
241 // Extensions have higher precedence when they shadow html tags.
242 if ( !( $isInstalledExt || $isIncludeTag ) ) {
243 return $t;
244 }
245
246 $dp = $t->dataParsoid;
247 $skipPos = $this->currPos;
248
249 switch ( get_class( $t ) ) {
250 case EndTagTk::class:
251 if ( $isIncludeTag ) {
252 return $t;
253 }
254 // Similar to TagTk, we rely on the sanitizer to convert to text
255 // where necessary and emit tokens to ease the wikitext escaping
256 // code. However, extension tags that shadow html tags will see
257 // their unmatched end tags dropped while tree building, since
258 // the sanitizer will let them through.
259 return $t; // not text()
260
261 case SelfclosingTagTk::class:
262 $dp->src = $dp->tsr->substr( $this->input );
263 $dp->extTagOffsets = new DomSourceRange(
264 $dp->tsr->start, $dp->tsr->end,
265 $dp->tsr->length(), 0
266 );
267 if ( $isIncludeTag ) {
268 return $t;
269 }
270 break;
271
272 case TagTk::class:
273 $endTagRE = '~.*?(</' . preg_quote( $tagName, '~' ) . '\s*>)~iusA';
274 $tagContentFound = preg_match( $endTagRE, $this->input, $tagContent, 0, $dp->tsr->start );
275
276 if ( !$tagContentFound ) {
277 $dp->src = $dp->tsr->substr( $this->input );
278 $dp->extTagOffsets = new DomSourceRange(
279 $dp->tsr->start, $dp->tsr->end,
280 $dp->tsr->length(), 0
281 );
282 if ( $isIncludeTag ) {
283 return $t;
284 } else {
285 // This is undefined behaviour. The old parser currently
286 // returns text here (see core commit 674e8388cba),
287 // whereas this results in unclosed
288 // extension tags that shadow html tags falling back to
289 // their html equivalent. The sanitizer will take care
290 // of converting to text where necessary. We do this to
291 // simplify `hasWikitextTokens` when escaping wikitext,
292 // which wants these as tokens because it's otherwise
293 // lacking in context.
294 return $t; // not text()
295 }
296 }
297
298 $extSrc = $tagContent[0];
299 $extEndOffset = $dp->tsr->start + strlen( $extSrc );
300 $extEndTagWidth = strlen( $tagContent[1] );
301
302 if ( !empty( $this->pipelineOpts['inTemplate'] ) ) {
303 // Support nesting in extensions tags while tokenizing in templates
304 // to support the #tag parser function.
305 //
306 // It's necessary to permit this broadly in templates because
307 // there's no way to distinguish whether the nesting happened
308 // while expanding the #tag parser function, or just a general
309 // syntax errors. In other words,
310 //
311 // hi<ref>ho<ref>hi</ref>ho</ref>
312 //
313 // and
314 //
315 // hi{{#tag:ref|ho<ref>hi</ref>ho}}
316 //
317 // found in template are returned indistinguishably after a
318 // preprocessing request, though the old parser renders them
319 // differently. #tag in template is probably a common enough
320 // use case that we want to accept these false positives,
321 // though another approach could be to drop this code here, and
322 // invoke a native #tag handler and forgo those in templates.
323 //
324 // Expand `extSrc` as long as there is a <tagName> found in the
325 // extension source body.
326 $startTagRE = '~<' . preg_quote( $tagName, '~' ) . '(?:[^/>]|/(?!>))*>~i';
327 $s = substr( $extSrc, $dp->tsr->end - $dp->tsr->start );
328 $openTags = 0;
329 while ( true ) {
330 if ( preg_match_all( $startTagRE, $s, $matches ) ) {
331 $openTags += count( $matches[0] );
332 }
333 if ( !$openTags ) {
334 break;
335 }
336 if ( !preg_match( $endTagRE, $this->input, $tagContent, 0, $extEndOffset ) ) {
337 break;
338 }
339 $openTags -= 1;
340 $s = $tagContent[0];
341 $extEndOffset += strlen( $s );
342 $extEndTagWidth = strlen( $tagContent[1] );
343 $extSrc .= $s;
344 }
345 }
346
347 // Extension content source
348 $dp->src = $extSrc;
349 $dp->extTagOffsets = new DomSourceRange(
350 $dp->tsr->start, $extEndOffset,
351 $dp->tsr->length(), $extEndTagWidth
352 );
353
354 $skipPos = $dp->extTagOffsets->innerEnd();
355
356 // If the xml-tag is a known installed (not native) extension,
357 // skip the end-tag as well.
358 if ( $isInstalledExt ) {
359 $skipPos = $dp->extTagOffsets->end;
360 }
361 break;
362
363 default:
364 $this->unreachable();
365 }
366
367 $this->currPos = $skipPos;
368
369 if ( $isInstalledExt ) {
370 // update tsr->end to span the start and end tags.
371 $dp->tsr->end = $this->endOffset(); // was just modified above
372 return new SelfclosingTagTk( 'extension', [
373 new KV( 'typeof', 'mw:Extension' ),
374 new KV( 'name', $tagName ),
375 new KV( 'about', $this->env->newAboutId() ),
376 new KV( 'source', $dp->src ),
377 new KV( 'options', $t->attribs )
378 ], $dp
379 );
380 } elseif ( $isIncludeTag ) {
381 // Parse ext-content, strip eof, and shift tsr
382 $extContent = $dp->extTagOffsets->stripTags( $dp->src );
383 $tokenizer = new PegTokenizer( $this->env );
384 $tokenizer->setSourceOffsets( new SourceRange( $dp->extTagOffsets->innerStart(), $dp->extTagOffsets->innerEnd() ) );
385 $extContentToks = $tokenizer->tokenizeSync( $extContent, [ 'sol' => true ] );
386 if ( $dp->extTagOffsets->closeWidth > 0 ) {
387 TokenUtils::stripEOFTkFromTokens( $extContentToks );
388 }
389 array_unshift( $extContentToks, $t );
390 return $extContentToks;
391 } else {
392 $this->unreachable();
393 }
394 }
395
396
397 // cache init
398 protected $cache = [];
399
400 // expectations
401 protected $expectations = [
402 0 => ["type" => "end", "description" => "end of input"],
403 1 => ["type" => "other", "description" => "start"],
404 2 => ["type" => "other", "description" => "table_start_tag"],
405 3 => ["type" => "class", "value" => "['{]", "description" => "['{]"],
406 4 => ["type" => "literal", "value" => "&", "description" => "\"&\""],
407 5 => ["type" => "other", "description" => "table_attributes"],
408 6 => ["type" => "other", "description" => "generic_newline_attributes"],
409 7 => ["type" => "any", "description" => "any character"],
410 8 => ["type" => "other", "description" => "extlink"],
411 9 => ["type" => "other", "description" => "tlb"],
412 10 => ["type" => "class", "value" => "[ \\t]", "description" => "[ \\t]"],
413 11 => ["type" => "literal", "value" => "<!--", "description" => "\"<!--\""],
414 12 => ["type" => "literal", "value" => "-->", "description" => "\"-->\""],
415 13 => ["type" => "literal", "value" => "|", "description" => "\"|\""],
416 14 => ["type" => "literal", "value" => "{{!}}", "description" => "\"{{!}}\""],
417 15 => ["type" => "literal", "value" => "//", "description" => "\"//\""],
418 16 => ["type" => "class", "value" => "[A-Za-z]", "description" => "[A-Za-z]"],
419 17 => ["type" => "class", "value" => "[-A-Za-z0-9+.]", "description" => "[-A-Za-z0-9+.]"],
420 18 => ["type" => "literal", "value" => ":", "description" => "\":\""],
421 19 => ["type" => "literal", "value" => "[", "description" => "\"[\""],
422 20 => ["type" => "class", "value" => "[0-9A-Fa-f:.]", "description" => "[0-9A-Fa-f:.]"],
423 21 => ["type" => "literal", "value" => "]", "description" => "\"]\""],
424 22 => ["type" => "class", "value" => "[^ \\]\\[\\r\\n\"'<>\\x00-\\x20\\x7f&\\u00A0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000{]", "description" => "[^ \\]\\[\\r\\n\"'<>\\x00-\\x20\\x7f&\\u00A0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000{]"],
425 23 => ["type" => "literal", "value" => "=", "description" => "\"=\""],
426 24 => ["type" => "class", "value" => "[\\0/=>]", "description" => "[\\0/=>]"],
427 25 => ["type" => "class", "value" => "[ \\u00A0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]", "description" => "[ \\u00A0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]"],
428 26 => ["type" => "literal", "value" => ";", "description" => "\";\""],
429 27 => ["type" => "literal", "value" => "\x0a", "description" => "\"\\n\""],
430 28 => ["type" => "literal", "value" => "\x0d\x0a", "description" => "\"\\r\\n\""],
431 29 => ["type" => "literal", "value" => "{", "description" => "\"{\""],
432 30 => ["type" => "class", "value" => "[#0-9a-zA-Z\u{5e8}\u{5dc}\u{5de}\u{631}\u{644}\u{645}]", "description" => "[#0-9a-zA-Z\u{5e8}\u{5dc}\u{5de}\u{631}\u{644}\u{645}]"],
433 31 => ["type" => "class", "value" => "[\"'=]", "description" => "[\"'=]"],
434 32 => ["type" => "class", "value" => "[^ \\t\\r\\n\\0/=><&{}\\-!|\\[]", "description" => "[^ \\t\\r\\n\\0/=><&{}\\-!|\\[]"],
435 33 => ["type" => "literal", "value" => "'", "description" => "\"'\""],
436 34 => ["type" => "literal", "value" => "\"", "description" => "\"\\\"\""],
437 35 => ["type" => "literal", "value" => "/", "description" => "\"/\""],
438 36 => ["type" => "class", "value" => "[^ \\t\\r\\n\\0/=><&{}\\-!|]", "description" => "[^ \\t\\r\\n\\0/=><&{}\\-!|]"],
439 37 => ["type" => "class", "value" => "[ \\t\\n\\r\\x0c]", "description" => "[ \\t\\n\\r\\x0c]"],
440 38 => ["type" => "class", "value" => "[^<[{\\n\\r|!\\]}\\-\\t&=\"' \\u00A0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000]", "description" => "[^<[{\\n\\r|!\\]}\\-\\t&=\"' \\u00A0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000]"],
441 39 => ["type" => "class", "value" => "[&|{\\-!}=]", "description" => "[&|{\\-!}=]"],
442 40 => ["type" => "class", "value" => "[']", "description" => "[']"],
443 41 => ["type" => "literal", "value" => "[[", "description" => "\"[[\""],
444 42 => ["type" => "class", "value" => "[*#:;]", "description" => "[*#:;]"],
445 43 => ["type" => "literal", "value" => "{{", "description" => "\"{{\""],
446 44 => ["type" => "literal", "value" => "<", "description" => "\"<\""],
447 45 => ["type" => "class", "value" => "[^{}&<\\-!\\['\\r\\n|]", "description" => "[^{}&<\\-!\\['\\r\\n|]"],
448 46 => ["type" => "class", "value" => "[{}&<\\-!\\[]", "description" => "[{}&<\\-!\\[]"],
449 47 => ["type" => "class", "value" => "[^{}&<\\-!\\[\"\\r\\n|]", "description" => "[^{}&<\\-!\\[\"\\r\\n|]"],
450 48 => ["type" => "class", "value" => "[^{}&<\\-!\\[ \\t\\n\\r\\x0c|]", "description" => "[^{}&<\\-!\\[ \\t\\n\\r\\x0c|]"],
451 49 => ["type" => "class", "value" => "[^{}&<\\-|/'>]", "description" => "[^{}&<\\-|/'>]"],
452 50 => ["type" => "class", "value" => "[{}&\\-|/]", "description" => "[{}&\\-|/]"],
453 51 => ["type" => "class", "value" => "[^{}&<\\-|/\">]", "description" => "[^{}&<\\-|/\">]"],
454 52 => ["type" => "class", "value" => "[^{}&<\\-|/ \\t\\n\\r\\x0c>]", "description" => "[^{}&<\\-|/ \\t\\n\\r\\x0c>]"],
455 53 => ["type" => "literal", "value" => "__", "description" => "\"__\""],
456 54 => ["type" => "class", "value" => "[^-'<[{\\n\\r:;\\]}|!=]", "description" => "[^-'<[{\\n\\r:;\\]}|!=]"],
457 55 => ["type" => "literal", "value" => "-", "description" => "\"-\""],
458 56 => ["type" => "literal", "value" => "''", "description" => "\"''\""],
459 57 => ["type" => "literal", "value" => "}", "description" => "\"}\""],
460 58 => ["type" => "class", "value" => "[ \\t\\n\\r\\0\\x0b]", "description" => "[ \\t\\n\\r\\0\\x0b]"],
461 59 => ["type" => "literal", "value" => "----", "description" => "\"----\""],
462 60 => ["type" => "literal", "value" => "{{{", "description" => "\"{{{\""],
463 61 => ["type" => "literal", "value" => "}}}", "description" => "\"}}}\""],
464 62 => ["type" => "literal", "value" => "}}", "description" => "\"}}\""],
465 63 => ["type" => "literal", "value" => "]]", "description" => "\"]]\""],
466 64 => ["type" => "literal", "value" => ">", "description" => "\">\""],
467 65 => ["type" => "literal", "value" => "/>", "description" => "\"/>\""],
468 66 => ["type" => "class", "value" => "[0-9]", "description" => "[0-9]"],
469 67 => ["type" => "literal", "value" => "ISBN", "description" => "\"ISBN\""],
470 68 => ["type" => "class", "value" => "[xX]", "description" => "[xX]"],
471 69 => ["type" => "literal", "value" => "+", "description" => "\"+\""],
472 70 => ["type" => "class", "value" => "[^<[{\\n\\r\\t|!\\]}{ &\\-]", "description" => "[^<[{\\n\\r\\t|!\\]}{ &\\-]"],
473 71 => ["type" => "class", "value" => "[!<\\-\\}\\]\\n\\r]", "description" => "[!<\\-\\}\\]\\n\\r]"],
474 72 => ["type" => "class", "value" => "[^\\t\\n\\v />\\0]", "description" => "[^\\t\\n\\v />\\0]"],
475 73 => ["type" => "literal", "value" => "RFC", "description" => "\"RFC\""],
476 74 => ["type" => "literal", "value" => "PMID", "description" => "\"PMID\""],
477 75 => ["type" => "literal", "value" => "-{", "description" => "\"-{\""],
478 76 => ["type" => "literal", "value" => "}-", "description" => "\"}-\""],
479 77 => ["type" => "literal", "value" => "!", "description" => "\"!\""],
480 78 => ["type" => "literal", "value" => "!!", "description" => "\"!!\""],
481 79 => ["type" => "literal", "value" => "||", "description" => "\"||\""],
482 80 => ["type" => "literal", "value" => "{{!}}{{!}}", "description" => "\"{{!}}{{!}}\""],
483 81 => ["type" => "literal", "value" => "=>", "description" => "\"=>\""],
484 82 => ["type" => "class", "value" => "[-+A-Z]", "description" => "[-+A-Z]"],
485 83 => ["type" => "class", "value" => "[^{}|;]", "description" => "[^{}|;]"],
486 84 => ["type" => "class", "value" => "[a-z]", "description" => "[a-z]"],
487 85 => ["type" => "class", "value" => "[-a-zA-Z]", "description" => "[-a-zA-Z]"],
488 ];
489
490 // actions
491 private function a0() {
492
493 $this->startTime = null;
494 if ( $this->env->profiling() ) {
495 $profile = $this->env->getCurrentProfile();
496 $this->startTime = microtime( true );
497 }
498 return true;
499
500 }
501 private function a1($t) {
502
503 if ( $this->env->profiling() ) {
504 $profile = $this->env->getCurrentProfile();
505 $profile->bumpTimeUse(
506 'PEG', 1000 * ( microtime( true ) - $this->startTime ), 'PEG' );
507 }
508 return true;
509
510 }
511 private function a2($t) {
512 return $t;
513 }
514 private function a3() {
515
516 // "tlb" matches "block" matches "sol" matches "newlineToken"
517 // But, "tlb" is prefixed with a !eof clause, so, we should only
518 // get here on eof. So, safe to unconditionally terminate the
519 // generator loop here.
520 return false;
521
522 }
523 private function a4($t, $n) {
524
525 if ( count( $t ) ) {
526 $ret = TokenizerUtils::flattenIfArray( $t );
527 } else {
528 $ret = [];
529 }
530 if ( count( $n ) ) {
531 PHPUtils::pushArray($ret, $n);
532 }
533 $ret[] = new EOFTk();
534 return $ret;
535
536 }
537 private function a5($sc) {
538 return $this->endOffset();
539 }
540 private function a6($sc, $startPos, $b, $p) {
541 $this->unreachable();
542 }
543 private function a7($sc, $startPos, $b, $p, $ta) {
544 return $this->endOffset();
545 }
546 private function a8($sc, $startPos, $b, $p, $ta, $tsEndPos, $s2) {
547
548 $coms = TokenizerUtils::popComments( $ta );
549 if ( $coms ) {
550 $tsEndPos = $coms['commentStartPos'];
551 }
552
553 $dp = new DataParsoid;
554 $dp->tsr = new SourceRange( $startPos, $tsEndPos );
555 if ( $p !== '|' ) {
556 // Variation from default
557 $dp->startTagSrc = $b . $p;
558 }
559
560 return array_merge( $sc,
561 [ new TagTk( 'table', $ta, $dp ) ],
562 $coms ? $coms['buf'] : [],
563 $s2 );
564
565 }
566 private function a9($proto, $addr, $he) {
567 return $he;
568 }
569 private function a10($proto, $addr, $r) {
570 return $r;
571 }
572 private function a11($proto, $addr, $c) {
573 return $c;
574 }
575 private function a12($proto, $addr, $path) {
576 return $addr !== '' || count( $path ) > 0;
577 }
578 private function a13($proto, $addr, $path) {
579
580 return TokenizerUtils::flattenString( array_merge( [ $proto, $addr ], $path ) );
581
582 }
583 private function a14($as, $s, $p) {
584
585 return [ $as, $s, $p ];
586
587 }
588 private function a15($b) {
589 return $b;
590 }
591 private function a16($r) {
592 return TokenizerUtils::flattenIfArray( $r );
593 }
594 private function a17() {
595 return $this->endOffset();
596 }
597 private function a18($p0, $addr, $target) {
598 return TokenizerUtils::flattenString( [ $addr, $target ] );
599 }
600 private function a19($p0, $flat) {
601
602 // Protocol must be valid and there ought to be at least one
603 // post-protocol character. So strip last char off target
604 // before testing protocol.
605 if ( is_array( $flat ) ) {
606 // There are templates present, alas.
607 return count( $flat ) > 0;
608 }
609 return Utils::isProtocolValid( substr( $flat, 0, -1 ), $this->env );
610
611 }
612 private function a20($p0, $flat) {
613 return $this->endOffset();
614 }
615 private function a21($p0, $flat, $p1, $sp) {
616 return $this->endOffset();
617 }
618 private function a22($p0, $flat, $p1, $sp, $p2, $content) {
619 return $this->endOffset();
620 }
621 private function a23($p0, $flat, $p1, $sp, $p2, $content, $p3) {
622
623 $tsr1 = new SourceRange( $p0, $p1 );
624 $tsr2 = new SourceRange( $p2, $p3 );
625 $dp = new DataParsoid;
626 $dp->tsr = $this->tsrOffsets();
627 $dp->getTemp()->extLinkContentOffsets = $tsr2;
628 return [
629 new SelfclosingTagTk(
630 'extlink',
631 [
632 new KV( 'href', $flat, $tsr1->expandTsrV() ),
633 new KV( 'mw:content', $content ?? '', $tsr2->expandTsrV() ),
634 new KV( 'spaces', $sp )
635 ],
636 $dp
637 )
638 ];
639 }
640 private function a24($r) {
641 return $r;
642 }
643 private function a25($b) {
644
645 // Clear the tokenizer's backtracking cache after matching each
646 // toplevelblock. There won't be any backtracking as a document is just a
647 // sequence of toplevelblocks, so the cache for previous toplevelblocks
648 // will never be needed.
649 $end = $this->startOffset();
650 for ( ; $this->prevOffset < $end; $this->prevOffset++ ) {
651 unset( $this->cache[$this->prevOffset] );
652 }
653
654 $tokens = null;
655 if ( is_array( $b ) && count( $b ) ) {
656 $tokens = TokenizerUtils::flattenIfArray( $b );
657 } elseif ( is_string( $b ) ) {
658 $tokens = [ $b ];
659 }
660
661 // Emit tokens for this toplevelblock. This feeds a chunk to the parser pipeline.
662 return $this->emitChunk( $tokens );
663
664 }
665 private function a26() {
666 return [ new NlTk( $this->tsrOffsets() ) ];
667 }
668 private function a27($c, $cEnd) {
669
670 $data = WTUtils::encodeComment( $c );
671 $dp = new DataParsoid;
672 $dp->tsr = $this->tsrOffsets();
673 if ( $cEnd !== '-->' ) {
674 $dp->unclosedComment = true;
675 }
676 return [ new CommentTk( $data, $dp ) ];
677
678 }
679 private function a28($p) {
680 return Utils::isProtocolValid( $p, $this->env );
681 }
682 private function a29($p) {
683 return $p;
684 }
685 private function a30($annOrExtTag, $h, $extlink, $intemplate, &$preproc, $equal, $table, $templateArg, $tableCellArg, $semicolon, $arrow, $linkdesc, $colon, &$th) {
686
687 return TokenizerUtils::inlineBreaks( $this->input, $this->endOffset(), [
688 'annOrExtTag' => $annOrExtTag,
689 'h' => $h,
690 'extlink' => $extlink,
691 'intemplate' => $intemplate,
692 'preproc' => $preproc,
693 'equal' => $equal,
694 'table' => $table,
695 'templateArg' => $templateArg,
696 'tableCellArg' => $tableCellArg,
697 'semicolon' => $semicolon,
698 'arrow' => $arrow,
699 'linkdesc' => $linkdesc,
700 'colon' => $colon,
701 'th' => $th
702 ], $this->env );
703
704 }
705 private function a31($t) {
706
707 return $t;
708
709 }
710 private function a32($cc) {
711
712 // if this is an invalid entity, don't tag it with 'mw:Entity'
713 // note that some entities (like &acE;) decode to 2 codepoints!
714 if ( mb_strlen( $cc ) > 2 /* decoded entity would be 1-2 codepoints */ ) {
715 return $cc;
716 }
717 $dpStart = new DataParsoid;
718 $dpStart->src = $this->text();
719 $dpStart->srcContent = $cc;
720 $dpStart->tsr = $this->tsrOffsets( 'start' );
721 $dpEnd = new DataParsoid;
722 $dpEnd->tsr = $this->tsrOffsets( 'end' );
723 return [
724 // If this changes, the nowiki extension's toDOM will need to follow suit
725 new TagTk( 'span', [ new KV( 'typeof', 'mw:Entity' ) ], $dpStart ),
726 $cc,
727 new EndTagTk( 'span', [], $dpEnd )
728 ];
729
730 }
731 private function a33($s) {
732 return $this->endOffset();
733 }
734 private function a34($s, $namePos0, $name) {
735 return $this->endOffset();
736 }
737 private function a35($s, $namePos0, $name, $namePos1, $v) {
738 return $v;
739 }
740 private function a36($s, $namePos0, $name, $namePos1, $vd) {
741
742 // NB: Keep in sync w/ generic_newline_attribute
743 $res = null;
744 // Encapsulate protected attributes.
745 if ( gettype( $name ) === 'string' ) {
746 $name = TokenizerUtils::protectAttrs( $name );
747 }
748 $nameSO = new SourceRange( $namePos0, $namePos1 );
749 if ( $vd !== null ) {
750 $res = new KV( $name, $vd['value'], $nameSO->join( $vd['srcOffsets'] ) );
751 $res->vsrc = $vd['srcOffsets']->substr( $this->input );
752 } else {
753 $res = new KV( $name, '', $nameSO->expandTsrK() );
754 }
755 if ( is_array( $name ) ) {
756 $res->ksrc = $nameSO->substr( $this->input );
757 }
758 return $res;
759
760 }
761 private function a37($s) {
762
763 if ( $s !== '' ) {
764 return [ $s ];
765 } else {
766 return [];
767 }
768
769 }
770 private function a38($c) {
771 return new KV( $c, '' );
772 }
773 private function a39($namePos0, $name) {
774 return $this->endOffset();
775 }
776 private function a40($namePos0, $name, $namePos1, $v) {
777 return $v;
778 }
779 private function a41($namePos0, $name, $namePos1, $vd) {
780
781 // NB: Keep in sync w/ table_attibute
782 $res = null;
783 // Encapsulate protected attributes.
784 if ( is_string( $name ) ) {
785 $name = TokenizerUtils::protectAttrs( $name );
786 }
787 $nameSO = new SourceRange( $namePos0, $namePos1 );
788 if ( $vd !== null ) {
789 $res = new KV( $name, $vd['value'], $nameSO->join( $vd['srcOffsets'] ) );
790 $res->vsrc = $vd['srcOffsets']->substr( $this->input );
791 } else {
792 $res = new KV( $name, '', $nameSO->expandTsrK() );
793 }
794 if ( is_array( $name ) ) {
795 $res->ksrc = $nameSO->substr( $this->input );
796 }
797 return $res;
798
799 }
800 private function a42($s) {
801 return $s;
802 }
803 private function a43($c) {
804
805 return TokenizerUtils::flattenStringlist( $c );
806
807 }
808 private function a44($lc) {
809 return $lc;
810 }
811 private function a45($bullets, $colons, $d) {
812
813 $bulletToks = [];
814 // Leave bullets as an array -- list handler expects this
815 // TSR: +1 for the leading ";"
816 $numBullets = count( $bullets ) + 1;
817 $tsr = $this->tsrOffsets( 'start' );
818 $tsr->end += $numBullets;
819 $li1Bullets = $bullets;
820 $li1Bullets[] = ';';
821 $dp = new DataParsoid;
822 $dp->tsr = $tsr;
823 $bulletToks[] = new TagTk( 'listItem', [ new KV( 'bullets', $li1Bullets, $tsr->expandTsrV() ) ], $dp );
824 foreach ( $colons as $colon) {
825 if ( $colon[0] ) { // can be null because of "?" in dtdd_colon
826 $bulletToks[] = $colon[0];
827 }
828 $cpos = $colon[1];
829 // TSR: -1 for the intermediate ":"
830 $li2Bullets = $bullets;
831 $li2Bullets[] = ':';
832 $tsr2 = new SourceRange( $cpos - 1, $cpos );
833 $dp2 = new DataParsoid;
834 $dp2->tsr = $tsr2;
835 $dp2->stx = 'row';
836 $bulletToks[] = new TagTk( 'listItem', [ new KV( 'bullets', $li2Bullets, $tsr2->expandTsrV() ) ], $dp2 );
837 }
838
839 if ( $d ) {
840 $bulletToks = array_merge( $bulletToks, $d );
841 }
842 return $bulletToks;
843
844 }
845 private function a46($bullets, $tbl, $line) {
846
847 // Leave bullets as an array -- list handler expects this
848 $tsr = $this->tsrOffsets( 'start' );
849 $tsr->end += count( $bullets );
850 $dp = new DataParsoid;
851 $dp->tsr = $tsr;
852 $li = new TagTk( 'listItem', [ new KV( 'bullets', $bullets, $tsr->expandTsrV() ) ], $dp );
853 return TokenizerUtils::flattenIfArray( [ $li, $tbl, $line ?: [] ] );
854
855 }
856 private function a47($bullets, $c) {
857
858 // Leave bullets as an array -- list handler expects this
859 $tsr = $this->tsrOffsets( 'start' );
860 $tsr->end += count( $bullets );
861 $dp = new DataParsoid;
862 $dp->tsr = $tsr;
863 $li = new TagTk( 'listItem', [ new KV( 'bullets', $bullets, $tsr->expandTsrV() ) ], $dp );
864 return array_merge( [ $li ], $c ?: [] );
865
866 }
867 private function a48() {
868 return $this->endOffset() === $this->inputLength;
869 }
870 private function a49($r, $cil, $bl) {
871
872 return array_merge( [ $r ], $cil, $bl ?: [] );
873
874 }
875 private function a50($a) {
876 return $a;
877 }
878 private function a51($a, $b) {
879 return [ $a, $b ];
880 }
881 private function a52($m) {
882
883 return Utils::decodeWtEntities( $m );
884
885 }
886 private function a53($q, $x, $ill) {
887 return array_merge( $x, $ill ?: [] );
888 }
889 private function a54($q, $t) {
890 return $t;
891 }
892 private function a55($q, $r) {
893 return count( $r ) > 0 || $q !== '';
894 }
895 private function a56($q, $r) {
896
897 array_unshift( $r, $q );
898 return TokenizerUtils::flattenString( $r );
899
900 }
901 private function a57($s, $t, $q) {
902
903 return TokenizerUtils::getAttrVal( $t, $this->startOffset() + strlen( $s ), $this->endOffset() - strlen( $q ) );
904
905 }
906 private function a58($s, $t) {
907
908 return TokenizerUtils::getAttrVal( $t, $this->startOffset() + strlen( $s ), $this->endOffset() );
909
910 }
911 private function a59($r) {
912
913 return TokenizerUtils::flattenString( $r );
914
915 }
916 private function a60() {
917
918 if ( preg_match( $this->reUrltextLookahead, $this->input, $m, 0, $this->currPos ) ) {
919 $plain = $m[1];
920 $this->urltextPlainSegment = $plain;
921 $this->urltextFoundAutolink = ( $m[2] ?? '' ) !== '';
922 return (bool)strlen( $plain );
923 } else {
924 $this->urltextFoundAutolink = false;
925 return false;
926 }
927
928 }
929 private function a61() {
930
931 $this->currPos += strlen( $this->urltextPlainSegment );
932 return $this->urltextPlainSegment;
933
934 }
935 private function a62() {
936 return $this->urltextFoundAutolink;
937 }
938 private function a63($al) {
939 return $al;
940 }
941 private function a64($he) {
942 return $he;
943 }
944 private function a65($bs) {
945 return $bs;
946 }
947 private function a66($c) {
948 return $this->endOffset();
949 }
950 private function a67($c, $cpos) {
951
952 return [ $c, $cpos ];
953
954 }
955 private function a68($tl) {
956
957 return $tl;
958
959 }
960 private function a69() {
961 return $this->endOffset() === 0 && !$this->pipelineOffset;
962 }
963 private function a70($rw, $sp, $c, $wl) {
964
965 return count( $wl ) === 1 && $wl[0] instanceof Token;
966
967 }
968 private function a71($rw, $sp, $c, $wl) {
969
970 $link = $wl[0];
971 if ( $sp ) {
972 $rw .= $sp;
973 }
974 if ( $c ) {
975 $rw .= $c;
976 }
977 // Build a redirect token
978 $dp = new DataParsoid;
979 $dp->src = $rw;
980 $dp->tsr = $this->tsrOffsets();
981 $dp->linkTk = $link;
982 $redirect = new SelfclosingTagTk( 'mw:redirect',
983 // Put 'href' into attributes so it gets template-expanded
984 [ $link->getAttributeKV( 'href' ) ],
985 $dp
986 );
987 return $redirect;
988
989 }
990 private function a72($st, $tl) {
991
992 return array_merge( $st, $tl );
993
994 }
995 private function a73($s, $os, $so) {
996 return array_merge( $os, $so );
997 }
998 private function a74($s, $s2, $bl) {
999
1000 return array_merge( $s, $s2 ?: [], $bl );
1001
1002 }
1003 private function a75(&$preproc, $t) {
1004
1005 $preproc = null;
1006 return $t;
1007
1008 }
1009 private function a76($v) {
1010 return $v;
1011 }
1012 private function a77($e) {
1013 return $e;
1014 }
1015 private function a78($tag) {
1016 return $tag;
1017 }
1018 private function a79() {
1019 return Utils::isUniWord(Utils::lastUniChar( $this->input, $this->endOffset() ) );
1020 }
1021 private function a80($bs) {
1022
1023 if ( $this->siteConfig->isBehaviorSwitch( $bs ) ) {
1024 $dp = new DataParsoid;
1025 $dp->tsr = $this->tsrOffsets();
1026 $dp->src = $bs;
1027 $dp->magicSrc = $bs;
1028 return [
1029 new SelfclosingTagTk( 'behavior-switch', [ new KV( 'word', $bs ) ], $dp )
1030 ];
1031 } else {
1032 return [ $bs ];
1033 }
1034
1035 }
1036 private function a81($quotes) {
1037
1038 // sequences of four or more than five quotes are assumed to start
1039 // with some number of plain-text apostrophes.
1040 $plainticks = 0;
1041 $result = [];
1042 if ( strlen( $quotes ) === 4 ) {
1043 $plainticks = 1;
1044 } elseif ( strlen( $quotes ) > 5 ) {
1045 $plainticks = strlen( $quotes ) - 5;
1046 }
1047 if ( $plainticks > 0 ) {
1048 $result[] = substr( $quotes, 0, $plainticks );
1049 }
1050 // mw-quote token will be consumed in token transforms
1051 $tsr = $this->tsrOffsets();
1052 $tsr->start += $plainticks;
1053 $dp = new DataParsoid;
1054 $dp->tsr = $tsr;
1055 $mwq = new SelfclosingTagTk( 'mw-quote',
1056 [ new KV( 'value', substr( $quotes, $plainticks ) ) ],
1057 $dp );
1058 if ( strlen( $quotes ) > 2 ) {
1059 $mwq->addAttribute( 'isSpace_1', $tsr->start > 0 && substr( $this->input, $tsr->start - 1, 1 ) === ' ');
1060 $mwq->addAttribute( 'isSpace_2', $tsr->start > 1 && substr( $this->input, $tsr->start - 2, 1 ) === ' ');
1061 }
1062 $result[] = $mwq;
1063 return $result;
1064
1065 }
1066 private function a82($sc, $startPos, $p, $b) {
1067
1068 $dp = new DataParsoid;
1069 $dp->tsr = new SourceRange( $startPos, $this->endOffset() );
1070 $tblEnd = new EndTagTk( 'table', [], $dp );
1071 if ( $p !== '|' ) {
1072 // p+"<brace-char>" is triggering some bug in pegJS
1073 // I cannot even use that expression in the comment!
1074 $tblEnd->dataParsoid->endTagSrc = $p . $b;
1075 }
1076 array_push( $sc, $tblEnd );
1077 return $sc;
1078
1079 }
1080 private function a83($sp) {
1081 return $this->endOffset();
1082 }
1083 private function a84($sp, $p, $c) {
1084
1085 $dp = new DataParsoid;
1086 $dp->tsr = new SourceRange( $p, $this->endOffset() );
1087 $dp->tokens = TokenizerUtils::flattenIfArray( $c );
1088 return [
1089 $sp,
1090 new SelfclosingTagTk( 'meta', [ new KV( 'typeof', 'mw:EmptyLine' ) ], $dp )
1091 ];
1092
1093 }
1094 private function a85() {
1095
1096 // Use the sol flag only at the start of the input
1097 // Flag should always be an actual boolean (not falsy or undefined)
1098 $this->assert( is_bool( $this->options['sol'] ), 'sol should be boolean' );
1099 return $this->endOffset() === 0 && $this->options['sol'];
1100
1101 }
1102 private function a86() {
1103
1104 return [];
1105
1106 }
1107 private function a87($rw) {
1108
1109 return preg_match( $this->env->getSiteConfig()->getMagicWordMatcher( 'redirect' ), $rw );
1110
1111 }
1112 private function a88($il, $sol_il) {
1113
1114 $il = $il[0];
1115 $lname = mb_strtolower( $il->getName() );
1116 if ( !WTUtils::isIncludeTag( $lname ) ) { return false; }
1117 // Preserve SOL where necessary (for onlyinclude and noinclude)
1118 // Note that this only works because we encounter <*include*> tags in
1119 // the toplevel content and we rely on the php preprocessor to expand
1120 // templates, so we shouldn't ever be tokenizing inInclude.
1121 // Last line should be empty (except for comments)
1122 if ( $lname !== 'includeonly' && $sol_il && $il instanceof TagTk ) {
1123 $dp = $il->dataParsoid;
1124 $inclContent = $dp->extTagOffsets->stripTags( $dp->src );
1125 $nlpos = strrpos( $inclContent, "\n" );
1126 $last = $nlpos === false ? $inclContent : substr( $inclContent, $nlpos + 1 );
1127 if ( !preg_match( '/^(<!--([^-]|-(?!->))*-->)*$/D', $last ) ) {
1128 return false;
1129 }
1130 }
1131 return true;
1132
1133 }
1134 private function a89($il, $sol_il) {
1135
1136 return $il;
1137
1138 }
1139 private function a90($annToken) {
1140
1141 return ( $annToken instanceof Token && $annToken->getName() !== 'extension' );
1142
1143 }
1144 private function a91($annToken) {
1145 return $annToken;
1146 }
1147 private function a92($s, $ill) {
1148 return $ill ?: [];
1149 }
1150 private function a93($s, $ce) {
1151 return $ce || strlen( $s ) > 2;
1152 }
1153 private function a94($s, $ce) {
1154 return $this->endOffset();
1155 }
1156 private function a95($s, $ce, $endTPos, $spc) {
1157
1158 $c = null;
1159 $e = null;
1160 $level = null;
1161 if ( $ce ) {
1162 $c = $ce[0];
1163 $e = $ce[1];
1164 $level = min( strlen( $s ), strlen( $e ) );
1165 } else {
1166 // split up equal signs into two equal parts, with at least
1167 // one character in the middle.
1168 $level = (int)floor( ( strlen( $s ) - 1 ) / 2 );
1169 $c = [ str_repeat( '=', strlen( $s ) - 2 * $level ) ];
1170 $s = $e = str_repeat( '=', $level );
1171 }
1172 $level = min( 6, $level );
1173 // convert surplus equals into text
1174 if ( strlen( $s ) > $level ) {
1175 $extras1 = substr( $s, 0, strlen( $s ) - $level );
1176 if ( is_string( $c[0] ) ) {
1177 $c[0] = $extras1 . $c[0];
1178 } else {
1179 array_unshift( $c, $extras1 );
1180 }
1181 }
1182 if ( strlen( $e ) > $level ) {
1183 $extras2 = substr( $e, 0, strlen( $e ) - $level );
1184 $lastElem = PHPUtils::lastItem( $c );
1185 if ( is_string( $lastElem ) ) {
1186 $c[count( $c ) - 1] .= $extras2;
1187 } else {
1188 $c[] = $extras2;
1189 }
1190 }
1191
1192 $tagDP = new DataParsoid;
1193 $tagDP->tsr = $this->tsrOffsets( 'start' );
1194 $tagDP->tsr->end += $level;
1195 // Match the old parser's behavior by
1196 // (a) making headingIndex part of tokenizer state
1197 // (don't reuse pipeline! see $this->resetState above)
1198 // (b) assigning the index when ==*== is tokenized,
1199 // even if we're inside a template argument
1200 // or other context which won't end up putting the heading
1201 // on the output page. T213468/T214538
1202 $this->headingIndex++;
1203 $tagDP->getTemp()->headingIndex = $this->headingIndex;
1204 $res = [ new TagTk( 'h' . $level, [], $tagDP ) ];
1205
1206 PHPUtils::pushArray( $res, $c );
1207
1208 $endTagDP = new DataParsoid;
1209 $endTagDP->tsr = new SourceRange( $endTPos - $level, $endTPos );
1210 $res[] = new EndTagTk( 'h' . $level, [], $endTagDP );
1211 $res[] = $spc;
1212 return $res;
1213
1214 }
1215 private function a96($d) {
1216 return null;
1217 }
1218 private function a97($d) {
1219 return true;
1220 }
1221 private function a98($d, $lineContent) {
1222
1223 $dataParsoid = new DataParsoid;
1224 $dataParsoid->tsr = $this->tsrOffsets();
1225 if ( $lineContent !== null ) {
1226 $dataParsoid->lineContent = $lineContent;
1227 }
1228 if ( strlen( $d ) > 0 ) {
1229 $dataParsoid->extra_dashes = strlen( $d );
1230 }
1231 return [new SelfclosingTagTk( 'hr', [], $dataParsoid )];
1232
1233 }
1234 private function a99($p, $target) {
1235 return $this->endOffset();
1236 }
1237 private function a100($p, $target, $p0, $v) {
1238 return $this->endOffset();
1239 }
1240 private function a101($p, $target, $p0, $v, $p1) {
1241
1242 // empty argument
1243 return [ 'tokens' => $v, 'srcOffsets' => new SourceRange( $p0, $p1 ) ];
1244
1245 }
1246 private function a102($p, $target, $r) {
1247 return $r;
1248 }
1249 private function a103($p, $target, $params) {
1250
1251 $kvs = [];
1252
1253 if ( $target === null ) {
1254 $target = [ 'tokens' => '', 'srcOffsets' => new SourceRange( $p, $p ) ];
1255 }
1256 // Insert target as first positional attribute, so that it can be
1257 // generically expanded. The TemplateHandler then needs to shift it out
1258 // again.
1259 $kvs[] = new KV( TokenizerUtils::flattenIfArray( $target['tokens'] ), '', $target['srcOffsets']->expandTsrK() );
1260
1261 foreach ( $params as $o ) {
1262 $s = $o['srcOffsets'];
1263 $kvs[] = new KV( '', TokenizerUtils::flattenIfArray( $o['tokens'] ), $s->expandTsrV() );
1264 }
1265
1266 $dp = new DataParsoid;
1267 $dp->tsr = $this->tsrOffsets();
1268 $dp->src = $this->text();
1269 $obj = new SelfclosingTagTk( 'templatearg', $kvs, $dp );
1270 return $obj;
1271
1272 }
1273 private function a104($leadWS, $target) {
1274 return $this->endOffset();
1275 }
1276 private function a105($leadWS, $target, $p0, $v) {
1277 return $this->endOffset();
1278 }
1279 private function a106($leadWS, $target, $p0, $v, $p1) {
1280
1281 // empty argument
1282 $tsr0 = new SourceRange( $p0, $p1 );
1283 return new KV( '', TokenizerUtils::flattenIfArray( $v ), $tsr0->expandTsrV() );
1284
1285 }
1286 private function a107($leadWS, $target, $r) {
1287 return $r;
1288 }
1289 private function a108($leadWS, $target, $params, $trailWS) {
1290
1291 // Insert target as first positional attribute, so that it can be
1292 // generically expanded. The TemplateHandler then needs to shift it out
1293 // again.
1294 array_unshift( $params, new KV( TokenizerUtils::flattenIfArray( $target['tokens'] ), '', $target['srcOffsets']->expandTsrK() ) );
1295 $dp = new DataParsoid;
1296 $dp->tsr = $this->tsrOffsets();
1297 $dp->src = $this->text();
1298 $tmp = $dp->getTemp();
1299 $tmp->leadWS = $leadWS;
1300 $tmp->trailWS = $trailWS;
1301 $obj = new SelfclosingTagTk( 'template', $params, $dp );
1302 return $obj;
1303
1304 }
1305 private function a109($spos, $target) {
1306 return $this->endOffset();
1307 }
1308 private function a110($spos, $target, $tpos, $lcs) {
1309
1310 $pipeTrick = count( $lcs ) === 1 && count( $lcs[0]->v ) === 0;
1311 $textTokens = [];
1312 if ( $target === null || $pipeTrick ) {
1313 $textTokens[] = '[[';
1314 if ( $target ) {
1315 $textTokens[] = $target;
1316 }
1317 foreach ( $lcs as $a ) {
1318 // a is a mw:maybeContent attribute
1319 $textTokens[] = '|';
1320 if ( count( $a->v ) > 0 ) {
1321 $textTokens[] = $a->v;
1322 }
1323 }
1324 $textTokens[] = ']]';
1325 return $textTokens;
1326 }
1327 $obj = new SelfclosingTagTk( 'wikilink' );
1328 $tsr = new SourceRange( $spos, $tpos );
1329 $hrefKV = new KV( 'href', $target, $tsr->expandTsrV() );
1330 $hrefKV->vsrc = $tsr->substr( $this->input );
1331 // XXX: Point to object with path, revision and input information
1332 // obj.source = input;
1333 $obj->attribs[] = $hrefKV;
1334 $obj->attribs = array_merge( $obj->attribs, $lcs );
1335 $dp = new DataParsoid;
1336 $dp->tsr = $this->tsrOffsets();
1337 $dp->src = $this->text();
1338 $obj->dataParsoid = $dp;
1339 return [ $obj ];
1340
1341 }
1342 private function a111(&$preproc) {
1343 $preproc = null; return true;
1344 }
1345 private function a112(&$preproc, $a) {
1346
1347 return $a;
1348
1349 }
1350 private function a113($extToken) {
1351 return !$extToken || $extToken[0]->getName() === 'extension' ||
1352 ($extToken[0]->getName() === 'meta' && preg_match( WTUtils::ANNOTATION_META_TYPE_REGEXP, $extToken[0]->getAttributeV( 'typeof' ) ?? '' ) > 0);
1353 }
1354 private function a114($extToken) {
1355 return !$extToken ? '' : $extToken[0];
1356 }
1357 private function a115() {
1358
1359 $this->assert(
1360 $this->input[$this->currPos - 1] === '<',
1361 'Failed to open xmlish_tag before entering.'
1362 );
1363 return true;
1364
1365 }
1366 private function a116($end, $name, $annOrExtTag) {
1367
1368 if ( $annOrExtTag ) {
1369 return WTUtils::isAnnOrExtTag( $this->env, $name );
1370 } else {
1371 // Only enforce ascii alpha first char for non-extension tags.
1372 // See tag_name above for the details.
1373 return preg_match( '/^[A-Za-z]/', $name ) && $this->isXMLTag( $name );
1374 }
1375
1376 }
1377 private function a117($end, $name, $annOrExtTag, $attribs, $selfclose) {
1378
1379 $lcName = mb_strtolower( $name );
1380
1381 // Extension tags don't necessarily have the same semantics as html tags,
1382 // so don't treat them as void elements.
1383 $isVoidElt = Utils::isVoidElement( $lcName ) && !$annOrExtTag;
1384
1385 // Support </br>
1386 if ( $lcName === 'br' && $end ) {
1387 $end = null;
1388 }
1389
1390 $tsr = $this->tsrOffsets();
1391 $tsr->start--; // For "<" matched at the start of xmlish_tag rule
1392 $res = TokenizerUtils::buildXMLTag( $name, $lcName, $attribs, $end, !!$selfclose || $isVoidElt, $tsr );
1393
1394 // change up data-attribs in one scenario
1395 // void-elts that aren't self-closed ==> useful for accurate RT-ing
1396 if ( !$selfclose && $isVoidElt ) {
1397 unset( $res->dataParsoid->selfClose );
1398 $res->dataParsoid->noClose = true;
1399 }
1400
1401 $met = $this->maybeAnnotationOrExtensionTag( $res, $end, $attribs, $tsr );
1402 return is_array( $met ) ? $met : [ $met ];
1403
1404 }
1405 private function a118() {
1406 return $this->env->hasAnnotations && $this->siteConfig->isAnnotationTag( 'tvar' );
1407 }
1408 private function a119() {
1409
1410 $metaAttrs = [ new KV( 'typeof', 'mw:Annotation/tvar/End' ) ];
1411 $dp = new DataParsoid();
1412 $dp->tsr = $this->tsrOffsets();
1413 $dp->tsr->start--; // For "<" matched at the start of xmlish_tag rule
1414 if ( empty( $this->pipelineOpts['inTemplate'] ) ) {
1415 return [ new SelfclosingTagTk ( 'meta', $metaAttrs, $dp ) ];
1416 } else {
1417 // suppress meta tags from pipeline output
1418 return [];
1419 }
1420
1421 }
1422 private function a120($proto, $addr, $rhe) {
1423 return $rhe === '<' || $rhe === '>' || $rhe === "\u{A0}";
1424 }
1425 private function a121($proto, $addr, $path) {
1426
1427 // as in Parser.php::makeFreeExternalLink, we're going to
1428 // yank trailing punctuation out of this match.
1429 $url = TokenizerUtils::flattenStringlist( array_merge( [ $proto, $addr ], $path ) );
1430 // only need to look at last element; HTML entities are strip-proof.
1431 $last = PHPUtils::lastItem( $url );
1432 $trim = 0;
1433 if ( is_string( $last ) ) {
1434 $strip = TokenizerUtils::getAutoUrlTerminatingChars( in_array( '(', $path, true ) );
1435 $trim = strspn( strrev( $last ), $strip );
1436 $url[ count( $url ) - 1 ] = substr( $last, 0, strlen( $last ) - $trim );
1437 }
1438 $url = TokenizerUtils::flattenStringlist( $url );
1439 if ( count( $url ) === 1 && is_string( $url[0] ) && strlen( $url[0] ) <= strlen( $proto ) ) {
1440 return null; // ensure we haven't stripped everything: T106945
1441 }
1442 $this->currPos -= $trim;
1443 return $url;
1444
1445 }
1446 private function a122($r) {
1447 return $r !== null;
1448 }
1449 private function a123($r) {
1450
1451 $tsr = $this->tsrOffsets();
1452 $dp = new DataParsoid;
1453 $dp->tsr = $tsr;
1454 $res = [ new SelfclosingTagTk( 'urllink', [ new KV( 'href', $r, $tsr->expandTsrV() ) ], $dp ) ];
1455 return $res;
1456
1457 }
1458 private function a124($ref, $sp, $identifier) {
1459
1460 $base_urls = [
1461 'RFC' => 'https://datatracker.ietf.org/doc/html/rfc%s',
1462 'PMID' => '//www.ncbi.nlm.nih.gov/pubmed/%s?dopt=Abstract'
1463 ];
1464 $tsr = $this->tsrOffsets();
1465 $dp = new DataParsoid;
1466 $dp->tsr = $tsr;
1467 $dp->stx = 'magiclink';
1468 $this->env->getDataAccess()->addTrackingCategory(
1469 $this->env->getPageConfig(),
1470 $this->env->getMetadata(),
1471 'magiclink-tracking-' . strtolower($ref)
1472 );
1473 return [
1474 new SelfclosingTagTk( 'extlink', [
1475 new KV( 'href', sprintf( $base_urls[$ref], $identifier ) ),
1476 new KV( 'mw:content', TokenizerUtils::flattenString( [ $ref, $sp, $identifier ] ), $tsr->expandTsrV() ),
1477 new KV( 'typeof', 'mw:ExtLink/' . $ref )
1478 ],
1479 $dp
1480 )
1481 ];
1482
1483 }
1484 private function a125() {
1485 return $this->siteConfig->magicLinkEnabled("ISBN");
1486 }
1487 private function a126($sp, $isbn) {
1488
1489 // Convert isbn token-and-entity array to stripped string.
1490 $stripped = '';
1491 foreach ( TokenizerUtils::flattenStringlist( $isbn ) as $part ) {
1492 if ( is_string( $part ) ) {
1493 $stripped .= $part;
1494 }
1495 }
1496 return strtoupper( preg_replace( '/[^\dX]/i', '', $stripped ) );
1497
1498 }
1499 private function a127($sp, $isbn, $isbncode) {
1500
1501 // ISBNs can only be 10 or 13 digits long (with a specific format)
1502 return strlen( $isbncode ) === 10
1503 || ( strlen( $isbncode ) === 13 && preg_match( '/^97[89]/', $isbncode ) );
1504
1505 }
1506 private function a128($sp, $isbn, $isbncode) {
1507
1508 $tsr = $this->tsrOffsets();
1509 $dp = new DataParsoid;
1510 $dp->stx = 'magiclink';
1511 $dp->tsr = $tsr;
1512 $this->env->getDataAccess()->addTrackingCategory(
1513 $this->env->getPageConfig(),
1514 $this->env->getMetadata(),
1515 'magiclink-tracking-isbn'
1516 );
1517 return [
1518 new SelfclosingTagTk( 'extlink', [
1519 new KV( 'href', 'Special:BookSources/' . $isbncode ),
1520 new KV( 'mw:content', TokenizerUtils::flattenString( [ 'ISBN', $sp, $isbn ] ), $tsr->expandTsrV() ),
1521 new KV( 'typeof', 'mw:WikiLink/ISBN' )
1522 ],
1523 $dp
1524 )
1525 ];
1526
1527 }
1528 private function a129($p, $dashes) {
1529 $this->unreachable();
1530 }
1531 private function a130($p, $dashes, $a) {
1532 return $this->endOffset();
1533 }
1534 private function a131($p, $dashes, $a, $tagEndPos, $s2) {
1535
1536 $coms = TokenizerUtils::popComments( $a );
1537 if ( $coms ) {
1538 $tagEndPos = $coms['commentStartPos'];
1539 }
1540
1541 $da = new DataParsoid;
1542 $da->tsr = new SourceRange( $this->startOffset(), $tagEndPos );
1543 $da->startTagSrc = $p . $dashes;
1544
1545 // We rely on our tree builder to close the row as needed. This is
1546 // needed to support building tables from fragment templates with
1547 // individual cells or rows.
1548 $trToken = new TagTk( 'tr', $a, $da );
1549
1550 return array_merge( [ $trToken ], $coms ? $coms['buf'] : [], $s2 );
1551
1552 }
1553 private function a132($p, $td, $tds) {
1554
1555 // Avoid modifying a cached result
1556 $td[0] = clone $td[0];
1557 $da = $td[0]->dataParsoid = clone $td[0]->dataParsoid;
1558 $da->tsr = clone $da->tsr;
1559 $da->tsr->start -= strlen( $p ); // include "|"
1560 if ( $p !== '|' ) {
1561 // Variation from default
1562 $da->startTagSrc = $p;
1563 }
1564 return array_merge( $td, $tds );
1565
1566 }
1567 private function a133($p, $args) {
1568 return $this->endOffset();
1569 }
1570 private function a134($p, $args, $tagEndPos, $c) {
1571
1572 $tsr = new SourceRange( $this->startOffset(), $tagEndPos );
1573 return TokenizerUtils::buildTableTokens(
1574 'caption', '|+', $args, $tsr, $this->endOffset(), $c, true );
1575
1576 }
1577 private function a135($tpt) {
1578
1579 return [ 'tokens' => $tpt, 'srcOffsets' => $this->tsrOffsets() ];
1580
1581 }
1582 private function a136($name) {
1583 return $this->endOffset();
1584 }
1585 private function a137($name, $kEndPos) {
1586 return $this->endOffset();
1587 }
1588 private function a138($name, $kEndPos, $vStartPos, $optSp, $tpv) {
1589
1590 return [
1591 'kEndPos' => $kEndPos,
1592 'vStartPos' => $vStartPos,
1593 'value' => TokenizerUtils::flattenString( [ $optSp, $tpv['tokens'] ?? [] ] ),
1594 ];
1595
1596 }
1597 private function a139($name, $val) {
1598
1599 if ( $val !== null ) {
1600 if ( $val['value'] !== null ) {
1601 $so = new KVSourceRange(
1602 $this->startOffset(), $val['kEndPos'],
1603 $val['vStartPos'], $this->endOffset()
1604 );
1605 return new KV(
1606 $name,
1607 TokenizerUtils::flattenIfArray( $val['value'] ),
1608 $so
1609 );
1610 } else {
1611 return new KV(
1612 TokenizerUtils::flattenIfArray( $name ),
1613 '',
1614 $so
1615 );
1616 }
1617 } else {
1618 $so = new SourceRange( $this->startOffset(), $this->endOffset() );
1619 return new KV(
1620 '',
1621 TokenizerUtils::flattenIfArray( $name ),
1622 $so->expandTsrV()
1623 );
1624 }
1625
1626 }
1627 private function a140() {
1628
1629 $so = new SourceRange( $this->startOffset(), $this->endOffset() );
1630 return new KV( '', '', $so->expandTsrV() );
1631
1632 }
1633 private function a141($t, $wr) {
1634 return $wr;
1635 }
1636 private function a142($r) {
1637
1638 return TokenizerUtils::flattenStringlist( $r );
1639
1640 }
1641 private function a143($startPos, $lt) {
1642
1643 $tsr = new SourceRange( $startPos, $this->endOffset() );
1644 $maybeContent = new KV( 'mw:maybeContent', $lt ?? [], $tsr->expandTsrV() );
1645 $maybeContent->vsrc = substr( $this->input, $startPos, $this->endOffset() - $startPos );
1646 return $maybeContent;
1647
1648 }
1649 private function a144() {
1650 return $this->siteConfig->magicLinkEnabled("RFC");
1651 }
1652 private function a145() {
1653
1654 return 'RFC';
1655
1656 }
1657 private function a146() {
1658 return $this->siteConfig->magicLinkEnabled("PMID");
1659 }
1660 private function a147() {
1661
1662 return 'PMID';
1663
1664 }
1665 private function a148($he) {
1666 return is_array( $he ) && $he[ 1 ] === "\u{A0}";
1667 }
1668 private function a149() {
1669 return $this->startOffset();
1670 }
1671 private function a150($lv0) {
1672 return $this->env->langConverterEnabled();
1673 }
1674 private function a151($lv0, $ff) {
1675
1676 // if flags contains 'R', then don't treat ; or : specially inside.
1677 if ( isset( $ff['flags'] ) ) {
1678 $ff['raw'] = isset( $ff['flags']['R'] ) || isset( $ff['flags']['N'] );
1679 } elseif ( isset( $ff['variants'] ) ) {
1680 $ff['raw'] = true;
1681 }
1682 return $ff;
1683
1684 }
1685 private function a152($lv0) {
1686 return !$this->env->langConverterEnabled();
1687 }
1688 private function a153($lv0) {
1689
1690 // if language converter not enabled, don't try to parse inside.
1691 return [ 'raw' => true ];
1692
1693 }
1694 private function a154($lv0, $f) {
1695 return $f['raw'];
1696 }
1697 private function a155($lv0, $f, $lv) {
1698 return [ [ 'text' => $lv ] ];
1699 }
1700 private function a156($lv0, $f) {
1701 return !$f['raw'];
1702 }
1703 private function a157($lv0, $f, $lv) {
1704 return $lv;
1705 }
1706 private function a158($lv0, $f, $ts) {
1707 return $this->endOffset();
1708 }
1709 private function a159($lv0, $f, $ts, $lv1) {
1710
1711 if ( !$this->env->langConverterEnabled() ) {
1712 return [ '-{', $ts[0]['text']['tokens'], '}-' ];
1713 }
1714 $lvsrc = substr( $this->input, $lv0, $lv1 - $lv0 );
1715 $attribs = [];
1716
1717 foreach ( $ts as &$t ) {
1718 // move token strings into KV attributes so that they are
1719 // properly expanded by early stages of the token pipeline
1720 foreach ( [ 'text', 'from', 'to' ] as $fld ) {
1721 if ( !isset( $t[$fld] ) ) {
1722 continue;
1723 }
1724 $name = 'mw:lv' . count( $attribs );
1725 // Note that AttributeExpander will expect the tokens array to be
1726 // flattened. We do that in lang_variant_text / lang_variant_nowiki
1727 $attribs[] = new KV( $name, $t[$fld]['tokens'], $t[$fld]['srcOffsets']->expandTsrV() );
1728 $t[$fld] = $name;
1729 }
1730 }
1731 unset( $t );
1732
1733 $flags = isset( $f['flags'] ) ? array_keys( $f['flags'] ) : [];
1734 sort( $flags );
1735 $variants = isset( $f['variants'] ) ? array_keys( $f['variants'] ) : [];
1736 sort( $variants );
1737
1738 $dp = new DataParsoid;
1739 $dp->tsr = new SourceRange( $lv0, $lv1 );
1740 $dp->src = $lvsrc;
1741 $dp->flags = $flags;
1742 $dp->variants = $variants;
1743 $dp->original = $f['original'];
1744 $dp->flagSp = $f['sp'];
1745 $dp->texts = $ts;
1746
1747 return [
1748 new SelfclosingTagTk(
1749 'language-variant',
1750 $attribs,
1751 $dp
1752 )
1753 ];
1754
1755 }
1756 private function a160($r, &$preproc) {
1757
1758 $preproc = null;
1759 return $r;
1760
1761 }
1762 private function a161($thTag, $thTags) {
1763
1764 // Avoid modifying a cached result
1765 $thTag[0] = clone $thTag[0];
1766 $da = $thTag[0]->dataParsoid = clone $thTag[0]->dataParsoid;
1767 $da->tsr = clone $da->tsr;
1768 $da->tsr->start--; // include "!"
1769 array_unshift( $thTags, $thTag );
1770 return $thTags;
1771
1772 }
1773 private function a162($arg) {
1774 return $this->endOffset();
1775 }
1776 private function a163($arg, $tagEndPos, $td) {
1777
1778 $tsr = new SourceRange( $this->startOffset(), $tagEndPos );
1779 return TokenizerUtils::buildTableTokens( 'td', '|', $arg,
1780 $tsr, $this->endOffset(), $td );
1781
1782 }
1783 private function a164($pp, $tdt) {
1784
1785 // Avoid modifying cached dataParsoid object
1786 $tdt[0] = clone $tdt[0];
1787 $da = $tdt[0]->dataParsoid = clone $tdt[0]->dataParsoid;
1788 $da->tsr = clone $da->tsr;
1789 $da->stx = 'row';
1790 $da->setTempFlag( TempData::NON_MERGEABLE_TABLE_CELL );
1791 $da->tsr->start -= strlen( $pp ); // include "||"
1792 if ( $pp !== '||' || ( isset( $da->startTagSrc ) && $da->startTagSrc !== $pp ) ) {
1793 // Variation from default
1794 $da->startTagSrc = $pp . ( isset( $da->startTagSrc ) ? substr( $da->startTagSrc, 1 ) : '' );
1795 }
1796 return $tdt;
1797
1798 }
1799 private function a165($b) {
1800
1801 return $b;
1802
1803 }
1804 private function a166($il) {
1805
1806 // il is guaranteed to be an array -- so, tu.flattenIfArray will
1807 // always return an array
1808 $r = TokenizerUtils::flattenIfArray( $il );
1809 if ( count( $r ) === 1 && is_string( $r[0] ) ) {
1810 $r = $r[0];
1811 }
1812 return $r;
1813
1814 }
1815 private function a167() {
1816 return '';
1817 }
1818 private function a168($ff) {
1819 return $ff;
1820 }
1821 private function a169($f) {
1822
1823 // Collect & separate flags and variants into a hashtable (by key) and ordered list
1824 $flags = [];
1825 $variants = [];
1826 $flagList = [];
1827 $flagSpace = [];
1828 $variantList = [];
1829 $variantSpace = [];
1830 $useVariants = false;
1831 if ( $f !== null ) {
1832 // lang_variant_flags returns arrays in reverse order.
1833 $spPtr = count( $f['sp'] ) - 1;
1834 for ( $i = count( $f['flags'] ) - 1; $i >= 0; $i--) {
1835 $item = $f['flags'][$i];
1836 if ( isset( $item['flag'] ) ) {
1837 $flagSpace[] = $f['sp'][$spPtr--];
1838 $flags[$item['flag']] = true;
1839 $flagList[] = $item['flag'];
1840 $flagSpace[] = $f['sp'][$spPtr--];
1841 }
1842 if ( isset( $item['variant'] ) ) {
1843 $variantSpace[] = $f['sp'][$spPtr--];
1844 $variants[$item['variant']] = true;
1845 $variantList[] = $item['variant'];
1846 $variantSpace[] = $f['sp'][$spPtr--];
1847 }
1848 }
1849 if ( $spPtr >= 0 ) {
1850 // handle space after a trailing semicolon
1851 $flagSpace[] = $f['sp'][$spPtr];
1852 $variantSpace[] = $f['sp'][$spPtr];
1853 }
1854 }
1855 // Parse flags (this logic is from core/languages/ConverterRule.php
1856 // in the parseFlags() function)
1857 if ( count( $flags ) === 0 && count( $variants ) === 0 ) {
1858 $flags['$S'] = true;
1859 } elseif ( isset( $flags['R'] ) ) {
1860 $flags = [ 'R' => true ]; // remove other flags
1861 } elseif ( isset( $flags['N'] ) ) {
1862 $flags = [ 'N' => true ]; // remove other flags
1863 } elseif ( isset( $flags['-'] ) ) {
1864 $flags = [ '-' => true ]; // remove other flags
1865 } elseif ( isset( $flags['T'] ) && count( $flags ) === 1 ) {
1866 $flags['H'] = true;
1867 } elseif ( isset( $flags['H'] ) ) {
1868 // Replace A flag, and remove other flags except T and D
1869 $nf = [ '$+' => true, 'H' => true ];
1870 if ( isset( $flags['T'] ) ) { $nf['T'] = true; }
1871 if ( isset( $flags['D'] ) ) { $nf['D'] = true; }
1872 $flags = $nf;
1873 } elseif ( count( $variants ) > 0 ) {
1874 $useVariants = true;
1875 } else {
1876 if ( isset( $flags['A'] ) ) {
1877 $flags['$+'] = true;
1878 $flags['$S'] = true;
1879 }
1880 if ( isset( $flags['D'] ) ) {
1881 unset( $flags['$S'] );
1882 }
1883 }
1884 if ( $useVariants ) {
1885 return [ 'variants' => $variants, 'original' => $variantList, 'sp' => $variantSpace ];
1886 } else {
1887 return [ 'flags' => $flags, 'original' => $flagList, 'sp' => $flagSpace ];
1888 }
1889
1890 }
1891 private function a170($tokens) {
1892
1893 return [
1894 'tokens' => TokenizerUtils::flattenStringlist( $tokens ),
1895 'srcOffsets' => $this->tsrOffsets(),
1896 ];
1897
1898 }
1899 private function a171($o, $oo) {
1900 return $oo;
1901 }
1902 private function a172($o, $rest, $tr) {
1903
1904 array_unshift( $rest, $o );
1905 // if the last bogus option is just spaces, keep them; otherwise
1906 // drop all this bogus stuff on the ground
1907 if ( count($tr) > 0 ) {
1908 $last = $tr[count($tr)-1];
1909 if (preg_match('/^\s*$/Du', $last[1])) {
1910 $rest[] = [ 'semi' => true, 'sp' => $last[1] ];
1911 }
1912 }
1913 return $rest;
1914
1915 }
1916 private function a173($lvtext) {
1917 return [ [ 'text' => $lvtext ] ];
1918 }
1919 private function a174($arg, $tagEndPos, &$th, $d) {
1920
1921 // Ignore newlines found in transclusions!
1922 // This is not perfect (since {{..}} may not always tokenize to transclusions).
1923 if ( $th !== false && strpos( preg_replace( "/{{[\s\S]+?}}/", "", $this->text() ), "\n" ) !== false ) {
1924 // There's been a newline. Remove the break and continue
1925 // tokenizing nested_block_in_tables.
1926 $th = false;
1927 }
1928 return $d;
1929
1930 }
1931 private function a175($arg, $tagEndPos, $c) {
1932
1933 $tsr = new SourceRange( $this->startOffset(), $tagEndPos );
1934 return TokenizerUtils::buildTableTokens( 'th', '!', $arg,
1935 $tsr, $this->endOffset(), $c );
1936
1937 }
1938 private function a176($pp, $tht) {
1939
1940 // Avoid modifying cached dataParsoid object
1941 $tht[0] = clone $tht[0];
1942 $da = $tht[0]->dataParsoid = clone $tht[0]->dataParsoid;
1943 $da->tsr = clone $da->tsr;
1944 $da->stx = 'row';
1945 $da->setTempFlag( TempData::NON_MERGEABLE_TABLE_CELL );
1946 $da->tsr->start -= strlen( $pp ); // include "!!" or "||"
1947 if ( $pp !== '!!' || ( isset( $da->startTagSrc ) && $da->startTagSrc !== $pp ) ) {
1948 // Variation from default
1949 $da->startTagSrc = $pp . ( isset( $da->startTagSrc ) ? substr( $da->startTagSrc, 1 ) : '' );
1950 }
1951 return $tht;
1952
1953 }
1954 private function a177($sp1, $f, $sp2, $more) {
1955
1956 $r = ( $more && $more[1] ) ? $more[1] : [ 'sp' => [], 'flags' => [] ];
1957 // Note that sp and flags are in reverse order, since we're using
1958 // right recursion and want to push instead of unshift.
1959 $r['sp'][] = $sp2;
1960 $r['sp'][] = $sp1;
1961 $r['flags'][] = $f;
1962 return $r;
1963
1964 }
1965 private function a178($sp) {
1966
1967 return [ 'sp' => [ $sp ], 'flags' => [] ];
1968
1969 }
1970 private function a179($sp1, $lang, $sp2, $sp3, $lvtext) {
1971
1972 return [
1973 'twoway' => true,
1974 'lang' => $lang,
1975 'text' => $lvtext,
1976 'sp' => [ $sp1, $sp2, $sp3 ]
1977 ];
1978
1979 }
1980 private function a180($sp1, $from, $sp2, $lang, $sp3, $sp4, $to) {
1981
1982 return [
1983 'oneway' => true,
1984 'from' => $from,
1985 'lang' => $lang,
1986 'to' => $to,
1987 'sp' => [ $sp1, $sp2, $sp3, $sp4 ]
1988 ];
1989
1990 }
1991 private function a181($r) {
1992
1993 return $r;
1994
1995 }
1996 private function a182($f) {
1997 return [ 'flag' => $f ];
1998 }
1999 private function a183($v) {
2000 return [ 'variant' => $v ];
2001 }
2002 private function a184($b) {
2003 return [ 'bogus' => $b ]; /* bad flag */
2004 }
2005 private function a185($n, $sp) {
2006
2007 $tsr = $this->tsrOffsets();
2008 $tsr->end -= strlen( $sp );
2009 return [
2010 'tokens' => [ $n ],
2011 'srcOffsets' => $tsr,
2012 ];
2013
2014 }
2015 private function a186($extToken) {
2016 return $extToken;
2017 }
2018 private function a187($extToken) {
2019
2020 $txt = Utils::extractExtBody( $extToken );
2021 return Utils::decodeWtEntities( $txt );
2022
2023 }
2024
2025 // generated
2026 private function streamstart_async($silence, &$param_preproc) {
2027 for (;;) {
2028 // start choice_1
2029 $p2 = $this->currPos;
2030 // start seq_1
2031 $p3 = $this->currPos;
2032 $this->savedPos = $this->currPos;
2033 $r4 = $this->a0();
2034 if ($r4) {
2035 $r4 = false;
2036 } else {
2037 $r4 = self::$FAILED;
2038 $r1 = self::$FAILED;
2039 goto seq_1;
2040 }
2041 $r5 = $this->parsetlb($silence, $param_preproc);
2042 // t <- $r5
2043 if ($r5===self::$FAILED) {
2044 $this->currPos = $p3;
2045 $r1 = self::$FAILED;
2046 goto seq_1;
2047 }
2048 $this->savedPos = $this->currPos;
2049 $r6 = $this->a1($r5);
2050 if ($r6) {
2051 $r6 = false;
2052 } else {
2053 $r6 = self::$FAILED;
2054 $this->currPos = $p3;
2055 $r1 = self::$FAILED;
2056 goto seq_1;
2057 }
2058 $r1 = true;
2059 seq_1:
2060 if ($r1!==self::$FAILED) {
2061 $this->savedPos = $p2;
2062 $r1 = $this->a2($r5);
2063 goto choice_1;
2064 }
2065 // free $p3
2066 // start seq_2
2067 $p3 = $this->currPos;
2068 $r7 = [];
2069 for (;;) {
2070 $r8 = $this->parsenewlineToken($silence);
2071 if ($r8!==self::$FAILED) {
2072 $r7[] = $r8;
2073 } else {
2074 break;
2075 }
2076 }
2077 // free $r8
2078 $this->savedPos = $this->currPos;
2079 $r8 = $this->a3();
2080 if ($r8) {
2081 $r8 = false;
2082 } else {
2083 $r8 = self::$FAILED;
2084 $this->currPos = $p3;
2085 $r1 = self::$FAILED;
2086 goto seq_2;
2087 }
2088 $r1 = [$r7,$r8];
2089 seq_2:
2090 // free $p3
2091 choice_1:
2092 if ($r1!==self::$FAILED) {
2093 yield $r1;
2094 } else {
2095 if ($this->currPos < $this->inputLength) {
2096 $this->fail(0);
2097 throw $this->buildParseException();
2098 }
2099 break;
2100 }
2101 }
2102 }
2103 private function parsestart($silence, &$param_preproc) {
2104 $key = json_encode([282, $param_preproc]);
2105 $bucket = $this->currPos;
2106 $cached = $this->cache[$bucket][$key] ?? null;
2107 if ($cached) {
2108 $this->currPos = $cached->nextPos;
2109 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
2110 return $cached->result;
2111 }
2112 $saved_preproc=$param_preproc;
2113 $p2 = $this->currPos;
2114 // start seq_1
2115 $p3 = $this->currPos;
2116 $r4 = [];
2117 for (;;) {
2118 $r5 = $this->parsetlb(true, $param_preproc);
2119 if ($r5!==self::$FAILED) {
2120 $r4[] = $r5;
2121 } else {
2122 break;
2123 }
2124 }
2125 // t <- $r4
2126 // free $r5
2127 $r5 = [];
2128 for (;;) {
2129 $r6 = $this->parsenewlineToken(true);
2130 if ($r6!==self::$FAILED) {
2131 $r5[] = $r6;
2132 } else {
2133 break;
2134 }
2135 }
2136 // n <- $r5
2137 // free $r6
2138 $r1 = true;
2139 seq_1:
2140 if ($r1!==self::$FAILED) {
2141 $this->savedPos = $p2;
2142 $r1 = $this->a4($r4, $r5);
2143 } else {
2144 if (!$silence) {$this->fail(1);}
2145 }
2146 // free $p3
2147 $this->cache[$bucket][$key] = new GrammarCacheEntry(
2148 $this->currPos,
2149 $r1,
2150 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
2151 self::$UNDEFINED
2152 );
2153 return $r1;
2154 }
2155 private function parsetable_start_tag($silence, $boolParams, &$param_preproc, &$param_th) {
2156 $key = json_encode([468, $boolParams & 0x3fbf, $param_preproc, $param_th]);
2157 $bucket = $this->currPos;
2158 $cached = $this->cache[$bucket][$key] ?? null;
2159 if ($cached) {
2160 $this->currPos = $cached->nextPos;
2161 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
2162 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
2163 return $cached->result;
2164 }
2165 $saved_preproc=$param_preproc;
2166 $saved_th=$param_th;
2167 $p2 = $this->currPos;
2168 // start seq_1
2169 $p3 = $this->currPos;
2170 $r4 = [];
2171 for (;;) {
2172 // start choice_1
2173 $r5 = $this->parsespace(true);
2174 if ($r5!==self::$FAILED) {
2175 goto choice_1;
2176 }
2177 $r5 = $this->parsecomment(true);
2178 choice_1:
2179 if ($r5!==self::$FAILED) {
2180 $r4[] = $r5;
2181 } else {
2182 break;
2183 }
2184 }
2185 // sc <- $r4
2186 // free $r5
2187 $p6 = $this->currPos;
2188 $r5 = '';
2189 // startPos <- $r5
2190 if ($r5!==self::$FAILED) {
2191 $this->savedPos = $p6;
2192 $r5 = $this->a5($r4);
2193 } else {
2194 $this->currPos = $p3;
2195 $r1 = self::$FAILED;
2196 goto seq_1;
2197 }
2198 // b <- $r7
2199 if (($this->input[$this->currPos] ?? null) === "{") {
2200 $this->currPos++;
2201 $r7 = "{";
2202 } else {
2203 $r7 = self::$FAILED;
2204 $this->currPos = $p3;
2205 $r1 = self::$FAILED;
2206 goto seq_1;
2207 }
2208 $r8 = $this->parsepipe(true);
2209 // p <- $r8
2210 if ($r8===self::$FAILED) {
2211 $this->currPos = $p3;
2212 $r1 = self::$FAILED;
2213 goto seq_1;
2214 }
2215 // start choice_2
2216 $r9 = $this->parsetable_attributes(true, $boolParams & ~0x40, $param_preproc, $param_th);
2217 if ($r9!==self::$FAILED) {
2218 goto choice_2;
2219 }
2220 $this->savedPos = $this->currPos;
2221 $r9 = $this->a6($r4, $r5, $r7, $r8);
2222 if ($r9) {
2223 $r9 = false;
2224 } else {
2225 $r9 = self::$FAILED;
2226 }
2227 choice_2:
2228 // ta <- $r9
2229 if ($r9===self::$FAILED) {
2230 $this->currPos = $p3;
2231 $r1 = self::$FAILED;
2232 goto seq_1;
2233 }
2234 $p11 = $this->currPos;
2235 $r10 = '';
2236 // tsEndPos <- $r10
2237 if ($r10!==self::$FAILED) {
2238 $this->savedPos = $p11;
2239 $r10 = $this->a7($r4, $r5, $r7, $r8, $r9);
2240 } else {
2241 $this->currPos = $p3;
2242 $r1 = self::$FAILED;
2243 goto seq_1;
2244 }
2245 $r12 = [];
2246 for (;;) {
2247 $r13 = $this->parsespace(true);
2248 if ($r13!==self::$FAILED) {
2249 $r12[] = $r13;
2250 } else {
2251 break;
2252 }
2253 }
2254 // s2 <- $r12
2255 // free $r13
2256 $r1 = true;
2257 seq_1:
2258 if ($r1!==self::$FAILED) {
2259 $this->savedPos = $p2;
2260 $r1 = $this->a8($r4, $r5, $r7, $r8, $r9, $r10, $r12);
2261 } else {
2262 if (!$silence) {$this->fail(2);}
2263 }
2264 // free $p3
2265 $this->cache[$bucket][$key] = new GrammarCacheEntry(
2266 $this->currPos,
2267 $r1,
2268 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
2269 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
2270 );
2271 return $r1;
2272 }
2273 private function parseurl($silence, &$param_preproc) {
2274 $key = json_encode([340, $param_preproc]);
2275 $bucket = $this->currPos;
2276 $cached = $this->cache[$bucket][$key] ?? null;
2277 if ($cached) {
2278 $this->currPos = $cached->nextPos;
2279 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
2280 return $cached->result;
2281 }
2282 $saved_preproc=$param_preproc;
2283 $p2 = $this->currPos;
2284 // start seq_1
2285 $p3 = $this->currPos;
2286 $r4 = $this->parseurl_protocol($silence);
2287 // proto <- $r4
2288 if ($r4===self::$FAILED) {
2289 $r1 = self::$FAILED;
2290 goto seq_1;
2291 }
2292 // start choice_1
2293 $r5 = $this->parseipv6urladdr($silence);
2294 if ($r5!==self::$FAILED) {
2295 goto choice_1;
2296 }
2297 $r5 = '';
2298 choice_1:
2299 // addr <- $r5
2300 if ($r5===self::$FAILED) {
2301 $this->currPos = $p3;
2302 $r1 = self::$FAILED;
2303 goto seq_1;
2304 }
2305 $r6 = [];
2306 for (;;) {
2307 $p8 = $this->currPos;
2308 // start seq_2
2309 $p9 = $this->currPos;
2310 $p10 = $this->currPos;
2311 $r11 = $this->discardinline_breaks(true, 0x0, $param_preproc, self::newRef(null));
2312 if ($r11 === self::$FAILED) {
2313 $r11 = false;
2314 } else {
2315 $r11 = self::$FAILED;
2316 $this->currPos = $p10;
2317 $r7 = self::$FAILED;
2318 goto seq_2;
2319 }
2320 // free $p10
2321 // start choice_2
2322 $r12 = $this->parseno_punctuation_char($silence);
2323 if ($r12!==self::$FAILED) {
2324 goto choice_2;
2325 }
2326 $r12 = $this->parsecomment($silence);
2327 if ($r12!==self::$FAILED) {
2328 goto choice_2;
2329 }
2330 $r12 = $this->parsetplarg_or_template($silence, 0x0, self::newRef(null), $param_preproc);
2331 if ($r12!==self::$FAILED) {
2332 goto choice_2;
2333 }
2334 $r12 = $this->input[$this->currPos] ?? '';
2335 if ($r12 === "'" || $r12 === "{") {
2336 $this->currPos++;
2337 goto choice_2;
2338 } else {
2339 $r12 = self::$FAILED;
2340 if (!$silence) {$this->fail(3);}
2341 }
2342 $p10 = $this->currPos;
2343 // start seq_3
2344 $p13 = $this->currPos;
2345 $p14 = $this->currPos;
2346 // start seq_4
2347 $p16 = $this->currPos;
2348 if (($this->input[$this->currPos] ?? null) === "&") {
2349 $this->currPos++;
2350 $r17 = "&";
2351 } else {
2352 $r17 = self::$FAILED;
2353 $r15 = self::$FAILED;
2354 goto seq_4;
2355 }
2356 // start choice_3
2357 // start seq_5
2358 $p19 = $this->currPos;
2359 $r20 = $this->input[$this->currPos] ?? '';
2360 if ($r20 === "l" || $r20 === "L") {
2361 $this->currPos++;
2362 } else {
2363 $r20 = self::$FAILED;
2364 $r18 = self::$FAILED;
2365 goto seq_5;
2366 }
2367 $r21 = $this->input[$this->currPos] ?? '';
2368 if ($r21 === "t" || $r21 === "T") {
2369 $this->currPos++;
2370 } else {
2371 $r21 = self::$FAILED;
2372 $this->currPos = $p19;
2373 $r18 = self::$FAILED;
2374 goto seq_5;
2375 }
2376 $r18 = true;
2377 seq_5:
2378 if ($r18!==self::$FAILED) {
2379 goto choice_3;
2380 }
2381 // free $p19
2382 // start seq_6
2383 $p19 = $this->currPos;
2384 $r22 = $this->input[$this->currPos] ?? '';
2385 if ($r22 === "g" || $r22 === "G") {
2386 $this->currPos++;
2387 } else {
2388 $r22 = self::$FAILED;
2389 $r18 = self::$FAILED;
2390 goto seq_6;
2391 }
2392 $r23 = $this->input[$this->currPos] ?? '';
2393 if ($r23 === "t" || $r23 === "T") {
2394 $this->currPos++;
2395 } else {
2396 $r23 = self::$FAILED;
2397 $this->currPos = $p19;
2398 $r18 = self::$FAILED;
2399 goto seq_6;
2400 }
2401 $r18 = true;
2402 seq_6:
2403 // free $p19
2404 choice_3:
2405 if ($r18===self::$FAILED) {
2406 $this->currPos = $p16;
2407 $r15 = self::$FAILED;
2408 goto seq_4;
2409 }
2410 if (($this->input[$this->currPos] ?? null) === ";") {
2411 $this->currPos++;
2412 $r24 = ";";
2413 } else {
2414 $r24 = self::$FAILED;
2415 $this->currPos = $p16;
2416 $r15 = self::$FAILED;
2417 goto seq_4;
2418 }
2419 $r15 = true;
2420 seq_4:
2421 // free $p16
2422 if ($r15 === self::$FAILED) {
2423 $r15 = false;
2424 } else {
2425 $r15 = self::$FAILED;
2426 $this->currPos = $p14;
2427 $r12 = self::$FAILED;
2428 goto seq_3;
2429 }
2430 // free $p14
2431 // start choice_4
2432 $p14 = $this->currPos;
2433 // start seq_7
2434 $p16 = $this->currPos;
2435 $p19 = $this->currPos;
2436 if (($this->input[$this->currPos] ?? null) === "&") {
2437 $this->currPos++;
2438 $r26 = "&";
2439 $r26 = false;
2440 $this->currPos = $p19;
2441 } else {
2442 $r26 = self::$FAILED;
2443 $r25 = self::$FAILED;
2444 goto seq_7;
2445 }
2446 // free $p19
2447 $r27 = $this->parsehtmlentity($silence);
2448 // he <- $r27
2449 if ($r27===self::$FAILED) {
2450 $this->currPos = $p16;
2451 $r25 = self::$FAILED;
2452 goto seq_7;
2453 }
2454 $r25 = true;
2455 seq_7:
2456 if ($r25!==self::$FAILED) {
2457 $this->savedPos = $p14;
2458 $r25 = $this->a9($r4, $r5, $r27);
2459 goto choice_4;
2460 }
2461 // free $p16
2462 if (($this->input[$this->currPos] ?? null) === "&") {
2463 $this->currPos++;
2464 $r25 = "&";
2465 } else {
2466 if (!$silence) {$this->fail(4);}
2467 $r25 = self::$FAILED;
2468 }
2469 choice_4:
2470 // r <- $r25
2471 if ($r25===self::$FAILED) {
2472 $this->currPos = $p13;
2473 $r12 = self::$FAILED;
2474 goto seq_3;
2475 }
2476 $r12 = true;
2477 seq_3:
2478 if ($r12!==self::$FAILED) {
2479 $this->savedPos = $p10;
2480 $r12 = $this->a10($r4, $r5, $r25);
2481 }
2482 // free $p13
2483 choice_2:
2484 // c <- $r12
2485 if ($r12===self::$FAILED) {
2486 $this->currPos = $p9;
2487 $r7 = self::$FAILED;
2488 goto seq_2;
2489 }
2490 $r7 = true;
2491 seq_2:
2492 if ($r7!==self::$FAILED) {
2493 $this->savedPos = $p8;
2494 $r7 = $this->a11($r4, $r5, $r12);
2495 $r6[] = $r7;
2496 } else {
2497 break;
2498 }
2499 // free $p9
2500 }
2501 // path <- $r6
2502 // free $r7
2503 $this->savedPos = $this->currPos;
2504 $r7 = $this->a12($r4, $r5, $r6);
2505 if ($r7) {
2506 $r7 = false;
2507 } else {
2508 $r7 = self::$FAILED;
2509 $this->currPos = $p3;
2510 $r1 = self::$FAILED;
2511 goto seq_1;
2512 }
2513 $r1 = true;
2514 seq_1:
2515 if ($r1!==self::$FAILED) {
2516 $this->savedPos = $p2;
2517 $r1 = $this->a13($r4, $r5, $r6);
2518 }
2519 // free $p3
2520 $this->cache[$bucket][$key] = new GrammarCacheEntry(
2521 $this->currPos,
2522 $r1,
2523 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
2524 self::$UNDEFINED
2525 );
2526 return $r1;
2527 }
2528 private function parserow_syntax_table_args($silence, $boolParams, &$param_preproc, &$param_th) {
2529 $key = json_encode([490, $boolParams & 0x3eff, $param_preproc, $param_th]);
2530 $bucket = $this->currPos;
2531 $cached = $this->cache[$bucket][$key] ?? null;
2532 if ($cached) {
2533 $this->currPos = $cached->nextPos;
2534 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
2535 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
2536 return $cached->result;
2537 }
2538 $saved_preproc=$param_preproc;
2539 $saved_th=$param_th;
2540 $p2 = $this->currPos;
2541 // start seq_1
2542 $p3 = $this->currPos;
2543 $r4 = $this->parsetable_attributes($silence, $boolParams | 0x100, $param_preproc, $param_th);
2544 // as <- $r4
2545 if ($r4===self::$FAILED) {
2546 $r1 = self::$FAILED;
2547 goto seq_1;
2548 }
2549 $r5 = $this->parseoptional_spaces($silence);
2550 // s <- $r5
2551 if ($r5===self::$FAILED) {
2552 $this->currPos = $p3;
2553 $r1 = self::$FAILED;
2554 goto seq_1;
2555 }
2556 $r6 = $this->parsepipe($silence);
2557 // p <- $r6
2558 if ($r6===self::$FAILED) {
2559 $this->currPos = $p3;
2560 $r1 = self::$FAILED;
2561 goto seq_1;
2562 }
2563 $p7 = $this->currPos;
2564 $r8 = $this->discardpipe(true);
2565 if ($r8 === self::$FAILED) {
2566 $r8 = false;
2567 } else {
2568 $r8 = self::$FAILED;
2569 $this->currPos = $p7;
2570 $this->currPos = $p3;
2571 $r1 = self::$FAILED;
2572 goto seq_1;
2573 }
2574 // free $p7
2575 $r1 = true;
2576 seq_1:
2577 if ($r1!==self::$FAILED) {
2578 $this->savedPos = $p2;
2579 $r1 = $this->a14($r4, $r5, $r6);
2580 }
2581 // free $p3
2582 $this->cache[$bucket][$key] = new GrammarCacheEntry(
2583 $this->currPos,
2584 $r1,
2585 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
2586 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
2587 );
2588 return $r1;
2589 }
2590 private function parsetable_attributes($silence, $boolParams, &$param_preproc, &$param_th) {
2591 $key = json_encode([286, $boolParams & 0x3fff, $param_preproc, $param_th]);
2592 $bucket = $this->currPos;
2593 $cached = $this->cache[$bucket][$key] ?? null;
2594 if ($cached) {
2595 $this->currPos = $cached->nextPos;
2596 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
2597 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
2598 return $cached->result;
2599 }
2600 $saved_preproc=$param_preproc;
2601 $saved_th=$param_th;
2602 $r1 = [];
2603 for (;;) {
2604 // start choice_1
2605 $r2 = $this->parsetable_attribute(true, $boolParams, $param_preproc, $param_th);
2606 if ($r2!==self::$FAILED) {
2607 goto choice_1;
2608 }
2609 $p3 = $this->currPos;
2610 // start seq_1
2611 $p4 = $this->currPos;
2612 $r5 = $this->discardoptionalSpaceToken(true);
2613 if ($r5===self::$FAILED) {
2614 $r2 = self::$FAILED;
2615 goto seq_1;
2616 }
2617 $r6 = $this->parsebroken_table_attribute_name_char(true);
2618 // b <- $r6
2619 if ($r6===self::$FAILED) {
2620 $this->currPos = $p4;
2621 $r2 = self::$FAILED;
2622 goto seq_1;
2623 }
2624 $r2 = true;
2625 seq_1:
2626 if ($r2!==self::$FAILED) {
2627 $this->savedPos = $p3;
2628 $r2 = $this->a15($r6);
2629 }
2630 // free $p4
2631 choice_1:
2632 if ($r2!==self::$FAILED) {
2633 $r1[] = $r2;
2634 } else {
2635 break;
2636 }
2637 }
2638 // free $r2
2639 $this->cache[$bucket][$key] = new GrammarCacheEntry(
2640 $this->currPos,
2641 $r1,
2642 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
2643 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
2644 );
2645 return $r1;
2646 }
2647 private function parsegeneric_newline_attributes($silence, $boolParams, &$param_preproc, &$param_th) {
2648 $key = json_encode([284, $boolParams & 0x3fff, $param_preproc, $param_th]);
2649 $bucket = $this->currPos;
2650 $cached = $this->cache[$bucket][$key] ?? null;
2651 if ($cached) {
2652 $this->currPos = $cached->nextPos;
2653 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
2654 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
2655 return $cached->result;
2656 }
2657 $saved_preproc=$param_preproc;
2658 $saved_th=$param_th;
2659 $r1 = [];
2660 for (;;) {
2661 $r2 = $this->parsegeneric_newline_attribute(true, $boolParams, $param_preproc, $param_th);
2662 if ($r2!==self::$FAILED) {
2663 $r1[] = $r2;
2664 } else {
2665 break;
2666 }
2667 }
2668 // free $r2
2669 $this->cache[$bucket][$key] = new GrammarCacheEntry(
2670 $this->currPos,
2671 $r1,
2672 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
2673 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
2674 );
2675 return $r1;
2676 }
2677 private function parsetplarg_or_template_or_bust($silence, &$param_preproc) {
2678 $key = json_encode([350, $param_preproc]);
2679 $bucket = $this->currPos;
2680 $cached = $this->cache[$bucket][$key] ?? null;
2681 if ($cached) {
2682 $this->currPos = $cached->nextPos;
2683 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
2684 return $cached->result;
2685 }
2686 $saved_preproc=$param_preproc;
2687 $p2 = $this->currPos;
2688 $r3 = [];
2689 for (;;) {
2690 // start choice_1
2691 $r4 = $this->parsetplarg_or_template($silence, 0x0, self::newRef(null), $param_preproc);
2692 if ($r4!==self::$FAILED) {
2693 goto choice_1;
2694 }
2695 if ($this->currPos < $this->inputLength) {
2696 $r4 = self::consumeChar($this->input, $this->currPos);;
2697 } else {
2698 $r4 = self::$FAILED;
2699 if (!$silence) {$this->fail(7);}
2700 }
2701 choice_1:
2702 if ($r4!==self::$FAILED) {
2703 $r3[] = $r4;
2704 } else {
2705 break;
2706 }
2707 }
2708 if (count($r3) === 0) {
2709 $r3 = self::$FAILED;
2710 }
2711 // r <- $r3
2712 // free $r4
2713 $r1 = $r3;
2714 if ($r1!==self::$FAILED) {
2715 $this->savedPos = $p2;
2716 $r1 = $this->a16($r3);
2717 }
2718 $this->cache[$bucket][$key] = new GrammarCacheEntry(
2719 $this->currPos,
2720 $r1,
2721 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
2722 self::$UNDEFINED
2723 );
2724 return $r1;
2725 }
2726 private function parseextlink($silence, $boolParams, &$param_preproc, &$param_th) {
2727 $key = json_encode([326, $boolParams & 0x3fff, $param_preproc, $param_th]);
2728 $bucket = $this->currPos;
2729 $cached = $this->cache[$bucket][$key] ?? null;
2730 if ($cached) {
2731 $this->currPos = $cached->nextPos;
2732 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
2733 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
2734 return $cached->result;
2735 }
2736 $saved_preproc=$param_preproc;
2737 $saved_th=$param_th;
2738 $p2 = $this->currPos;
2739 // start seq_1
2740 $p3 = $this->currPos;
2741 if (!(/*extlink*/($boolParams & 0x8) !== 0)) {
2742 $r4 = false;
2743 } else {
2744 $r4 = self::$FAILED;
2745 $r1 = self::$FAILED;
2746 goto seq_1;
2747 }
2748 $p6 = $this->currPos;
2749 // start seq_2
2750 $p7 = $this->currPos;
2751 if (($this->input[$this->currPos] ?? null) === "[") {
2752 $this->currPos++;
2753 $r8 = "[";
2754 } else {
2755 $r8 = self::$FAILED;
2756 $r5 = self::$FAILED;
2757 goto seq_2;
2758 }
2759 $p10 = $this->currPos;
2760 $r9 = '';
2761 // p0 <- $r9
2762 if ($r9!==self::$FAILED) {
2763 $this->savedPos = $p10;
2764 $r9 = $this->a17();
2765 } else {
2766 $this->currPos = $p7;
2767 $r5 = self::$FAILED;
2768 goto seq_2;
2769 }
2770 $p12 = $this->currPos;
2771 // start seq_3
2772 $p13 = $this->currPos;
2773 // start choice_1
2774 // start seq_4
2775 $p15 = $this->currPos;
2776 $r16 = $this->parseurl_protocol(true);
2777 if ($r16===self::$FAILED) {
2778 $r14 = self::$FAILED;
2779 goto seq_4;
2780 }
2781 $r17 = $this->parseipv6urladdr(true);
2782 if ($r17===self::$FAILED) {
2783 $this->currPos = $p15;
2784 $r14 = self::$FAILED;
2785 goto seq_4;
2786 }
2787 $r14 = [$r16,$r17];
2788 seq_4:
2789 if ($r14!==self::$FAILED) {
2790 goto choice_1;
2791 }
2792 // free $p15
2793 $r14 = '';
2794 choice_1:
2795 // addr <- $r14
2796 if ($r14===self::$FAILED) {
2797 $r11 = self::$FAILED;
2798 goto seq_3;
2799 }
2800 // start choice_2
2801 $r18 = $this->parseextlink_nonipv6url(true, $boolParams | 0x8, $param_preproc, $param_th);
2802 if ($r18!==self::$FAILED) {
2803 goto choice_2;
2804 }
2805 $r18 = '';
2806 choice_2:
2807 // target <- $r18
2808 if ($r18===self::$FAILED) {
2809 $this->currPos = $p13;
2810 $r11 = self::$FAILED;
2811 goto seq_3;
2812 }
2813 $r11 = true;
2814 seq_3:
2815 // flat <- $r11
2816 if ($r11!==self::$FAILED) {
2817 $this->savedPos = $p12;
2818 $r11 = $this->a18($r9, $r14, $r18);
2819 } else {
2820 $this->currPos = $p7;
2821 $r5 = self::$FAILED;
2822 goto seq_2;
2823 }
2824 // free $p13
2825 $this->savedPos = $this->currPos;
2826 $r19 = $this->a19($r9, $r11);
2827 if ($r19) {
2828 $r19 = false;
2829 } else {
2830 $r19 = self::$FAILED;
2831 $this->currPos = $p7;
2832 $r5 = self::$FAILED;
2833 goto seq_2;
2834 }
2835 $p13 = $this->currPos;
2836 $r20 = '';
2837 // p1 <- $r20
2838 if ($r20!==self::$FAILED) {
2839 $this->savedPos = $p13;
2840 $r20 = $this->a20($r9, $r11);
2841 } else {
2842 $this->currPos = $p7;
2843 $r5 = self::$FAILED;
2844 goto seq_2;
2845 }
2846 $p15 = $this->currPos;
2847 for (;;) {
2848 // start choice_3
2849 $r22 = $this->discardspace(true);
2850 if ($r22!==self::$FAILED) {
2851 goto choice_3;
2852 }
2853 $r22 = $this->discardunispace(true);
2854 choice_3:
2855 if ($r22===self::$FAILED) {
2856 break;
2857 }
2858 }
2859 // free $r22
2860 $r21 = true;
2861 // sp <- $r21
2862 if ($r21!==self::$FAILED) {
2863 $r21 = substr($this->input, $p15, $this->currPos - $p15);
2864 } else {
2865 $r21 = self::$FAILED;
2866 $this->currPos = $p7;
2867 $r5 = self::$FAILED;
2868 goto seq_2;
2869 }
2870 // free $p15
2871 $p15 = $this->currPos;
2872 $r22 = '';
2873 // p2 <- $r22
2874 if ($r22!==self::$FAILED) {
2875 $this->savedPos = $p15;
2876 $r22 = $this->a21($r9, $r11, $r20, $r21);
2877 } else {
2878 $this->currPos = $p7;
2879 $r5 = self::$FAILED;
2880 goto seq_2;
2881 }
2882 $r23 = $this->parseinlineline(true, $boolParams | 0x8, $param_preproc, $param_th);
2883 if ($r23===self::$FAILED) {
2884 $r23 = null;
2885 }
2886 // content <- $r23
2887 $p25 = $this->currPos;
2888 $r24 = '';
2889 // p3 <- $r24
2890 if ($r24!==self::$FAILED) {
2891 $this->savedPos = $p25;
2892 $r24 = $this->a22($r9, $r11, $r20, $r21, $r22, $r23);
2893 } else {
2894 $this->currPos = $p7;
2895 $r5 = self::$FAILED;
2896 goto seq_2;
2897 }
2898 if (($this->input[$this->currPos] ?? null) === "]") {
2899 $this->currPos++;
2900 $r26 = "]";
2901 } else {
2902 $r26 = self::$FAILED;
2903 $this->currPos = $p7;
2904 $r5 = self::$FAILED;
2905 goto seq_2;
2906 }
2907 $r5 = true;
2908 seq_2:
2909 // r <- $r5
2910 if ($r5!==self::$FAILED) {
2911 $this->savedPos = $p6;
2912 $r5 = $this->a23($r9, $r11, $r20, $r21, $r22, $r23, $r24);
2913 } else {
2914 $this->currPos = $p3;
2915 $r1 = self::$FAILED;
2916 goto seq_1;
2917 }
2918 // free $p7
2919 $r1 = true;
2920 seq_1:
2921 if ($r1!==self::$FAILED) {
2922 $this->savedPos = $p2;
2923 $r1 = $this->a24($r5);
2924 } else {
2925 if (!$silence) {$this->fail(8);}
2926 }
2927 // free $p3
2928 $this->cache[$bucket][$key] = new GrammarCacheEntry(
2929 $this->currPos,
2930 $r1,
2931 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
2932 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
2933 );
2934 return $r1;
2935 }
2936 private function parselist_item($silence, $boolParams, &$param_preproc, &$param_th) {
2937 $key = json_encode([446, $boolParams & 0x3fff, $param_preproc, $param_th]);
2938 $bucket = $this->currPos;
2939 $cached = $this->cache[$bucket][$key] ?? null;
2940 if ($cached) {
2941 $this->currPos = $cached->nextPos;
2942 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
2943 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
2944 return $cached->result;
2945 }
2946 $saved_preproc=$param_preproc;
2947 $saved_th=$param_th;
2948 // start choice_1
2949 $r1 = $this->parsedtdd($silence, $boolParams, $param_preproc, $param_th);
2950 if ($r1!==self::$FAILED) {
2951 goto choice_1;
2952 }
2953 $r1 = $this->parsehacky_dl_uses($silence, $boolParams, $param_preproc, $param_th);
2954 if ($r1!==self::$FAILED) {
2955 goto choice_1;
2956 }
2957 $r1 = $this->parseli($silence, $boolParams, $param_preproc, $param_th);
2958 choice_1:
2959 $this->cache[$bucket][$key] = new GrammarCacheEntry(
2960 $this->currPos,
2961 $r1,
2962 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
2963 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
2964 );
2965 return $r1;
2966 }
2967 private function parsetlb($silence, &$param_preproc) {
2968 $key = json_encode([290, $param_preproc]);
2969 $bucket = $this->currPos;
2970 $cached = $this->cache[$bucket][$key] ?? null;
2971 if ($cached) {
2972 $this->currPos = $cached->nextPos;
2973 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
2974 return $cached->result;
2975 }
2976 $saved_preproc=$param_preproc;
2977 $p2 = $this->currPos;
2978 // start seq_1
2979 $p3 = $this->currPos;
2980 $p4 = $this->currPos;
2981 $r5 = $this->discardeof(true);
2982 if ($r5 === self::$FAILED) {
2983 $r5 = false;
2984 } else {
2985 $r5 = self::$FAILED;
2986 $this->currPos = $p4;
2987 $r1 = self::$FAILED;
2988 goto seq_1;
2989 }
2990 // free $p4
2991 $r6 = $this->parseblock(true, 0x0, self::newRef(null), $param_preproc);
2992 // b <- $r6
2993 if ($r6===self::$FAILED) {
2994 $this->currPos = $p3;
2995 $r1 = self::$FAILED;
2996 goto seq_1;
2997 }
2998 $r1 = true;
2999 seq_1:
3000 if ($r1!==self::$FAILED) {
3001 $this->savedPos = $p2;
3002 $r1 = $this->a25($r6);
3003 } else {
3004 if (!$silence) {$this->fail(9);}
3005 }
3006 // free $p3
3007 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3008 $this->currPos,
3009 $r1,
3010 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
3011 self::$UNDEFINED
3012 );
3013 return $r1;
3014 }
3015 private function parsenewlineToken($silence) {
3016 $key = 536;
3017 $bucket = $this->currPos;
3018 $cached = $this->cache[$bucket][$key] ?? null;
3019 if ($cached) {
3020 $this->currPos = $cached->nextPos;
3021
3022 return $cached->result;
3023 }
3024
3025 $p2 = $this->currPos;
3026 $r1 = $this->discardnewline($silence);
3027 if ($r1!==self::$FAILED) {
3028 $this->savedPos = $p2;
3029 $r1 = $this->a26();
3030 }
3031 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3032 $this->currPos,
3033 $r1,
3034 self::$UNDEFINED,
3035 self::$UNDEFINED
3036 );
3037 return $r1;
3038 }
3039 private function parsespace($silence) {
3040 $key = 526;
3041 $bucket = $this->currPos;
3042 $cached = $this->cache[$bucket][$key] ?? null;
3043 if ($cached) {
3044 $this->currPos = $cached->nextPos;
3045
3046 return $cached->result;
3047 }
3048
3049 $r1 = $this->input[$this->currPos] ?? '';
3050 if ($r1 === " " || $r1 === "\x09") {
3051 $this->currPos++;
3052 } else {
3053 $r1 = self::$FAILED;
3054 if (!$silence) {$this->fail(10);}
3055 }
3056 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3057 $this->currPos,
3058 $r1,
3059 self::$UNDEFINED,
3060 self::$UNDEFINED
3061 );
3062 return $r1;
3063 }
3064 private function parsecomment($silence) {
3065 $key = 540;
3066 $bucket = $this->currPos;
3067 $cached = $this->cache[$bucket][$key] ?? null;
3068 if ($cached) {
3069 $this->currPos = $cached->nextPos;
3070
3071 return $cached->result;
3072 }
3073
3074 $p2 = $this->currPos;
3075 // start seq_1
3076 $p3 = $this->currPos;
3077 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "<!--", $this->currPos, 4, false) === 0) {
3078 $r4 = "<!--";
3079 $this->currPos += 4;
3080 } else {
3081 if (!$silence) {$this->fail(11);}
3082 $r4 = self::$FAILED;
3083 $r1 = self::$FAILED;
3084 goto seq_1;
3085 }
3086 $p6 = $this->currPos;
3087 for (;;) {
3088 // start seq_2
3089 $p8 = $this->currPos;
3090 $p9 = $this->currPos;
3091 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) {
3092 $r10 = "-->";
3093 $this->currPos += 3;
3094 } else {
3095 $r10 = self::$FAILED;
3096 }
3097 if ($r10 === self::$FAILED) {
3098 $r10 = false;
3099 } else {
3100 $r10 = self::$FAILED;
3101 $this->currPos = $p9;
3102 $r7 = self::$FAILED;
3103 goto seq_2;
3104 }
3105 // free $p9
3106 if ($this->currPos < $this->inputLength) {
3107 $r11 = self::consumeChar($this->input, $this->currPos);;
3108 } else {
3109 $r11 = self::$FAILED;
3110 if (!$silence) {$this->fail(7);}
3111 $this->currPos = $p8;
3112 $r7 = self::$FAILED;
3113 goto seq_2;
3114 }
3115 $r7 = true;
3116 seq_2:
3117 if ($r7===self::$FAILED) {
3118 break;
3119 }
3120 // free $p8
3121 }
3122 // free $r7
3123 $r5 = true;
3124 // c <- $r5
3125 if ($r5!==self::$FAILED) {
3126 $r5 = substr($this->input, $p6, $this->currPos - $p6);
3127 } else {
3128 $r5 = self::$FAILED;
3129 $this->currPos = $p3;
3130 $r1 = self::$FAILED;
3131 goto seq_1;
3132 }
3133 // free $p6
3134 $p6 = $this->currPos;
3135 // start choice_1
3136 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) {
3137 $r7 = "-->";
3138 $this->currPos += 3;
3139 goto choice_1;
3140 } else {
3141 if (!$silence) {$this->fail(12);}
3142 $r7 = self::$FAILED;
3143 }
3144 $r7 = $this->discardeof($silence);
3145 choice_1:
3146 // cEnd <- $r7
3147 if ($r7!==self::$FAILED) {
3148 $r7 = substr($this->input, $p6, $this->currPos - $p6);
3149 } else {
3150 $r7 = self::$FAILED;
3151 $this->currPos = $p3;
3152 $r1 = self::$FAILED;
3153 goto seq_1;
3154 }
3155 // free $p6
3156 $r1 = true;
3157 seq_1:
3158 if ($r1!==self::$FAILED) {
3159 $this->savedPos = $p2;
3160 $r1 = $this->a27($r5, $r7);
3161 }
3162 // free $p3
3163 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3164 $this->currPos,
3165 $r1,
3166 self::$UNDEFINED,
3167 self::$UNDEFINED
3168 );
3169 return $r1;
3170 }
3171 private function parsepipe($silence) {
3172 $key = 522;
3173 $bucket = $this->currPos;
3174 $cached = $this->cache[$bucket][$key] ?? null;
3175 if ($cached) {
3176 $this->currPos = $cached->nextPos;
3177
3178 return $cached->result;
3179 }
3180
3181 // start choice_1
3182 if (($this->input[$this->currPos] ?? null) === "|") {
3183 $this->currPos++;
3184 $r1 = "|";
3185 goto choice_1;
3186 } else {
3187 if (!$silence) {$this->fail(13);}
3188 $r1 = self::$FAILED;
3189 }
3190 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}", $this->currPos, 5, false) === 0) {
3191 $r1 = "{{!}}";
3192 $this->currPos += 5;
3193 } else {
3194 if (!$silence) {$this->fail(14);}
3195 $r1 = self::$FAILED;
3196 }
3197 choice_1:
3198 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3199 $this->currPos,
3200 $r1,
3201 self::$UNDEFINED,
3202 self::$UNDEFINED
3203 );
3204 return $r1;
3205 }
3206 private function parseurl_protocol($silence) {
3207 $key = 336;
3208 $bucket = $this->currPos;
3209 $cached = $this->cache[$bucket][$key] ?? null;
3210 if ($cached) {
3211 $this->currPos = $cached->nextPos;
3212
3213 return $cached->result;
3214 }
3215
3216 $p2 = $this->currPos;
3217 // start seq_1
3218 $p3 = $this->currPos;
3219 $p5 = $this->currPos;
3220 // start choice_1
3221 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "//", $this->currPos, 2, false) === 0) {
3222 $r4 = "//";
3223 $this->currPos += 2;
3224 goto choice_1;
3225 } else {
3226 if (!$silence) {$this->fail(15);}
3227 $r4 = self::$FAILED;
3228 }
3229 // start seq_2
3230 $p6 = $this->currPos;
3231 $r7 = $this->input[$this->currPos] ?? '';
3232 if (preg_match("/^[A-Za-z]/", $r7)) {
3233 $this->currPos++;
3234 } else {
3235 $r7 = self::$FAILED;
3236 if (!$silence) {$this->fail(16);}
3237 $r4 = self::$FAILED;
3238 goto seq_2;
3239 }
3240 for (;;) {
3241 $r9 = $this->input[$this->currPos] ?? '';
3242 if (preg_match("/^[\\-A-Za-z0-9+.]/", $r9)) {
3243 $this->currPos++;
3244 } else {
3245 $r9 = self::$FAILED;
3246 if (!$silence) {$this->fail(17);}
3247 break;
3248 }
3249 }
3250 // free $r9
3251 $r8 = true;
3252 if ($r8===self::$FAILED) {
3253 $this->currPos = $p6;
3254 $r4 = self::$FAILED;
3255 goto seq_2;
3256 }
3257 // free $r8
3258 if (($this->input[$this->currPos] ?? null) === ":") {
3259 $this->currPos++;
3260 $r8 = ":";
3261 } else {
3262 if (!$silence) {$this->fail(18);}
3263 $r8 = self::$FAILED;
3264 $this->currPos = $p6;
3265 $r4 = self::$FAILED;
3266 goto seq_2;
3267 }
3268 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "//", $this->currPos, 2, false) === 0) {
3269 $r9 = "//";
3270 $this->currPos += 2;
3271 } else {
3272 if (!$silence) {$this->fail(15);}
3273 $r9 = self::$FAILED;
3274 $r9 = null;
3275 }
3276 $r4 = true;
3277 seq_2:
3278 // free $p6
3279 choice_1:
3280 // p <- $r4
3281 if ($r4!==self::$FAILED) {
3282 $r4 = substr($this->input, $p5, $this->currPos - $p5);
3283 } else {
3284 $r4 = self::$FAILED;
3285 $r1 = self::$FAILED;
3286 goto seq_1;
3287 }
3288 // free $p5
3289 $this->savedPos = $this->currPos;
3290 $r10 = $this->a28($r4);
3291 if ($r10) {
3292 $r10 = false;
3293 } else {
3294 $r10 = self::$FAILED;
3295 $this->currPos = $p3;
3296 $r1 = self::$FAILED;
3297 goto seq_1;
3298 }
3299 $r1 = true;
3300 seq_1:
3301 if ($r1!==self::$FAILED) {
3302 $this->savedPos = $p2;
3303 $r1 = $this->a29($r4);
3304 }
3305 // free $p3
3306 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3307 $this->currPos,
3308 $r1,
3309 self::$UNDEFINED,
3310 self::$UNDEFINED
3311 );
3312 return $r1;
3313 }
3314 private function parseipv6urladdr($silence) {
3315 $key = 344;
3316 $bucket = $this->currPos;
3317 $cached = $this->cache[$bucket][$key] ?? null;
3318 if ($cached) {
3319 $this->currPos = $cached->nextPos;
3320
3321 return $cached->result;
3322 }
3323
3324 $p1 = $this->currPos;
3325 // start seq_1
3326 $p3 = $this->currPos;
3327 if (($this->input[$this->currPos] ?? null) === "[") {
3328 $this->currPos++;
3329 $r4 = "[";
3330 } else {
3331 if (!$silence) {$this->fail(19);}
3332 $r4 = self::$FAILED;
3333 $r2 = self::$FAILED;
3334 goto seq_1;
3335 }
3336 $r5 = self::$FAILED;
3337 for (;;) {
3338 $r6 = $this->input[$this->currPos] ?? '';
3339 if (preg_match("/^[0-9A-Fa-f:.]/", $r6)) {
3340 $this->currPos++;
3341 $r5 = true;
3342 } else {
3343 $r6 = self::$FAILED;
3344 if (!$silence) {$this->fail(20);}
3345 break;
3346 }
3347 }
3348 if ($r5===self::$FAILED) {
3349 $this->currPos = $p3;
3350 $r2 = self::$FAILED;
3351 goto seq_1;
3352 }
3353 // free $r6
3354 if (($this->input[$this->currPos] ?? null) === "]") {
3355 $this->currPos++;
3356 $r6 = "]";
3357 } else {
3358 if (!$silence) {$this->fail(21);}
3359 $r6 = self::$FAILED;
3360 $this->currPos = $p3;
3361 $r2 = self::$FAILED;
3362 goto seq_1;
3363 }
3364 $r2 = true;
3365 seq_1:
3366 if ($r2!==self::$FAILED) {
3367 $r2 = substr($this->input, $p1, $this->currPos - $p1);
3368 } else {
3369 $r2 = self::$FAILED;
3370 }
3371 // free $p3
3372 // free $p1
3373 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3374 $this->currPos,
3375 $r2,
3376 self::$UNDEFINED,
3377 self::$UNDEFINED
3378 );
3379 return $r2;
3380 }
3381 private function discardinline_breaks($silence, $boolParams, &$param_preproc, &$param_th) {
3382 $key = json_encode([311, $boolParams & 0x1ffe, $param_preproc, $param_th]);
3383 $bucket = $this->currPos;
3384 $cached = $this->cache[$bucket][$key] ?? null;
3385 if ($cached) {
3386 $this->currPos = $cached->nextPos;
3387 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
3388 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
3389 return $cached->result;
3390 }
3391 $saved_preproc=$param_preproc;
3392 $saved_th=$param_th;
3393 // start seq_1
3394 $p1 = $this->currPos;
3395 $p3 = $this->currPos;
3396 if (strspn($this->input, "=|!{}:;\x0d\x0a[]-", $this->currPos, 1) !== 0) {
3397 $r4 = $this->input[$this->currPos++];
3398 $r4 = false;
3399 $this->currPos = $p3;
3400 } else {
3401 $r4 = self::$FAILED;
3402 $r2 = self::$FAILED;
3403 goto seq_1;
3404 }
3405 // free $p3
3406 // start seq_2
3407 $p3 = $this->currPos;
3408 $this->savedPos = $this->currPos;
3409 $r6 = $this->a30(/*annOrExtTag*/($boolParams & 0x2) !== 0, /*h*/($boolParams & 0x4) !== 0, /*extlink*/($boolParams & 0x8) !== 0, /*intemplate*/($boolParams & 0x10) !== 0, $param_preproc, /*equal*/($boolParams & 0x20) !== 0, /*table*/($boolParams & 0x40) !== 0, /*templateArg*/($boolParams & 0x80) !== 0, /*tableCellArg*/($boolParams & 0x100) !== 0, /*semicolon*/($boolParams & 0x200) !== 0, /*arrow*/($boolParams & 0x400) !== 0, /*linkdesc*/($boolParams & 0x800) !== 0, /*colon*/($boolParams & 0x1000) !== 0, $param_th);
3410 if ($r6) {
3411 $r6 = false;
3412 } else {
3413 $r6 = self::$FAILED;
3414 $this->currPos = $p3;
3415 $r5 = self::$FAILED;
3416 goto seq_2;
3417 }
3418 $r5 = true;
3419 seq_2:
3420 if ($r5===self::$FAILED) {
3421 $this->currPos = $p1;
3422 $r2 = self::$FAILED;
3423 goto seq_1;
3424 }
3425 // free $r5,$p3
3426 $r2 = true;
3427 seq_1:
3428 // free $r2,$p1
3429 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3430 $this->currPos,
3431 $r2,
3432 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
3433 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
3434 );
3435 return $r2;
3436 }
3437 private function parseno_punctuation_char($silence) {
3438 $key = 338;
3439 $bucket = $this->currPos;
3440 $cached = $this->cache[$bucket][$key] ?? null;
3441 if ($cached) {
3442 $this->currPos = $cached->nextPos;
3443
3444 return $cached->result;
3445 }
3446
3447 $r1 = self::charAt($this->input, $this->currPos);
3448 if (preg_match("/^[^ \\]\\[\\x0d\\x0a\"'<>\\x00- \\x7f&\\x{a0}\\x{1680}\\x{180e}\\x{2000}-\\x{200a}\\x{202f}\\x{205f}\\x{3000}{]/u", $r1)) {
3449 $this->currPos += strlen($r1);
3450 } else {
3451 $r1 = self::$FAILED;
3452 if (!$silence) {$this->fail(22);}
3453 }
3454 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3455 $this->currPos,
3456 $r1,
3457 self::$UNDEFINED,
3458 self::$UNDEFINED
3459 );
3460 return $r1;
3461 }
3462 private function parsetplarg_or_template($silence, $boolParams, &$param_th, &$param_preproc) {
3463 $key = json_encode([346, $boolParams & 0x3fef, $param_th, $param_preproc]);
3464 $bucket = $this->currPos;
3465 $cached = $this->cache[$bucket][$key] ?? null;
3466 if ($cached) {
3467 $this->currPos = $cached->nextPos;
3468 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
3469 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
3470 return $cached->result;
3471 }
3472 $saved_th=$param_th;
3473 $saved_preproc=$param_preproc;
3474 $p2 = $this->currPos;
3475 // start seq_1
3476 $p3 = $this->currPos;
3477 $p4 = $this->currPos;
3478 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) {
3479 $r5 = "{{";
3480 $this->currPos += 2;
3481 $r5 = false;
3482 $this->currPos = $p4;
3483 } else {
3484 $r5 = self::$FAILED;
3485 $r1 = self::$FAILED;
3486 goto seq_1;
3487 }
3488 // free $p4
3489 $r6 = $this->parsetplarg_or_template_guarded($silence, $boolParams | 0x10, $param_th, $param_preproc);
3490 // t <- $r6
3491 if ($r6===self::$FAILED) {
3492 $this->currPos = $p3;
3493 $r1 = self::$FAILED;
3494 goto seq_1;
3495 }
3496 $r1 = true;
3497 seq_1:
3498 if ($r1!==self::$FAILED) {
3499 $this->savedPos = $p2;
3500 $r1 = $this->a31($r6);
3501 }
3502 // free $p3
3503 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3504 $this->currPos,
3505 $r1,
3506 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
3507 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
3508 );
3509 return $r1;
3510 }
3511 private function parsehtmlentity($silence) {
3512 $key = 498;
3513 $bucket = $this->currPos;
3514 $cached = $this->cache[$bucket][$key] ?? null;
3515 if ($cached) {
3516 $this->currPos = $cached->nextPos;
3517
3518 return $cached->result;
3519 }
3520
3521 $p2 = $this->currPos;
3522 $r3 = $this->parseraw_htmlentity($silence);
3523 // cc <- $r3
3524 $r1 = $r3;
3525 if ($r1!==self::$FAILED) {
3526 $this->savedPos = $p2;
3527 $r1 = $this->a32($r3);
3528 }
3529 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3530 $this->currPos,
3531 $r1,
3532 self::$UNDEFINED,
3533 self::$UNDEFINED
3534 );
3535 return $r1;
3536 }
3537 private function parseoptional_spaces($silence) {
3538 $key = 528;
3539 $bucket = $this->currPos;
3540 $cached = $this->cache[$bucket][$key] ?? null;
3541 if ($cached) {
3542 $this->currPos = $cached->nextPos;
3543
3544 return $cached->result;
3545 }
3546
3547 $p1 = $this->currPos;
3548 for (;;) {
3549 $r3 = $this->input[$this->currPos] ?? '';
3550 if ($r3 === " " || $r3 === "\x09") {
3551 $this->currPos++;
3552 } else {
3553 $r3 = self::$FAILED;
3554 if (!$silence) {$this->fail(10);}
3555 break;
3556 }
3557 }
3558 // free $r3
3559 $r2 = true;
3560 if ($r2!==self::$FAILED) {
3561 $r2 = substr($this->input, $p1, $this->currPos - $p1);
3562 } else {
3563 $r2 = self::$FAILED;
3564 }
3565 // free $p1
3566 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3567 $this->currPos,
3568 $r2,
3569 self::$UNDEFINED,
3570 self::$UNDEFINED
3571 );
3572 return $r2;
3573 }
3574 private function discardpipe($silence) {
3575 $key = 523;
3576 $bucket = $this->currPos;
3577 $cached = $this->cache[$bucket][$key] ?? null;
3578 if ($cached) {
3579 $this->currPos = $cached->nextPos;
3580
3581 return $cached->result;
3582 }
3583
3584 // start choice_1
3585 if (($this->input[$this->currPos] ?? null) === "|") {
3586 $this->currPos++;
3587 $r1 = "|";
3588 goto choice_1;
3589 } else {
3590 if (!$silence) {$this->fail(13);}
3591 $r1 = self::$FAILED;
3592 }
3593 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}", $this->currPos, 5, false) === 0) {
3594 $r1 = "{{!}}";
3595 $this->currPos += 5;
3596 } else {
3597 if (!$silence) {$this->fail(14);}
3598 $r1 = self::$FAILED;
3599 }
3600 choice_1:
3601 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3602 $this->currPos,
3603 $r1,
3604 self::$UNDEFINED,
3605 self::$UNDEFINED
3606 );
3607 return $r1;
3608 }
3609 private function parsetable_attribute($silence, $boolParams, &$param_preproc, &$param_th) {
3610 $key = json_encode([432, $boolParams & 0x3fff, $param_preproc, $param_th]);
3611 $bucket = $this->currPos;
3612 $cached = $this->cache[$bucket][$key] ?? null;
3613 if ($cached) {
3614 $this->currPos = $cached->nextPos;
3615 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
3616 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
3617 return $cached->result;
3618 }
3619 $saved_preproc=$param_preproc;
3620 $saved_th=$param_th;
3621 $p2 = $this->currPos;
3622 // start seq_1
3623 $p3 = $this->currPos;
3624 $r4 = $this->parseoptionalSpaceToken($silence);
3625 // s <- $r4
3626 if ($r4===self::$FAILED) {
3627 $r1 = self::$FAILED;
3628 goto seq_1;
3629 }
3630 $p6 = $this->currPos;
3631 $r5 = '';
3632 // namePos0 <- $r5
3633 if ($r5!==self::$FAILED) {
3634 $this->savedPos = $p6;
3635 $r5 = $this->a33($r4);
3636 } else {
3637 $this->currPos = $p3;
3638 $r1 = self::$FAILED;
3639 goto seq_1;
3640 }
3641 $r7 = $this->parsetable_attribute_name($silence, $boolParams, $param_preproc, $param_th);
3642 // name <- $r7
3643 if ($r7===self::$FAILED) {
3644 $this->currPos = $p3;
3645 $r1 = self::$FAILED;
3646 goto seq_1;
3647 }
3648 $p9 = $this->currPos;
3649 $r8 = '';
3650 // namePos1 <- $r8
3651 if ($r8!==self::$FAILED) {
3652 $this->savedPos = $p9;
3653 $r8 = $this->a34($r4, $r5, $r7);
3654 } else {
3655 $this->currPos = $p3;
3656 $r1 = self::$FAILED;
3657 goto seq_1;
3658 }
3659 $p11 = $this->currPos;
3660 // start seq_2
3661 $p12 = $this->currPos;
3662 $r13 = $this->discardoptionalSpaceToken($silence);
3663 if ($r13===self::$FAILED) {
3664 $r10 = self::$FAILED;
3665 goto seq_2;
3666 }
3667 if (($this->input[$this->currPos] ?? null) === "=") {
3668 $this->currPos++;
3669 $r14 = "=";
3670 } else {
3671 if (!$silence) {$this->fail(23);}
3672 $r14 = self::$FAILED;
3673 $this->currPos = $p12;
3674 $r10 = self::$FAILED;
3675 goto seq_2;
3676 }
3677 $r15 = $this->parsetable_att_value($silence, $boolParams, $param_preproc, $param_th);
3678 if ($r15===self::$FAILED) {
3679 $r15 = null;
3680 }
3681 // v <- $r15
3682 $r10 = true;
3683 seq_2:
3684 if ($r10!==self::$FAILED) {
3685 $this->savedPos = $p11;
3686 $r10 = $this->a35($r4, $r5, $r7, $r8, $r15);
3687 } else {
3688 $r10 = null;
3689 }
3690 // free $p12
3691 // vd <- $r10
3692 $r1 = true;
3693 seq_1:
3694 if ($r1!==self::$FAILED) {
3695 $this->savedPos = $p2;
3696 $r1 = $this->a36($r4, $r5, $r7, $r8, $r10);
3697 }
3698 // free $p3
3699 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3700 $this->currPos,
3701 $r1,
3702 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
3703 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
3704 );
3705 return $r1;
3706 }
3707 private function discardoptionalSpaceToken($silence) {
3708 $key = 545;
3709 $bucket = $this->currPos;
3710 $cached = $this->cache[$bucket][$key] ?? null;
3711 if ($cached) {
3712 $this->currPos = $cached->nextPos;
3713
3714 return $cached->result;
3715 }
3716
3717 $p2 = $this->currPos;
3718 $r3 = $this->parseoptional_spaces($silence);
3719 // s <- $r3
3720 $r1 = $r3;
3721 if ($r1!==self::$FAILED) {
3722 $this->savedPos = $p2;
3723 $r1 = $this->a37($r3);
3724 }
3725 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3726 $this->currPos,
3727 $r1,
3728 self::$UNDEFINED,
3729 self::$UNDEFINED
3730 );
3731 return $r1;
3732 }
3733 private function parsebroken_table_attribute_name_char($silence) {
3734 $key = 438;
3735 $bucket = $this->currPos;
3736 $cached = $this->cache[$bucket][$key] ?? null;
3737 if ($cached) {
3738 $this->currPos = $cached->nextPos;
3739
3740 return $cached->result;
3741 }
3742
3743 $p2 = $this->currPos;
3744 // c <- $r3
3745 if (strspn($this->input, "\x00/=>", $this->currPos, 1) !== 0) {
3746 $r3 = $this->input[$this->currPos++];
3747 } else {
3748 $r3 = self::$FAILED;
3749 if (!$silence) {$this->fail(24);}
3750 }
3751 $r1 = $r3;
3752 if ($r1!==self::$FAILED) {
3753 $this->savedPos = $p2;
3754 $r1 = $this->a38($r3);
3755 }
3756 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3757 $this->currPos,
3758 $r1,
3759 self::$UNDEFINED,
3760 self::$UNDEFINED
3761 );
3762 return $r1;
3763 }
3764 private function parsegeneric_newline_attribute($silence, $boolParams, &$param_preproc, &$param_th) {
3765 $key = json_encode([430, $boolParams & 0x3fff, $param_preproc, $param_th]);
3766 $bucket = $this->currPos;
3767 $cached = $this->cache[$bucket][$key] ?? null;
3768 if ($cached) {
3769 $this->currPos = $cached->nextPos;
3770 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
3771 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
3772 return $cached->result;
3773 }
3774 $saved_preproc=$param_preproc;
3775 $saved_th=$param_th;
3776 $p2 = $this->currPos;
3777 // start seq_1
3778 $p3 = $this->currPos;
3779 for (;;) {
3780 $r5 = $this->discardspace_or_newline_or_solidus($silence);
3781 if ($r5===self::$FAILED) {
3782 break;
3783 }
3784 }
3785 // free $r5
3786 $r4 = true;
3787 if ($r4===self::$FAILED) {
3788 $r1 = self::$FAILED;
3789 goto seq_1;
3790 }
3791 // free $r4
3792 $p6 = $this->currPos;
3793 $r4 = '';
3794 // namePos0 <- $r4
3795 if ($r4!==self::$FAILED) {
3796 $this->savedPos = $p6;
3797 $r4 = $this->a17();
3798 } else {
3799 $this->currPos = $p3;
3800 $r1 = self::$FAILED;
3801 goto seq_1;
3802 }
3803 $r5 = $this->parsegeneric_attribute_name($silence, $boolParams, $param_preproc, $param_th);
3804 // name <- $r5
3805 if ($r5===self::$FAILED) {
3806 $this->currPos = $p3;
3807 $r1 = self::$FAILED;
3808 goto seq_1;
3809 }
3810 $p8 = $this->currPos;
3811 $r7 = '';
3812 // namePos1 <- $r7
3813 if ($r7!==self::$FAILED) {
3814 $this->savedPos = $p8;
3815 $r7 = $this->a39($r4, $r5);
3816 } else {
3817 $this->currPos = $p3;
3818 $r1 = self::$FAILED;
3819 goto seq_1;
3820 }
3821 $p10 = $this->currPos;
3822 // start seq_2
3823 $p11 = $this->currPos;
3824 for (;;) {
3825 $r13 = $this->discardspace_or_newline($silence);
3826 if ($r13===self::$FAILED) {
3827 break;
3828 }
3829 }
3830 // free $r13
3831 $r12 = true;
3832 if ($r12===self::$FAILED) {
3833 $r9 = self::$FAILED;
3834 goto seq_2;
3835 }
3836 // free $r12
3837 if (($this->input[$this->currPos] ?? null) === "=") {
3838 $this->currPos++;
3839 $r12 = "=";
3840 } else {
3841 if (!$silence) {$this->fail(23);}
3842 $r12 = self::$FAILED;
3843 $this->currPos = $p11;
3844 $r9 = self::$FAILED;
3845 goto seq_2;
3846 }
3847 $r13 = $this->parsegeneric_att_value($silence, $boolParams, $param_preproc, $param_th);
3848 if ($r13===self::$FAILED) {
3849 $r13 = null;
3850 }
3851 // v <- $r13
3852 $r9 = true;
3853 seq_2:
3854 if ($r9!==self::$FAILED) {
3855 $this->savedPos = $p10;
3856 $r9 = $this->a40($r4, $r5, $r7, $r13);
3857 } else {
3858 $r9 = null;
3859 }
3860 // free $p11
3861 // vd <- $r9
3862 $r1 = true;
3863 seq_1:
3864 if ($r1!==self::$FAILED) {
3865 $this->savedPos = $p2;
3866 $r1 = $this->a41($r4, $r5, $r7, $r9);
3867 }
3868 // free $p3
3869 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3870 $this->currPos,
3871 $r1,
3872 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
3873 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
3874 );
3875 return $r1;
3876 }
3877 private function parseextlink_nonipv6url($silence, $boolParams, &$param_preproc, &$param_th) {
3878 $key = json_encode([506, $boolParams & 0x37ff, $param_preproc, $param_th]);
3879 $bucket = $this->currPos;
3880 $cached = $this->cache[$bucket][$key] ?? null;
3881 if ($cached) {
3882 $this->currPos = $cached->nextPos;
3883 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
3884 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
3885 return $cached->result;
3886 }
3887 $saved_preproc=$param_preproc;
3888 $saved_th=$param_th;
3889 $r1 = $this->parseextlink_nonipv6url_parameterized($silence, $boolParams & ~0x800, $param_preproc, $param_th);
3890 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3891 $this->currPos,
3892 $r1,
3893 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
3894 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
3895 );
3896 return $r1;
3897 }
3898 private function discardspace($silence) {
3899 $key = 527;
3900 $bucket = $this->currPos;
3901 $cached = $this->cache[$bucket][$key] ?? null;
3902 if ($cached) {
3903 $this->currPos = $cached->nextPos;
3904
3905 return $cached->result;
3906 }
3907
3908 $r1 = $this->input[$this->currPos] ?? '';
3909 if ($r1 === " " || $r1 === "\x09") {
3910 $this->currPos++;
3911 } else {
3912 $r1 = self::$FAILED;
3913 if (!$silence) {$this->fail(10);}
3914 }
3915 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3916 $this->currPos,
3917 $r1,
3918 self::$UNDEFINED,
3919 self::$UNDEFINED
3920 );
3921 return $r1;
3922 }
3923 private function discardunispace($silence) {
3924 $key = 551;
3925 $bucket = $this->currPos;
3926 $cached = $this->cache[$bucket][$key] ?? null;
3927 if ($cached) {
3928 $this->currPos = $cached->nextPos;
3929
3930 return $cached->result;
3931 }
3932
3933 $r1 = self::charAt($this->input, $this->currPos);
3934 if (preg_match("/^[ \\x{a0}\\x{1680}\\x{2000}-\\x{200a}\\x{202f}\\x{205f}\\x{3000}]/u", $r1)) {
3935 $this->currPos += strlen($r1);
3936 } else {
3937 $r1 = self::$FAILED;
3938 if (!$silence) {$this->fail(25);}
3939 }
3940 $this->cache[$bucket][$key] = new GrammarCacheEntry(
3941 $this->currPos,
3942 $r1,
3943 self::$UNDEFINED,
3944 self::$UNDEFINED
3945 );
3946 return $r1;
3947 }
3948 private function parseinlineline($silence, $boolParams, &$param_preproc, &$param_th) {
3949 $key = json_encode([312, $boolParams & 0x3fff, $param_preproc, $param_th]);
3950 $bucket = $this->currPos;
3951 $cached = $this->cache[$bucket][$key] ?? null;
3952 if ($cached) {
3953 $this->currPos = $cached->nextPos;
3954 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
3955 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
3956 return $cached->result;
3957 }
3958 $saved_preproc=$param_preproc;
3959 $saved_th=$param_th;
3960 $p2 = $this->currPos;
3961 $r3 = [];
3962 for (;;) {
3963 // start choice_1
3964 $r4 = $this->parseurltext($silence, $boolParams, $param_preproc, $param_th);
3965 if ($r4!==self::$FAILED) {
3966 goto choice_1;
3967 }
3968 $p5 = $this->currPos;
3969 // start seq_1
3970 $p6 = $this->currPos;
3971 $p7 = $this->currPos;
3972 $r8 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
3973 if ($r8 === self::$FAILED) {
3974 $r8 = false;
3975 } else {
3976 $r8 = self::$FAILED;
3977 $this->currPos = $p7;
3978 $r4 = self::$FAILED;
3979 goto seq_1;
3980 }
3981 // free $p7
3982 // start choice_2
3983 $r9 = $this->parseinline_element($silence, $boolParams, $param_preproc, $param_th);
3984 if ($r9!==self::$FAILED) {
3985 goto choice_2;
3986 }
3987 $p7 = $this->currPos;
3988 // start seq_2
3989 $p10 = $this->currPos;
3990 $p11 = $this->currPos;
3991 $r12 = $this->discardnewline(true);
3992 if ($r12 === self::$FAILED) {
3993 $r12 = false;
3994 } else {
3995 $r12 = self::$FAILED;
3996 $this->currPos = $p11;
3997 $r9 = self::$FAILED;
3998 goto seq_2;
3999 }
4000 // free $p11
4001 // s <- $r13
4002 if ($this->currPos < $this->inputLength) {
4003 $r13 = self::consumeChar($this->input, $this->currPos);;
4004 } else {
4005 $r13 = self::$FAILED;
4006 if (!$silence) {$this->fail(7);}
4007 $this->currPos = $p10;
4008 $r9 = self::$FAILED;
4009 goto seq_2;
4010 }
4011 $r9 = true;
4012 seq_2:
4013 if ($r9!==self::$FAILED) {
4014 $this->savedPos = $p7;
4015 $r9 = $this->a42($r13);
4016 }
4017 // free $p10
4018 choice_2:
4019 // r <- $r9
4020 if ($r9===self::$FAILED) {
4021 $this->currPos = $p6;
4022 $r4 = self::$FAILED;
4023 goto seq_1;
4024 }
4025 $r4 = true;
4026 seq_1:
4027 if ($r4!==self::$FAILED) {
4028 $this->savedPos = $p5;
4029 $r4 = $this->a24($r9);
4030 }
4031 // free $p6
4032 choice_1:
4033 if ($r4!==self::$FAILED) {
4034 $r3[] = $r4;
4035 } else {
4036 break;
4037 }
4038 }
4039 if (count($r3) === 0) {
4040 $r3 = self::$FAILED;
4041 }
4042 // c <- $r3
4043 // free $r4
4044 $r1 = $r3;
4045 if ($r1!==self::$FAILED) {
4046 $this->savedPos = $p2;
4047 $r1 = $this->a43($r3);
4048 }
4049 $this->cache[$bucket][$key] = new GrammarCacheEntry(
4050 $this->currPos,
4051 $r1,
4052 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
4053 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
4054 );
4055 return $r1;
4056 }
4057 private function parsedtdd($silence, $boolParams, &$param_preproc, &$param_th) {
4058 $key = json_encode([454, $boolParams & 0x3fff, $param_preproc, $param_th]);
4059 $bucket = $this->currPos;
4060 $cached = $this->cache[$bucket][$key] ?? null;
4061 if ($cached) {
4062 $this->currPos = $cached->nextPos;
4063 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
4064 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
4065 return $cached->result;
4066 }
4067 $saved_preproc=$param_preproc;
4068 $saved_th=$param_th;
4069 $p2 = $this->currPos;
4070 // start seq_1
4071 $p3 = $this->currPos;
4072 $r4 = [];
4073 for (;;) {
4074 $p6 = $this->currPos;
4075 // start seq_2
4076 $p7 = $this->currPos;
4077 $p8 = $this->currPos;
4078 // start seq_3
4079 $p10 = $this->currPos;
4080 if (($this->input[$this->currPos] ?? null) === ";") {
4081 $this->currPos++;
4082 $r11 = ";";
4083 } else {
4084 $r11 = self::$FAILED;
4085 $r9 = self::$FAILED;
4086 goto seq_3;
4087 }
4088 $p12 = $this->currPos;
4089 $r13 = $this->discardlist_char(true);
4090 if ($r13 === self::$FAILED) {
4091 $r13 = false;
4092 } else {
4093 $r13 = self::$FAILED;
4094 $this->currPos = $p12;
4095 $this->currPos = $p10;
4096 $r9 = self::$FAILED;
4097 goto seq_3;
4098 }
4099 // free $p12
4100 $r9 = true;
4101 seq_3:
4102 // free $p10
4103 if ($r9 === self::$FAILED) {
4104 $r9 = false;
4105 } else {
4106 $r9 = self::$FAILED;
4107 $this->currPos = $p8;
4108 $r5 = self::$FAILED;
4109 goto seq_2;
4110 }
4111 // free $p8
4112 $r14 = $this->parselist_char($silence);
4113 // lc <- $r14
4114 if ($r14===self::$FAILED) {
4115 $this->currPos = $p7;
4116 $r5 = self::$FAILED;
4117 goto seq_2;
4118 }
4119 $r5 = true;
4120 seq_2:
4121 if ($r5!==self::$FAILED) {
4122 $this->savedPos = $p6;
4123 $r5 = $this->a44($r14);
4124 $r4[] = $r5;
4125 } else {
4126 break;
4127 }
4128 // free $p7
4129 }
4130 // bullets <- $r4
4131 // free $r5
4132 if (($this->input[$this->currPos] ?? null) === ";") {
4133 $this->currPos++;
4134 $r5 = ";";
4135 } else {
4136 if (!$silence) {$this->fail(26);}
4137 $r5 = self::$FAILED;
4138 $this->currPos = $p3;
4139 $r1 = self::$FAILED;
4140 goto seq_1;
4141 }
4142 $r15 = [];
4143 for (;;) {
4144 $r16 = $this->parsedtdd_colon($silence, $boolParams, $param_preproc, $param_th);
4145 if ($r16!==self::$FAILED) {
4146 $r15[] = $r16;
4147 } else {
4148 break;
4149 }
4150 }
4151 // colons <- $r15
4152 // free $r16
4153 $r16 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th);
4154 if ($r16===self::$FAILED) {
4155 $r16 = null;
4156 }
4157 // d <- $r16
4158 $p7 = $this->currPos;
4159 $r17 = $this->discardeolf(true);
4160 if ($r17!==self::$FAILED) {
4161 $r17 = false;
4162 $this->currPos = $p7;
4163 } else {
4164 $this->currPos = $p3;
4165 $r1 = self::$FAILED;
4166 goto seq_1;
4167 }
4168 // free $p7
4169 $r1 = true;
4170 seq_1:
4171 if ($r1!==self::$FAILED) {
4172 $this->savedPos = $p2;
4173 $r1 = $this->a45($r4, $r15, $r16);
4174 }
4175 // free $p3
4176 $this->cache[$bucket][$key] = new GrammarCacheEntry(
4177 $this->currPos,
4178 $r1,
4179 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
4180 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
4181 );
4182 return $r1;
4183 }
4184 private function parsehacky_dl_uses($silence, $boolParams, &$param_preproc, &$param_th) {
4185 $key = json_encode([450, $boolParams & 0x3fff, $param_preproc, $param_th]);
4186 $bucket = $this->currPos;
4187 $cached = $this->cache[$bucket][$key] ?? null;
4188 if ($cached) {
4189 $this->currPos = $cached->nextPos;
4190 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
4191 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
4192 return $cached->result;
4193 }
4194 $saved_preproc=$param_preproc;
4195 $saved_th=$param_th;
4196 $p2 = $this->currPos;
4197 // start seq_1
4198 $p3 = $this->currPos;
4199 $r4 = [];
4200 for (;;) {
4201 if (($this->input[$this->currPos] ?? null) === ":") {
4202 $this->currPos++;
4203 $r5 = ":";
4204 $r4[] = $r5;
4205 } else {
4206 if (!$silence) {$this->fail(18);}
4207 $r5 = self::$FAILED;
4208 break;
4209 }
4210 }
4211 if (count($r4) === 0) {
4212 $r4 = self::$FAILED;
4213 }
4214 // bullets <- $r4
4215 if ($r4===self::$FAILED) {
4216 $r1 = self::$FAILED;
4217 goto seq_1;
4218 }
4219 // free $r5
4220 // start seq_2
4221 $p6 = $this->currPos;
4222 $r7 = $this->parsetable_line($silence, $boolParams, $param_preproc, $param_th);
4223 if ($r7===self::$FAILED) {
4224 $r5 = self::$FAILED;
4225 goto seq_2;
4226 }
4227 $r8 = [];
4228 for (;;) {
4229 // start seq_3
4230 $p10 = $this->currPos;
4231 $r11 = [];
4232 for (;;) {
4233 $r12 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th);
4234 if ($r12!==self::$FAILED) {
4235 $r11[] = $r12;
4236 } else {
4237 break;
4238 }
4239 }
4240 if (count($r11) === 0) {
4241 $r11 = self::$FAILED;
4242 }
4243 if ($r11===self::$FAILED) {
4244 $r9 = self::$FAILED;
4245 goto seq_3;
4246 }
4247 // free $r12
4248 $r12 = $this->parsetable_line($silence, $boolParams, $param_preproc, $param_th);
4249 if ($r12===self::$FAILED) {
4250 $this->currPos = $p10;
4251 $r9 = self::$FAILED;
4252 goto seq_3;
4253 }
4254 $r9 = [$r11,$r12];
4255 seq_3:
4256 if ($r9!==self::$FAILED) {
4257 $r8[] = $r9;
4258 } else {
4259 break;
4260 }
4261 // free $p10
4262 }
4263 // free $r9
4264 $r5 = [$r7,$r8];
4265 seq_2:
4266 // tbl <- $r5
4267 if ($r5===self::$FAILED) {
4268 $this->currPos = $p3;
4269 $r1 = self::$FAILED;
4270 goto seq_1;
4271 }
4272 // free $p6
4273 $r9 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th);
4274 if ($r9===self::$FAILED) {
4275 $r9 = null;
4276 }
4277 // line <- $r9
4278 $p6 = $this->currPos;
4279 // start seq_4
4280 $p10 = $this->currPos;
4281 for (;;) {
4282 // start choice_1
4283 $r15 = $this->discardspace(true);
4284 if ($r15!==self::$FAILED) {
4285 goto choice_1;
4286 }
4287 $r15 = $this->discardcomment(true);
4288 choice_1:
4289 if ($r15===self::$FAILED) {
4290 break;
4291 }
4292 }
4293 // free $r15
4294 $r14 = true;
4295 if ($r14===self::$FAILED) {
4296 $r13 = self::$FAILED;
4297 goto seq_4;
4298 }
4299 // free $r14
4300 $r14 = $this->discardeolf(true);
4301 if ($r14===self::$FAILED) {
4302 $this->currPos = $p10;
4303 $r13 = self::$FAILED;
4304 goto seq_4;
4305 }
4306 $r13 = true;
4307 seq_4:
4308 if ($r13!==self::$FAILED) {
4309 $r13 = false;
4310 $this->currPos = $p6;
4311 } else {
4312 $this->currPos = $p3;
4313 $r1 = self::$FAILED;
4314 goto seq_1;
4315 }
4316 // free $p10
4317 // free $p6
4318 $r1 = true;
4319 seq_1:
4320 if ($r1!==self::$FAILED) {
4321 $this->savedPos = $p2;
4322 $r1 = $this->a46($r4, $r5, $r9);
4323 }
4324 // free $p3
4325 $this->cache[$bucket][$key] = new GrammarCacheEntry(
4326 $this->currPos,
4327 $r1,
4328 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
4329 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
4330 );
4331 return $r1;
4332 }
4333 private function parseli($silence, $boolParams, &$param_preproc, &$param_th) {
4334 $key = json_encode([448, $boolParams & 0x3fff, $param_preproc, $param_th]);
4335 $bucket = $this->currPos;
4336 $cached = $this->cache[$bucket][$key] ?? null;
4337 if ($cached) {
4338 $this->currPos = $cached->nextPos;
4339 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
4340 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
4341 return $cached->result;
4342 }
4343 $saved_preproc=$param_preproc;
4344 $saved_th=$param_th;
4345 $p2 = $this->currPos;
4346 // start seq_1
4347 $p3 = $this->currPos;
4348 $r4 = [];
4349 for (;;) {
4350 $r5 = $this->parselist_char($silence);
4351 if ($r5!==self::$FAILED) {
4352 $r4[] = $r5;
4353 } else {
4354 break;
4355 }
4356 }
4357 if (count($r4) === 0) {
4358 $r4 = self::$FAILED;
4359 }
4360 // bullets <- $r4
4361 if ($r4===self::$FAILED) {
4362 $r1 = self::$FAILED;
4363 goto seq_1;
4364 }
4365 // free $r5
4366 $r5 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th);
4367 if ($r5===self::$FAILED) {
4368 $r5 = null;
4369 }
4370 // c <- $r5
4371 $p6 = $this->currPos;
4372 // start choice_1
4373 $r7 = $this->discardeolf(true);
4374 if ($r7!==self::$FAILED) {
4375 goto choice_1;
4376 }
4377 $r7 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
4378 choice_1:
4379 if ($r7!==self::$FAILED) {
4380 $r7 = false;
4381 $this->currPos = $p6;
4382 } else {
4383 $this->currPos = $p3;
4384 $r1 = self::$FAILED;
4385 goto seq_1;
4386 }
4387 // free $p6
4388 $r1 = true;
4389 seq_1:
4390 if ($r1!==self::$FAILED) {
4391 $this->savedPos = $p2;
4392 $r1 = $this->a47($r4, $r5);
4393 }
4394 // free $p3
4395 $this->cache[$bucket][$key] = new GrammarCacheEntry(
4396 $this->currPos,
4397 $r1,
4398 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
4399 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
4400 );
4401 return $r1;
4402 }
4403 private function discardeof($silence) {
4404 $key = 533;
4405 $bucket = $this->currPos;
4406 $cached = $this->cache[$bucket][$key] ?? null;
4407 if ($cached) {
4408 $this->currPos = $cached->nextPos;
4409
4410 return $cached->result;
4411 }
4412
4413 $this->savedPos = $this->currPos;
4414 $r1 = $this->a48();
4415 if ($r1) {
4416 $r1 = false;
4417 } else {
4418 $r1 = self::$FAILED;
4419 }
4420 $this->cache[$bucket][$key] = new GrammarCacheEntry(
4421 $this->currPos,
4422 $r1,
4423 self::$UNDEFINED,
4424 self::$UNDEFINED
4425 );
4426 return $r1;
4427 }
4428 private function parseblock($silence, $boolParams, &$param_th, &$param_preproc) {
4429 $key = json_encode([296, $boolParams & 0x3fff, $param_th, $param_preproc]);
4430 $bucket = $this->currPos;
4431 $cached = $this->cache[$bucket][$key] ?? null;
4432 if ($cached) {
4433 $this->currPos = $cached->nextPos;
4434 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
4435 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
4436 return $cached->result;
4437 }
4438 $saved_th=$param_th;
4439 $saved_preproc=$param_preproc;
4440 // start choice_1
4441 $p2 = $this->currPos;
4442 // start seq_1
4443 $p3 = $this->currPos;
4444 $p4 = $this->currPos;
4445 $r5 = $this->discardsof(true);
4446 if ($r5!==self::$FAILED) {
4447 $r5 = false;
4448 $this->currPos = $p4;
4449 } else {
4450 $r1 = self::$FAILED;
4451 goto seq_1;
4452 }
4453 // free $p4
4454 $r6 = $this->parseredirect($silence, $boolParams, $param_th, $param_preproc);
4455 // r <- $r6
4456 if ($r6===self::$FAILED) {
4457 $this->currPos = $p3;
4458 $r1 = self::$FAILED;
4459 goto seq_1;
4460 }
4461 $r7 = [];
4462 for (;;) {
4463 $r8 = $this->parsesol_transparent($silence, $boolParams, $param_preproc, $param_th);
4464 if ($r8!==self::$FAILED) {
4465 $r7[] = $r8;
4466 } else {
4467 break;
4468 }
4469 }
4470 // cil <- $r7
4471 // free $r8
4472 $r8 = $this->parseblock_line($silence, $boolParams, $param_preproc, $param_th);
4473 if ($r8===self::$FAILED) {
4474 $r8 = null;
4475 }
4476 // bl <- $r8
4477 $r1 = true;
4478 seq_1:
4479 if ($r1!==self::$FAILED) {
4480 $this->savedPos = $p2;
4481 $r1 = $this->a49($r6, $r7, $r8);
4482 goto choice_1;
4483 }
4484 // free $p3
4485 $r1 = $this->parseblock_lines($silence, $boolParams, $param_preproc, $param_th);
4486 if ($r1!==self::$FAILED) {
4487 goto choice_1;
4488 }
4489 $r1 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th);
4490 if ($r1!==self::$FAILED) {
4491 goto choice_1;
4492 }
4493 $p3 = $this->currPos;
4494 // start seq_2
4495 $p4 = $this->currPos;
4496 $r9 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th);
4497 // s <- $r9
4498 if ($r9===self::$FAILED) {
4499 $r1 = self::$FAILED;
4500 goto seq_2;
4501 }
4502 $p10 = $this->currPos;
4503 $r11 = $this->discardsof(true);
4504 if ($r11 === self::$FAILED) {
4505 $r11 = false;
4506 } else {
4507 $r11 = self::$FAILED;
4508 $this->currPos = $p10;
4509 $this->currPos = $p4;
4510 $r1 = self::$FAILED;
4511 goto seq_2;
4512 }
4513 // free $p10
4514 $p10 = $this->currPos;
4515 $r12 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
4516 if ($r12 === self::$FAILED) {
4517 $r12 = false;
4518 } else {
4519 $r12 = self::$FAILED;
4520 $this->currPos = $p10;
4521 $this->currPos = $p4;
4522 $r1 = self::$FAILED;
4523 goto seq_2;
4524 }
4525 // free $p10
4526 $r1 = true;
4527 seq_2:
4528 if ($r1!==self::$FAILED) {
4529 $this->savedPos = $p3;
4530 $r1 = $this->a42($r9);
4531 }
4532 // free $p4
4533 choice_1:
4534 $this->cache[$bucket][$key] = new GrammarCacheEntry(
4535 $this->currPos,
4536 $r1,
4537 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
4538 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
4539 );
4540 return $r1;
4541 }
4542 private function discardnewline($silence) {
4543 $key = 535;
4544 $bucket = $this->currPos;
4545 $cached = $this->cache[$bucket][$key] ?? null;
4546 if ($cached) {
4547 $this->currPos = $cached->nextPos;
4548
4549 return $cached->result;
4550 }
4551
4552 // start choice_1
4553 if (($this->input[$this->currPos] ?? null) === "\x0a") {
4554 $this->currPos++;
4555 $r1 = "\x0a";
4556 goto choice_1;
4557 } else {
4558 if (!$silence) {$this->fail(27);}
4559 $r1 = self::$FAILED;
4560 }
4561 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "\x0d\x0a", $this->currPos, 2, false) === 0) {
4562 $r1 = "\x0d\x0a";
4563 $this->currPos += 2;
4564 } else {
4565 if (!$silence) {$this->fail(28);}
4566 $r1 = self::$FAILED;
4567 }
4568 choice_1:
4569 $this->cache[$bucket][$key] = new GrammarCacheEntry(
4570 $this->currPos,
4571 $r1,
4572 self::$UNDEFINED,
4573 self::$UNDEFINED
4574 );
4575 return $r1;
4576 }
4577 private function parsetplarg_or_template_guarded($silence, $boolParams, &$param_th, &$param_preproc) {
4578 $key = json_encode([348, $boolParams & 0x3fff, $param_th, $param_preproc]);
4579 $bucket = $this->currPos;
4580 $cached = $this->cache[$bucket][$key] ?? null;
4581 if ($cached) {
4582 $this->currPos = $cached->nextPos;
4583 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
4584 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
4585 return $cached->result;
4586 }
4587 $saved_th=$param_th;
4588 $saved_preproc=$param_preproc;
4589 // start choice_1
4590 $p2 = $this->currPos;
4591 // start seq_1
4592 $p3 = $this->currPos;
4593 $p4 = $this->currPos;
4594 // start seq_2
4595 $p6 = $this->currPos;
4596 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) {
4597 $r7 = "{{";
4598 $this->currPos += 2;
4599 } else {
4600 $r7 = self::$FAILED;
4601 $r5 = self::$FAILED;
4602 goto seq_2;
4603 }
4604 $p8 = $this->currPos;
4605 // start seq_3
4606 $p10 = $this->currPos;
4607 $r11 = self::$FAILED;
4608 for (;;) {
4609 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) {
4610 $r12 = "{{{";
4611 $this->currPos += 3;
4612 $r11 = true;
4613 } else {
4614 $r12 = self::$FAILED;
4615 break;
4616 }
4617 }
4618 if ($r11===self::$FAILED) {
4619 $r9 = self::$FAILED;
4620 goto seq_3;
4621 }
4622 // free $r12
4623 $p13 = $this->currPos;
4624 if (($this->input[$this->currPos] ?? null) === "{") {
4625 $this->currPos++;
4626 $r12 = "{";
4627 } else {
4628 $r12 = self::$FAILED;
4629 }
4630 if ($r12 === self::$FAILED) {
4631 $r12 = false;
4632 } else {
4633 $r12 = self::$FAILED;
4634 $this->currPos = $p13;
4635 $this->currPos = $p10;
4636 $r9 = self::$FAILED;
4637 goto seq_3;
4638 }
4639 // free $p13
4640 $r9 = true;
4641 seq_3:
4642 if ($r9!==self::$FAILED) {
4643 $r9 = false;
4644 $this->currPos = $p8;
4645 } else {
4646 $this->currPos = $p6;
4647 $r5 = self::$FAILED;
4648 goto seq_2;
4649 }
4650 // free $p10
4651 // free $p8
4652 $r14 = $this->discardtplarg(true, $boolParams, $param_th);
4653 if ($r14===self::$FAILED) {
4654 $this->currPos = $p6;
4655 $r5 = self::$FAILED;
4656 goto seq_2;
4657 }
4658 $r5 = true;
4659 seq_2:
4660 if ($r5!==self::$FAILED) {
4661 $r5 = false;
4662 $this->currPos = $p4;
4663 } else {
4664 $r1 = self::$FAILED;
4665 goto seq_1;
4666 }
4667 // free $p6
4668 // free $p4
4669 // start choice_2
4670 $r15 = $this->parsetemplate($silence, $boolParams, $param_th);
4671 if ($r15!==self::$FAILED) {
4672 goto choice_2;
4673 }
4674 $r15 = $this->parsebroken_template($silence, $param_preproc);
4675 choice_2:
4676 // a <- $r15
4677 if ($r15===self::$FAILED) {
4678 $this->currPos = $p3;
4679 $r1 = self::$FAILED;
4680 goto seq_1;
4681 }
4682 $r1 = true;
4683 seq_1:
4684 if ($r1!==self::$FAILED) {
4685 $this->savedPos = $p2;
4686 $r1 = $this->a50($r15);
4687 goto choice_1;
4688 }
4689 // free $p3
4690 $p3 = $this->currPos;
4691 // start seq_4
4692 $p4 = $this->currPos;
4693 $p6 = $this->currPos;
4694 // start seq_5
4695 $p8 = $this->currPos;
4696 if (($this->input[$this->currPos] ?? null) === "{") {
4697 $this->currPos++;
4698 $r17 = "{";
4699 } else {
4700 if (!$silence) {$this->fail(29);}
4701 $r17 = self::$FAILED;
4702 $r16 = self::$FAILED;
4703 goto seq_5;
4704 }
4705 $p10 = $this->currPos;
4706 // start seq_6
4707 $p13 = $this->currPos;
4708 $r19 = self::$FAILED;
4709 for (;;) {
4710 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) {
4711 $r20 = "{{{";
4712 $this->currPos += 3;
4713 $r19 = true;
4714 } else {
4715 $r20 = self::$FAILED;
4716 break;
4717 }
4718 }
4719 if ($r19===self::$FAILED) {
4720 $r18 = self::$FAILED;
4721 goto seq_6;
4722 }
4723 // free $r20
4724 $p21 = $this->currPos;
4725 if (($this->input[$this->currPos] ?? null) === "{") {
4726 $this->currPos++;
4727 $r20 = "{";
4728 } else {
4729 $r20 = self::$FAILED;
4730 }
4731 if ($r20 === self::$FAILED) {
4732 $r20 = false;
4733 } else {
4734 $r20 = self::$FAILED;
4735 $this->currPos = $p21;
4736 $this->currPos = $p13;
4737 $r18 = self::$FAILED;
4738 goto seq_6;
4739 }
4740 // free $p21
4741 $r18 = true;
4742 seq_6:
4743 if ($r18!==self::$FAILED) {
4744 $r18 = false;
4745 $this->currPos = $p10;
4746 } else {
4747 $this->currPos = $p8;
4748 $r16 = self::$FAILED;
4749 goto seq_5;
4750 }
4751 // free $p13
4752 // free $p10
4753 $r16 = true;
4754 seq_5:
4755 if ($r16===self::$FAILED) {
4756 $r16 = null;
4757 }
4758 // free $p8
4759 // a <- $r16
4760 $r16 = substr($this->input, $p6, $this->currPos - $p6);
4761 // free $p6
4762 $r22 = $this->parsetplarg($silence, $boolParams, $param_th);
4763 // b <- $r22
4764 if ($r22===self::$FAILED) {
4765 $this->currPos = $p4;
4766 $r1 = self::$FAILED;
4767 goto seq_4;
4768 }
4769 $r1 = true;
4770 seq_4:
4771 if ($r1!==self::$FAILED) {
4772 $this->savedPos = $p3;
4773 $r1 = $this->a51($r16, $r22);
4774 goto choice_1;
4775 }
4776 // free $p4
4777 $p4 = $this->currPos;
4778 // start seq_7
4779 $p6 = $this->currPos;
4780 $p8 = $this->currPos;
4781 // start seq_8
4782 $p10 = $this->currPos;
4783 if (($this->input[$this->currPos] ?? null) === "{") {
4784 $this->currPos++;
4785 $r24 = "{";
4786 } else {
4787 if (!$silence) {$this->fail(29);}
4788 $r24 = self::$FAILED;
4789 $r23 = self::$FAILED;
4790 goto seq_8;
4791 }
4792 $p13 = $this->currPos;
4793 // start seq_9
4794 $p21 = $this->currPos;
4795 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) {
4796 $r26 = "{{";
4797 $this->currPos += 2;
4798 } else {
4799 $r26 = self::$FAILED;
4800 $r25 = self::$FAILED;
4801 goto seq_9;
4802 }
4803 $p27 = $this->currPos;
4804 if (($this->input[$this->currPos] ?? null) === "{") {
4805 $this->currPos++;
4806 $r28 = "{";
4807 } else {
4808 $r28 = self::$FAILED;
4809 }
4810 if ($r28 === self::$FAILED) {
4811 $r28 = false;
4812 } else {
4813 $r28 = self::$FAILED;
4814 $this->currPos = $p27;
4815 $this->currPos = $p21;
4816 $r25 = self::$FAILED;
4817 goto seq_9;
4818 }
4819 // free $p27
4820 $r25 = true;
4821 seq_9:
4822 if ($r25!==self::$FAILED) {
4823 $r25 = false;
4824 $this->currPos = $p13;
4825 } else {
4826 $this->currPos = $p10;
4827 $r23 = self::$FAILED;
4828 goto seq_8;
4829 }
4830 // free $p21
4831 // free $p13
4832 $r23 = true;
4833 seq_8:
4834 if ($r23===self::$FAILED) {
4835 $r23 = null;
4836 }
4837 // free $p10
4838 // a <- $r23
4839 $r23 = substr($this->input, $p8, $this->currPos - $p8);
4840 // free $p8
4841 $r29 = $this->parsetemplate($silence, $boolParams, $param_th);
4842 // b <- $r29
4843 if ($r29===self::$FAILED) {
4844 $this->currPos = $p6;
4845 $r1 = self::$FAILED;
4846 goto seq_7;
4847 }
4848 $r1 = true;
4849 seq_7:
4850 if ($r1!==self::$FAILED) {
4851 $this->savedPos = $p4;
4852 $r1 = $this->a51($r23, $r29);
4853 goto choice_1;
4854 }
4855 // free $p6
4856 $r1 = $this->parsebroken_template($silence, $param_preproc);
4857 choice_1:
4858 $this->cache[$bucket][$key] = new GrammarCacheEntry(
4859 $this->currPos,
4860 $r1,
4861 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
4862 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
4863 );
4864 return $r1;
4865 }
4866 private function parseraw_htmlentity($silence) {
4867 $key = 496;
4868 $bucket = $this->currPos;
4869 $cached = $this->cache[$bucket][$key] ?? null;
4870 if ($cached) {
4871 $this->currPos = $cached->nextPos;
4872
4873 return $cached->result;
4874 }
4875
4876 $p2 = $this->currPos;
4877 $p4 = $this->currPos;
4878 // start seq_1
4879 $p5 = $this->currPos;
4880 if (($this->input[$this->currPos] ?? null) === "&") {
4881 $this->currPos++;
4882 $r6 = "&";
4883 } else {
4884 if (!$silence) {$this->fail(4);}
4885 $r6 = self::$FAILED;
4886 $r3 = self::$FAILED;
4887 goto seq_1;
4888 }
4889 $r7 = self::$FAILED;
4890 for (;;) {
4891 $r8 = self::charAt($this->input, $this->currPos);
4892 if (preg_match("/^[#0-9a-zA-Z\\x{5e8}\\x{5dc}\\x{5de}\\x{631}\\x{644}\\x{645}]/u", $r8)) {
4893 $this->currPos += strlen($r8);
4894 $r7 = true;
4895 } else {
4896 $r8 = self::$FAILED;
4897 if (!$silence) {$this->fail(30);}
4898 break;
4899 }
4900 }
4901 if ($r7===self::$FAILED) {
4902 $this->currPos = $p5;
4903 $r3 = self::$FAILED;
4904 goto seq_1;
4905 }
4906 // free $r8
4907 if (($this->input[$this->currPos] ?? null) === ";") {
4908 $this->currPos++;
4909 $r8 = ";";
4910 } else {
4911 if (!$silence) {$this->fail(26);}
4912 $r8 = self::$FAILED;
4913 $this->currPos = $p5;
4914 $r3 = self::$FAILED;
4915 goto seq_1;
4916 }
4917 $r3 = true;
4918 seq_1:
4919 // m <- $r3
4920 if ($r3!==self::$FAILED) {
4921 $r3 = substr($this->input, $p4, $this->currPos - $p4);
4922 } else {
4923 $r3 = self::$FAILED;
4924 }
4925 // free $p5
4926 // free $p4
4927 $r1 = $r3;
4928 if ($r1!==self::$FAILED) {
4929 $this->savedPos = $p2;
4930 $r1 = $this->a52($r3);
4931 }
4932 $this->cache[$bucket][$key] = new GrammarCacheEntry(
4933 $this->currPos,
4934 $r1,
4935 self::$UNDEFINED,
4936 self::$UNDEFINED
4937 );
4938 return $r1;
4939 }
4940 private function parseoptionalSpaceToken($silence) {
4941 $key = 544;
4942 $bucket = $this->currPos;
4943 $cached = $this->cache[$bucket][$key] ?? null;
4944 if ($cached) {
4945 $this->currPos = $cached->nextPos;
4946
4947 return $cached->result;
4948 }
4949
4950 $p2 = $this->currPos;
4951 $r3 = $this->parseoptional_spaces($silence);
4952 // s <- $r3
4953 $r1 = $r3;
4954 if ($r1!==self::$FAILED) {
4955 $this->savedPos = $p2;
4956 $r1 = $this->a37($r3);
4957 }
4958 $this->cache[$bucket][$key] = new GrammarCacheEntry(
4959 $this->currPos,
4960 $r1,
4961 self::$UNDEFINED,
4962 self::$UNDEFINED
4963 );
4964 return $r1;
4965 }
4966 private function parsetable_attribute_name($silence, $boolParams, &$param_preproc, &$param_th) {
4967 $key = json_encode([440, $boolParams & 0x3fff, $param_preproc, $param_th]);
4968 $bucket = $this->currPos;
4969 $cached = $this->cache[$bucket][$key] ?? null;
4970 if ($cached) {
4971 $this->currPos = $cached->nextPos;
4972 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
4973 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
4974 return $cached->result;
4975 }
4976 $saved_preproc=$param_preproc;
4977 $saved_th=$param_th;
4978 $p2 = $this->currPos;
4979 // start seq_1
4980 $p3 = $this->currPos;
4981 $p5 = $this->currPos;
4982 if (strspn($this->input, "\"'=", $this->currPos, 1) !== 0) {
4983 $r4 = $this->input[$this->currPos++];
4984 } else {
4985 $r4 = self::$FAILED;
4986 if (!$silence) {$this->fail(31);}
4987 $r4 = null;
4988 }
4989 // q <- $r4
4990 $r4 = substr($this->input, $p5, $this->currPos - $p5);
4991 // free $p5
4992 $r6 = [];
4993 for (;;) {
4994 // start choice_1
4995 $p5 = $this->currPos;
4996 $r7 = self::$FAILED;
4997 for (;;) {
4998 if (strcspn($this->input, " \x09\x0d\x0a\x00/=><&{}-!|[", $this->currPos, 1) !== 0) {
4999 $r8 = self::consumeChar($this->input, $this->currPos);
5000 $r7 = true;
5001 } else {
5002 $r8 = self::$FAILED;
5003 if (!$silence) {$this->fail(32);}
5004 break;
5005 }
5006 }
5007 if ($r7!==self::$FAILED) {
5008 $r7 = substr($this->input, $p5, $this->currPos - $p5);
5009 goto choice_1;
5010 } else {
5011 $r7 = self::$FAILED;
5012 }
5013 // free $r8
5014 // free $p5
5015 $p5 = $this->currPos;
5016 // start seq_2
5017 $p9 = $this->currPos;
5018 $p10 = $this->currPos;
5019 $r8 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
5020 if ($r8 === self::$FAILED) {
5021 $r8 = false;
5022 } else {
5023 $r8 = self::$FAILED;
5024 $this->currPos = $p10;
5025 $r7 = self::$FAILED;
5026 goto seq_2;
5027 }
5028 // free $p10
5029 // start choice_2
5030 $p10 = $this->currPos;
5031 $r11 = $this->discardwikilink($silence, $boolParams, $param_th, $param_preproc);
5032 if ($r11!==self::$FAILED) {
5033 $r11 = substr($this->input, $p10, $this->currPos - $p10);
5034 goto choice_2;
5035 } else {
5036 $r11 = self::$FAILED;
5037 }
5038 // free $p10
5039 $r11 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th);
5040 if ($r11!==self::$FAILED) {
5041 goto choice_2;
5042 }
5043 $p10 = $this->currPos;
5044 // start seq_3
5045 $p12 = $this->currPos;
5046 $r13 = $this->parseinline_xmlish_tag($silence, $boolParams, $param_preproc, $param_th);
5047 // x <- $r13
5048 if ($r13===self::$FAILED) {
5049 $r11 = self::$FAILED;
5050 goto seq_3;
5051 }
5052 $r14 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th);
5053 if ($r14===self::$FAILED) {
5054 $r14 = null;
5055 }
5056 // ill <- $r14
5057 $r11 = true;
5058 seq_3:
5059 if ($r11!==self::$FAILED) {
5060 $this->savedPos = $p10;
5061 $r11 = $this->a53($r4, $r13, $r14);
5062 goto choice_2;
5063 }
5064 // free $p12
5065 $p12 = $this->currPos;
5066 // start seq_4
5067 $p15 = $this->currPos;
5068 $p16 = $this->currPos;
5069 // start choice_3
5070 $r17 = $this->discardspace_or_newline(true);
5071 if ($r17!==self::$FAILED) {
5072 goto choice_3;
5073 }
5074 if (strspn($this->input, "\x00/=>", $this->currPos, 1) !== 0) {
5075 $r17 = $this->input[$this->currPos++];
5076 } else {
5077 $r17 = self::$FAILED;
5078 }
5079 choice_3:
5080 if ($r17 === self::$FAILED) {
5081 $r17 = false;
5082 } else {
5083 $r17 = self::$FAILED;
5084 $this->currPos = $p16;
5085 $r11 = self::$FAILED;
5086 goto seq_4;
5087 }
5088 // free $p16
5089 if ($this->currPos < $this->inputLength) {
5090 $r18 = self::consumeChar($this->input, $this->currPos);;
5091 } else {
5092 $r18 = self::$FAILED;
5093 if (!$silence) {$this->fail(7);}
5094 $this->currPos = $p15;
5095 $r11 = self::$FAILED;
5096 goto seq_4;
5097 }
5098 $r11 = true;
5099 seq_4:
5100 if ($r11!==self::$FAILED) {
5101 $r11 = substr($this->input, $p12, $this->currPos - $p12);
5102 } else {
5103 $r11 = self::$FAILED;
5104 }
5105 // free $p15
5106 // free $p12
5107 choice_2:
5108 // t <- $r11
5109 if ($r11===self::$FAILED) {
5110 $this->currPos = $p9;
5111 $r7 = self::$FAILED;
5112 goto seq_2;
5113 }
5114 $r7 = true;
5115 seq_2:
5116 if ($r7!==self::$FAILED) {
5117 $this->savedPos = $p5;
5118 $r7 = $this->a54($r4, $r11);
5119 }
5120 // free $p9
5121 choice_1:
5122 if ($r7!==self::$FAILED) {
5123 $r6[] = $r7;
5124 } else {
5125 break;
5126 }
5127 }
5128 // r <- $r6
5129 // free $r7
5130 $this->savedPos = $this->currPos;
5131 $r7 = $this->a55($r4, $r6);
5132 if ($r7) {
5133 $r7 = false;
5134 } else {
5135 $r7 = self::$FAILED;
5136 $this->currPos = $p3;
5137 $r1 = self::$FAILED;
5138 goto seq_1;
5139 }
5140 $r1 = true;
5141 seq_1:
5142 if ($r1!==self::$FAILED) {
5143 $this->savedPos = $p2;
5144 $r1 = $this->a56($r4, $r6);
5145 }
5146 // free $p3
5147 $this->cache[$bucket][$key] = new GrammarCacheEntry(
5148 $this->currPos,
5149 $r1,
5150 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
5151 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
5152 );
5153 return $r1;
5154 }
5155 private function parsetable_att_value($silence, $boolParams, &$param_preproc, &$param_th) {
5156 $key = json_encode([444, $boolParams & 0x3fff, $param_preproc, $param_th]);
5157 $bucket = $this->currPos;
5158 $cached = $this->cache[$bucket][$key] ?? null;
5159 if ($cached) {
5160 $this->currPos = $cached->nextPos;
5161 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
5162 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
5163 return $cached->result;
5164 }
5165 $saved_preproc=$param_preproc;
5166 $saved_th=$param_th;
5167 // start choice_1
5168 $p2 = $this->currPos;
5169 // start seq_1
5170 $p3 = $this->currPos;
5171 $p5 = $this->currPos;
5172 // start seq_2
5173 $p6 = $this->currPos;
5174 for (;;) {
5175 $r8 = $this->discardspace($silence);
5176 if ($r8===self::$FAILED) {
5177 break;
5178 }
5179 }
5180 // free $r8
5181 $r7 = true;
5182 if ($r7===self::$FAILED) {
5183 $r4 = self::$FAILED;
5184 goto seq_2;
5185 }
5186 // free $r7
5187 if (($this->input[$this->currPos] ?? null) === "'") {
5188 $this->currPos++;
5189 $r7 = "'";
5190 } else {
5191 if (!$silence) {$this->fail(33);}
5192 $r7 = self::$FAILED;
5193 $this->currPos = $p6;
5194 $r4 = self::$FAILED;
5195 goto seq_2;
5196 }
5197 $r4 = true;
5198 seq_2:
5199 // s <- $r4
5200 if ($r4!==self::$FAILED) {
5201 $r4 = substr($this->input, $p5, $this->currPos - $p5);
5202 } else {
5203 $r4 = self::$FAILED;
5204 $r1 = self::$FAILED;
5205 goto seq_1;
5206 }
5207 // free $p6
5208 // free $p5
5209 $r8 = $this->parsetable_attribute_preprocessor_text_single($silence, $boolParams, $param_preproc, $param_th);
5210 if ($r8===self::$FAILED) {
5211 $r8 = null;
5212 }
5213 // t <- $r8
5214 $p5 = $this->currPos;
5215 // start choice_2
5216 if (($this->input[$this->currPos] ?? null) === "'") {
5217 $this->currPos++;
5218 $r9 = "'";
5219 goto choice_2;
5220 } else {
5221 if (!$silence) {$this->fail(33);}
5222 $r9 = self::$FAILED;
5223 }
5224 $p6 = $this->currPos;
5225 // start choice_3
5226 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) {
5227 $r9 = "!!";
5228 $this->currPos += 2;
5229 goto choice_3;
5230 } else {
5231 $r9 = self::$FAILED;
5232 }
5233 if (strspn($this->input, "|\x0d\x0a", $this->currPos, 1) !== 0) {
5234 $r9 = $this->input[$this->currPos++];
5235 } else {
5236 $r9 = self::$FAILED;
5237 }
5238 choice_3:
5239 if ($r9!==self::$FAILED) {
5240 $r9 = false;
5241 $this->currPos = $p6;
5242 }
5243 // free $p6
5244 choice_2:
5245 // q <- $r9
5246 if ($r9!==self::$FAILED) {
5247 $r9 = substr($this->input, $p5, $this->currPos - $p5);
5248 } else {
5249 $r9 = self::$FAILED;
5250 $this->currPos = $p3;
5251 $r1 = self::$FAILED;
5252 goto seq_1;
5253 }
5254 // free $p5
5255 $r1 = true;
5256 seq_1:
5257 if ($r1!==self::$FAILED) {
5258 $this->savedPos = $p2;
5259 $r1 = $this->a57($r4, $r8, $r9);
5260 goto choice_1;
5261 }
5262 // free $p3
5263 $p3 = $this->currPos;
5264 // start seq_3
5265 $p5 = $this->currPos;
5266 $p6 = $this->currPos;
5267 // start seq_4
5268 $p11 = $this->currPos;
5269 for (;;) {
5270 $r13 = $this->discardspace($silence);
5271 if ($r13===self::$FAILED) {
5272 break;
5273 }
5274 }
5275 // free $r13
5276 $r12 = true;
5277 if ($r12===self::$FAILED) {
5278 $r10 = self::$FAILED;
5279 goto seq_4;
5280 }
5281 // free $r12
5282 if (($this->input[$this->currPos] ?? null) === "\"") {
5283 $this->currPos++;
5284 $r12 = "\"";
5285 } else {
5286 if (!$silence) {$this->fail(34);}
5287 $r12 = self::$FAILED;
5288 $this->currPos = $p11;
5289 $r10 = self::$FAILED;
5290 goto seq_4;
5291 }
5292 $r10 = true;
5293 seq_4:
5294 // s <- $r10
5295 if ($r10!==self::$FAILED) {
5296 $r10 = substr($this->input, $p6, $this->currPos - $p6);
5297 } else {
5298 $r10 = self::$FAILED;
5299 $r1 = self::$FAILED;
5300 goto seq_3;
5301 }
5302 // free $p11
5303 // free $p6
5304 $r13 = $this->parsetable_attribute_preprocessor_text_double($silence, $boolParams, $param_preproc, $param_th);
5305 if ($r13===self::$FAILED) {
5306 $r13 = null;
5307 }
5308 // t <- $r13
5309 $p6 = $this->currPos;
5310 // start choice_4
5311 if (($this->input[$this->currPos] ?? null) === "\"") {
5312 $this->currPos++;
5313 $r14 = "\"";
5314 goto choice_4;
5315 } else {
5316 if (!$silence) {$this->fail(34);}
5317 $r14 = self::$FAILED;
5318 }
5319 $p11 = $this->currPos;
5320 // start choice_5
5321 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) {
5322 $r14 = "!!";
5323 $this->currPos += 2;
5324 goto choice_5;
5325 } else {
5326 $r14 = self::$FAILED;
5327 }
5328 if (strspn($this->input, "|\x0d\x0a", $this->currPos, 1) !== 0) {
5329 $r14 = $this->input[$this->currPos++];
5330 } else {
5331 $r14 = self::$FAILED;
5332 }
5333 choice_5:
5334 if ($r14!==self::$FAILED) {
5335 $r14 = false;
5336 $this->currPos = $p11;
5337 }
5338 // free $p11
5339 choice_4:
5340 // q <- $r14
5341 if ($r14!==self::$FAILED) {
5342 $r14 = substr($this->input, $p6, $this->currPos - $p6);
5343 } else {
5344 $r14 = self::$FAILED;
5345 $this->currPos = $p5;
5346 $r1 = self::$FAILED;
5347 goto seq_3;
5348 }
5349 // free $p6
5350 $r1 = true;
5351 seq_3:
5352 if ($r1!==self::$FAILED) {
5353 $this->savedPos = $p3;
5354 $r1 = $this->a57($r10, $r13, $r14);
5355 goto choice_1;
5356 }
5357 // free $p5
5358 $p5 = $this->currPos;
5359 // start seq_5
5360 $p6 = $this->currPos;
5361 $p11 = $this->currPos;
5362 for (;;) {
5363 $r16 = $this->discardspace($silence);
5364 if ($r16===self::$FAILED) {
5365 break;
5366 }
5367 }
5368 // free $r16
5369 $r15 = true;
5370 // s <- $r15
5371 if ($r15!==self::$FAILED) {
5372 $r15 = substr($this->input, $p11, $this->currPos - $p11);
5373 } else {
5374 $r15 = self::$FAILED;
5375 $r1 = self::$FAILED;
5376 goto seq_5;
5377 }
5378 // free $p11
5379 $r16 = $this->parsetable_attribute_preprocessor_text($silence, $boolParams, $param_preproc, $param_th);
5380 // t <- $r16
5381 if ($r16===self::$FAILED) {
5382 $this->currPos = $p6;
5383 $r1 = self::$FAILED;
5384 goto seq_5;
5385 }
5386 $p11 = $this->currPos;
5387 // start choice_6
5388 $r17 = $this->discardspace_or_newline(true);
5389 if ($r17!==self::$FAILED) {
5390 goto choice_6;
5391 }
5392 $r17 = $this->discardeof(true);
5393 if ($r17!==self::$FAILED) {
5394 goto choice_6;
5395 }
5396 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) {
5397 $r17 = "!!";
5398 $this->currPos += 2;
5399 goto choice_6;
5400 } else {
5401 $r17 = self::$FAILED;
5402 }
5403 if (($this->input[$this->currPos] ?? null) === "|") {
5404 $this->currPos++;
5405 $r17 = "|";
5406 } else {
5407 $r17 = self::$FAILED;
5408 }
5409 choice_6:
5410 if ($r17!==self::$FAILED) {
5411 $r17 = false;
5412 $this->currPos = $p11;
5413 } else {
5414 $this->currPos = $p6;
5415 $r1 = self::$FAILED;
5416 goto seq_5;
5417 }
5418 // free $p11
5419 $r1 = true;
5420 seq_5:
5421 if ($r1!==self::$FAILED) {
5422 $this->savedPos = $p5;
5423 $r1 = $this->a58($r15, $r16);
5424 }
5425 // free $p6
5426 choice_1:
5427 $this->cache[$bucket][$key] = new GrammarCacheEntry(
5428 $this->currPos,
5429 $r1,
5430 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
5431 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
5432 );
5433 return $r1;
5434 }
5435 private function discardspace_or_newline_or_solidus($silence) {
5436 $key = 427;
5437 $bucket = $this->currPos;
5438 $cached = $this->cache[$bucket][$key] ?? null;
5439 if ($cached) {
5440 $this->currPos = $cached->nextPos;
5441
5442 return $cached->result;
5443 }
5444
5445 // start choice_1
5446 $r1 = $this->discardspace_or_newline($silence);
5447 if ($r1!==self::$FAILED) {
5448 goto choice_1;
5449 }
5450 $p2 = $this->currPos;
5451 // start seq_1
5452 $p3 = $this->currPos;
5453 // s <- $r4
5454 if (($this->input[$this->currPos] ?? null) === "/") {
5455 $this->currPos++;
5456 $r4 = "/";
5457 } else {
5458 if (!$silence) {$this->fail(35);}
5459 $r4 = self::$FAILED;
5460 $r1 = self::$FAILED;
5461 goto seq_1;
5462 }
5463 $p5 = $this->currPos;
5464 if (($this->input[$this->currPos] ?? null) === ">") {
5465 $this->currPos++;
5466 $r6 = ">";
5467 } else {
5468 $r6 = self::$FAILED;
5469 }
5470 if ($r6 === self::$FAILED) {
5471 $r6 = false;
5472 } else {
5473 $r6 = self::$FAILED;
5474 $this->currPos = $p5;
5475 $this->currPos = $p3;
5476 $r1 = self::$FAILED;
5477 goto seq_1;
5478 }
5479 // free $p5
5480 $r1 = true;
5481 seq_1:
5482 if ($r1!==self::$FAILED) {
5483 $this->savedPos = $p2;
5484 $r1 = $this->a42($r4);
5485 }
5486 // free $p3
5487 choice_1:
5488 $this->cache[$bucket][$key] = new GrammarCacheEntry(
5489 $this->currPos,
5490 $r1,
5491 self::$UNDEFINED,
5492 self::$UNDEFINED
5493 );
5494 return $r1;
5495 }
5496 private function parsegeneric_attribute_name($silence, $boolParams, &$param_preproc, &$param_th) {
5497 $key = json_encode([436, $boolParams & 0x3fff, $param_preproc, $param_th]);
5498 $bucket = $this->currPos;
5499 $cached = $this->cache[$bucket][$key] ?? null;
5500 if ($cached) {
5501 $this->currPos = $cached->nextPos;
5502 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
5503 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
5504 return $cached->result;
5505 }
5506 $saved_preproc=$param_preproc;
5507 $saved_th=$param_th;
5508 $p2 = $this->currPos;
5509 // start seq_1
5510 $p3 = $this->currPos;
5511 $p5 = $this->currPos;
5512 if (strspn($this->input, "\"'=", $this->currPos, 1) !== 0) {
5513 $r4 = $this->input[$this->currPos++];
5514 } else {
5515 $r4 = self::$FAILED;
5516 if (!$silence) {$this->fail(31);}
5517 $r4 = null;
5518 }
5519 // q <- $r4
5520 $r4 = substr($this->input, $p5, $this->currPos - $p5);
5521 // free $p5
5522 $r6 = [];
5523 for (;;) {
5524 // start choice_1
5525 $p5 = $this->currPos;
5526 $r7 = self::$FAILED;
5527 for (;;) {
5528 if (strcspn($this->input, " \x09\x0d\x0a\x00/=><&{}-!|", $this->currPos, 1) !== 0) {
5529 $r8 = self::consumeChar($this->input, $this->currPos);
5530 $r7 = true;
5531 } else {
5532 $r8 = self::$FAILED;
5533 if (!$silence) {$this->fail(36);}
5534 break;
5535 }
5536 }
5537 if ($r7!==self::$FAILED) {
5538 $r7 = substr($this->input, $p5, $this->currPos - $p5);
5539 goto choice_1;
5540 } else {
5541 $r7 = self::$FAILED;
5542 }
5543 // free $r8
5544 // free $p5
5545 $p5 = $this->currPos;
5546 // start seq_2
5547 $p9 = $this->currPos;
5548 $p10 = $this->currPos;
5549 $r8 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
5550 if ($r8 === self::$FAILED) {
5551 $r8 = false;
5552 } else {
5553 $r8 = self::$FAILED;
5554 $this->currPos = $p10;
5555 $r7 = self::$FAILED;
5556 goto seq_2;
5557 }
5558 // free $p10
5559 // start choice_2
5560 $r11 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th);
5561 if ($r11!==self::$FAILED) {
5562 goto choice_2;
5563 }
5564 $r11 = $this->parseless_than($silence, $boolParams);
5565 if ($r11!==self::$FAILED) {
5566 goto choice_2;
5567 }
5568 $p10 = $this->currPos;
5569 // start seq_3
5570 $p12 = $this->currPos;
5571 $p13 = $this->currPos;
5572 // start choice_3
5573 $r14 = $this->discardspace_or_newline(true);
5574 if ($r14!==self::$FAILED) {
5575 goto choice_3;
5576 }
5577 if (strspn($this->input, "\x00/=><", $this->currPos, 1) !== 0) {
5578 $r14 = $this->input[$this->currPos++];
5579 } else {
5580 $r14 = self::$FAILED;
5581 }
5582 choice_3:
5583 if ($r14 === self::$FAILED) {
5584 $r14 = false;
5585 } else {
5586 $r14 = self::$FAILED;
5587 $this->currPos = $p13;
5588 $r11 = self::$FAILED;
5589 goto seq_3;
5590 }
5591 // free $p13
5592 if ($this->currPos < $this->inputLength) {
5593 $r15 = self::consumeChar($this->input, $this->currPos);;
5594 } else {
5595 $r15 = self::$FAILED;
5596 if (!$silence) {$this->fail(7);}
5597 $this->currPos = $p12;
5598 $r11 = self::$FAILED;
5599 goto seq_3;
5600 }
5601 $r11 = true;
5602 seq_3:
5603 if ($r11!==self::$FAILED) {
5604 $r11 = substr($this->input, $p10, $this->currPos - $p10);
5605 } else {
5606 $r11 = self::$FAILED;
5607 }
5608 // free $p12
5609 // free $p10
5610 choice_2:
5611 // t <- $r11
5612 if ($r11===self::$FAILED) {
5613 $this->currPos = $p9;
5614 $r7 = self::$FAILED;
5615 goto seq_2;
5616 }
5617 $r7 = true;
5618 seq_2:
5619 if ($r7!==self::$FAILED) {
5620 $this->savedPos = $p5;
5621 $r7 = $this->a54($r4, $r11);
5622 }
5623 // free $p9
5624 choice_1:
5625 if ($r7!==self::$FAILED) {
5626 $r6[] = $r7;
5627 } else {
5628 break;
5629 }
5630 }
5631 // r <- $r6
5632 // free $r7
5633 $this->savedPos = $this->currPos;
5634 $r7 = $this->a55($r4, $r6);
5635 if ($r7) {
5636 $r7 = false;
5637 } else {
5638 $r7 = self::$FAILED;
5639 $this->currPos = $p3;
5640 $r1 = self::$FAILED;
5641 goto seq_1;
5642 }
5643 $r1 = true;
5644 seq_1:
5645 if ($r1!==self::$FAILED) {
5646 $this->savedPos = $p2;
5647 $r1 = $this->a56($r4, $r6);
5648 }
5649 // free $p3
5650 $this->cache[$bucket][$key] = new GrammarCacheEntry(
5651 $this->currPos,
5652 $r1,
5653 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
5654 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
5655 );
5656 return $r1;
5657 }
5658 private function discardspace_or_newline($silence) {
5659 $key = 547;
5660 $bucket = $this->currPos;
5661 $cached = $this->cache[$bucket][$key] ?? null;
5662 if ($cached) {
5663 $this->currPos = $cached->nextPos;
5664
5665 return $cached->result;
5666 }
5667
5668 if (strspn($this->input, " \x09\x0a\x0d\x0c", $this->currPos, 1) !== 0) {
5669 $r1 = $this->input[$this->currPos++];
5670 } else {
5671 $r1 = self::$FAILED;
5672 if (!$silence) {$this->fail(37);}
5673 }
5674 $this->cache[$bucket][$key] = new GrammarCacheEntry(
5675 $this->currPos,
5676 $r1,
5677 self::$UNDEFINED,
5678 self::$UNDEFINED
5679 );
5680 return $r1;
5681 }
5682 private function parsegeneric_att_value($silence, $boolParams, &$param_preproc, &$param_th) {
5683 $key = json_encode([442, $boolParams & 0x3fff, $param_preproc, $param_th]);
5684 $bucket = $this->currPos;
5685 $cached = $this->cache[$bucket][$key] ?? null;
5686 if ($cached) {
5687 $this->currPos = $cached->nextPos;
5688 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
5689 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
5690 return $cached->result;
5691 }
5692 $saved_preproc=$param_preproc;
5693 $saved_th=$param_th;
5694 // start choice_1
5695 $p2 = $this->currPos;
5696 // start seq_1
5697 $p3 = $this->currPos;
5698 $p5 = $this->currPos;
5699 // start seq_2
5700 $p6 = $this->currPos;
5701 for (;;) {
5702 $r8 = $this->discardspace_or_newline($silence);
5703 if ($r8===self::$FAILED) {
5704 break;
5705 }
5706 }
5707 // free $r8
5708 $r7 = true;
5709 if ($r7===self::$FAILED) {
5710 $r4 = self::$FAILED;
5711 goto seq_2;
5712 }
5713 // free $r7
5714 if (($this->input[$this->currPos] ?? null) === "'") {
5715 $this->currPos++;
5716 $r7 = "'";
5717 } else {
5718 if (!$silence) {$this->fail(33);}
5719 $r7 = self::$FAILED;
5720 $this->currPos = $p6;
5721 $r4 = self::$FAILED;
5722 goto seq_2;
5723 }
5724 $r4 = true;
5725 seq_2:
5726 // s <- $r4
5727 if ($r4!==self::$FAILED) {
5728 $r4 = substr($this->input, $p5, $this->currPos - $p5);
5729 } else {
5730 $r4 = self::$FAILED;
5731 $r1 = self::$FAILED;
5732 goto seq_1;
5733 }
5734 // free $p6
5735 // free $p5
5736 $r8 = $this->parseattribute_preprocessor_text_single($silence, $boolParams, $param_preproc, $param_th);
5737 if ($r8===self::$FAILED) {
5738 $r8 = null;
5739 }
5740 // t <- $r8
5741 $p5 = $this->currPos;
5742 // start choice_2
5743 if (($this->input[$this->currPos] ?? null) === "'") {
5744 $this->currPos++;
5745 $r9 = "'";
5746 goto choice_2;
5747 } else {
5748 if (!$silence) {$this->fail(33);}
5749 $r9 = self::$FAILED;
5750 }
5751 $p6 = $this->currPos;
5752 // start seq_3
5753 $p10 = $this->currPos;
5754 if (($this->input[$this->currPos] ?? null) === "/") {
5755 $this->currPos++;
5756 $r11 = "/";
5757 } else {
5758 $r11 = self::$FAILED;
5759 $r11 = null;
5760 }
5761 if (($this->input[$this->currPos] ?? null) === ">") {
5762 $this->currPos++;
5763 $r12 = ">";
5764 } else {
5765 $r12 = self::$FAILED;
5766 $this->currPos = $p10;
5767 $r9 = self::$FAILED;
5768 goto seq_3;
5769 }
5770 $r9 = true;
5771 seq_3:
5772 if ($r9!==self::$FAILED) {
5773 $r9 = false;
5774 $this->currPos = $p6;
5775 }
5776 // free $p10
5777 // free $p6
5778 choice_2:
5779 // q <- $r9
5780 if ($r9!==self::$FAILED) {
5781 $r9 = substr($this->input, $p5, $this->currPos - $p5);
5782 } else {
5783 $r9 = self::$FAILED;
5784 $this->currPos = $p3;
5785 $r1 = self::$FAILED;
5786 goto seq_1;
5787 }
5788 // free $p5
5789 $r1 = true;
5790 seq_1:
5791 if ($r1!==self::$FAILED) {
5792 $this->savedPos = $p2;
5793 $r1 = $this->a57($r4, $r8, $r9);
5794 goto choice_1;
5795 }
5796 // free $p3
5797 $p3 = $this->currPos;
5798 // start seq_4
5799 $p5 = $this->currPos;
5800 $p6 = $this->currPos;
5801 // start seq_5
5802 $p10 = $this->currPos;
5803 for (;;) {
5804 $r15 = $this->discardspace_or_newline($silence);
5805 if ($r15===self::$FAILED) {
5806 break;
5807 }
5808 }
5809 // free $r15
5810 $r14 = true;
5811 if ($r14===self::$FAILED) {
5812 $r13 = self::$FAILED;
5813 goto seq_5;
5814 }
5815 // free $r14
5816 if (($this->input[$this->currPos] ?? null) === "\"") {
5817 $this->currPos++;
5818 $r14 = "\"";
5819 } else {
5820 if (!$silence) {$this->fail(34);}
5821 $r14 = self::$FAILED;
5822 $this->currPos = $p10;
5823 $r13 = self::$FAILED;
5824 goto seq_5;
5825 }
5826 $r13 = true;
5827 seq_5:
5828 // s <- $r13
5829 if ($r13!==self::$FAILED) {
5830 $r13 = substr($this->input, $p6, $this->currPos - $p6);
5831 } else {
5832 $r13 = self::$FAILED;
5833 $r1 = self::$FAILED;
5834 goto seq_4;
5835 }
5836 // free $p10
5837 // free $p6
5838 $r15 = $this->parseattribute_preprocessor_text_double($silence, $boolParams, $param_preproc, $param_th);
5839 if ($r15===self::$FAILED) {
5840 $r15 = null;
5841 }
5842 // t <- $r15
5843 $p6 = $this->currPos;
5844 // start choice_3
5845 if (($this->input[$this->currPos] ?? null) === "\"") {
5846 $this->currPos++;
5847 $r16 = "\"";
5848 goto choice_3;
5849 } else {
5850 if (!$silence) {$this->fail(34);}
5851 $r16 = self::$FAILED;
5852 }
5853 $p10 = $this->currPos;
5854 // start seq_6
5855 $p17 = $this->currPos;
5856 if (($this->input[$this->currPos] ?? null) === "/") {
5857 $this->currPos++;
5858 $r18 = "/";
5859 } else {
5860 $r18 = self::$FAILED;
5861 $r18 = null;
5862 }
5863 if (($this->input[$this->currPos] ?? null) === ">") {
5864 $this->currPos++;
5865 $r19 = ">";
5866 } else {
5867 $r19 = self::$FAILED;
5868 $this->currPos = $p17;
5869 $r16 = self::$FAILED;
5870 goto seq_6;
5871 }
5872 $r16 = true;
5873 seq_6:
5874 if ($r16!==self::$FAILED) {
5875 $r16 = false;
5876 $this->currPos = $p10;
5877 }
5878 // free $p17
5879 // free $p10
5880 choice_3:
5881 // q <- $r16
5882 if ($r16!==self::$FAILED) {
5883 $r16 = substr($this->input, $p6, $this->currPos - $p6);
5884 } else {
5885 $r16 = self::$FAILED;
5886 $this->currPos = $p5;
5887 $r1 = self::$FAILED;
5888 goto seq_4;
5889 }
5890 // free $p6
5891 $r1 = true;
5892 seq_4:
5893 if ($r1!==self::$FAILED) {
5894 $this->savedPos = $p3;
5895 $r1 = $this->a57($r13, $r15, $r16);
5896 goto choice_1;
5897 }
5898 // free $p5
5899 $p5 = $this->currPos;
5900 // start seq_7
5901 $p6 = $this->currPos;
5902 $p10 = $this->currPos;
5903 for (;;) {
5904 $r21 = $this->discardspace_or_newline($silence);
5905 if ($r21===self::$FAILED) {
5906 break;
5907 }
5908 }
5909 // free $r21
5910 $r20 = true;
5911 // s <- $r20
5912 if ($r20!==self::$FAILED) {
5913 $r20 = substr($this->input, $p10, $this->currPos - $p10);
5914 } else {
5915 $r20 = self::$FAILED;
5916 $r1 = self::$FAILED;
5917 goto seq_7;
5918 }
5919 // free $p10
5920 $r21 = $this->parseattribute_preprocessor_text($silence, $boolParams, $param_preproc, $param_th);
5921 // t <- $r21
5922 if ($r21===self::$FAILED) {
5923 $this->currPos = $p6;
5924 $r1 = self::$FAILED;
5925 goto seq_7;
5926 }
5927 $p10 = $this->currPos;
5928 // start choice_4
5929 $r22 = $this->discardspace_or_newline(true);
5930 if ($r22!==self::$FAILED) {
5931 goto choice_4;
5932 }
5933 $r22 = $this->discardeof(true);
5934 if ($r22!==self::$FAILED) {
5935 goto choice_4;
5936 }
5937 // start seq_8
5938 $p17 = $this->currPos;
5939 if (($this->input[$this->currPos] ?? null) === "/") {
5940 $this->currPos++;
5941 $r23 = "/";
5942 } else {
5943 $r23 = self::$FAILED;
5944 $r23 = null;
5945 }
5946 if (($this->input[$this->currPos] ?? null) === ">") {
5947 $this->currPos++;
5948 $r24 = ">";
5949 } else {
5950 $r24 = self::$FAILED;
5951 $this->currPos = $p17;
5952 $r22 = self::$FAILED;
5953 goto seq_8;
5954 }
5955 $r22 = true;
5956 seq_8:
5957 // free $p17
5958 choice_4:
5959 if ($r22!==self::$FAILED) {
5960 $r22 = false;
5961 $this->currPos = $p10;
5962 } else {
5963 $this->currPos = $p6;
5964 $r1 = self::$FAILED;
5965 goto seq_7;
5966 }
5967 // free $p10
5968 $r1 = true;
5969 seq_7:
5970 if ($r1!==self::$FAILED) {
5971 $this->savedPos = $p5;
5972 $r1 = $this->a58($r20, $r21);
5973 }
5974 // free $p6
5975 choice_1:
5976 $this->cache[$bucket][$key] = new GrammarCacheEntry(
5977 $this->currPos,
5978 $r1,
5979 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
5980 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
5981 );
5982 return $r1;
5983 }
5984 private function parseextlink_nonipv6url_parameterized($silence, $boolParams, &$param_preproc, &$param_th) {
5985 $key = json_encode([508, $boolParams & 0x3fff, $param_preproc, $param_th]);
5986 $bucket = $this->currPos;
5987 $cached = $this->cache[$bucket][$key] ?? null;
5988 if ($cached) {
5989 $this->currPos = $cached->nextPos;
5990 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
5991 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
5992 return $cached->result;
5993 }
5994 $saved_preproc=$param_preproc;
5995 $saved_th=$param_th;
5996 $p2 = $this->currPos;
5997 $r3 = [];
5998 for (;;) {
5999 // start choice_1
6000 $p5 = $this->currPos;
6001 $r4 = self::$FAILED;
6002 for (;;) {
6003 $r6 = self::charAt($this->input, $this->currPos);
6004 if (preg_match("/^[^<\\[{\\x0a\\x0d|!\\]}\\-\\x09&=\"' \\x{a0}\\x{1680}\\x{180e}\\x{2000}-\\x{200a}\\x{202f}\\x{205f}\\x{3000}]/u", $r6)) {
6005 $this->currPos += strlen($r6);
6006 $r4 = true;
6007 } else {
6008 $r6 = self::$FAILED;
6009 if (!$silence) {$this->fail(38);}
6010 break;
6011 }
6012 }
6013 if ($r4!==self::$FAILED) {
6014 $r4 = substr($this->input, $p5, $this->currPos - $p5);
6015 goto choice_1;
6016 } else {
6017 $r4 = self::$FAILED;
6018 }
6019 // free $r6
6020 // free $p5
6021 $p5 = $this->currPos;
6022 // start seq_1
6023 $p7 = $this->currPos;
6024 $p8 = $this->currPos;
6025 $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
6026 if ($r6 === self::$FAILED) {
6027 $r6 = false;
6028 } else {
6029 $r6 = self::$FAILED;
6030 $this->currPos = $p8;
6031 $r4 = self::$FAILED;
6032 goto seq_1;
6033 }
6034 // free $p8
6035 // start choice_2
6036 $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th);
6037 if ($r9!==self::$FAILED) {
6038 goto choice_2;
6039 }
6040 if (strspn($this->input, "&|{-!}=", $this->currPos, 1) !== 0) {
6041 $r9 = $this->input[$this->currPos++];
6042 } else {
6043 $r9 = self::$FAILED;
6044 if (!$silence) {$this->fail(39);}
6045 }
6046 choice_2:
6047 // s <- $r9
6048 if ($r9===self::$FAILED) {
6049 $this->currPos = $p7;
6050 $r4 = self::$FAILED;
6051 goto seq_1;
6052 }
6053 $r4 = true;
6054 seq_1:
6055 if ($r4!==self::$FAILED) {
6056 $this->savedPos = $p5;
6057 $r4 = $this->a42($r9);
6058 goto choice_1;
6059 }
6060 // free $p7
6061 $p7 = $this->currPos;
6062 // start seq_2
6063 $p8 = $this->currPos;
6064 $r10 = $this->input[$this->currPos] ?? '';
6065 if ($r10 === "'") {
6066 $this->currPos++;
6067 } else {
6068 $r10 = self::$FAILED;
6069 if (!$silence) {$this->fail(40);}
6070 $r4 = self::$FAILED;
6071 goto seq_2;
6072 }
6073 $p11 = $this->currPos;
6074 $r12 = $this->input[$this->currPos] ?? '';
6075 if ($r12 === "'") {
6076 $this->currPos++;
6077 } else {
6078 $r12 = self::$FAILED;
6079 }
6080 if ($r12 === self::$FAILED) {
6081 $r12 = false;
6082 } else {
6083 $r12 = self::$FAILED;
6084 $this->currPos = $p11;
6085 $this->currPos = $p8;
6086 $r4 = self::$FAILED;
6087 goto seq_2;
6088 }
6089 // free $p11
6090 $r4 = true;
6091 seq_2:
6092 if ($r4!==self::$FAILED) {
6093 $r4 = substr($this->input, $p7, $this->currPos - $p7);
6094 } else {
6095 $r4 = self::$FAILED;
6096 }
6097 // free $p8
6098 // free $p7
6099 choice_1:
6100 if ($r4!==self::$FAILED) {
6101 $r3[] = $r4;
6102 } else {
6103 break;
6104 }
6105 }
6106 if (count($r3) === 0) {
6107 $r3 = self::$FAILED;
6108 }
6109 // r <- $r3
6110 // free $r4
6111 $r1 = $r3;
6112 if ($r1!==self::$FAILED) {
6113 $this->savedPos = $p2;
6114 $r1 = $this->a59($r3);
6115 }
6116 $this->cache[$bucket][$key] = new GrammarCacheEntry(
6117 $this->currPos,
6118 $r1,
6119 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
6120 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
6121 );
6122 return $r1;
6123 }
6124 private function parseurltext($silence, $boolParams, &$param_preproc, &$param_th) {
6125 $key = json_encode([494, $boolParams & 0x3fff, $param_preproc, $param_th]);
6126 $bucket = $this->currPos;
6127 $cached = $this->cache[$bucket][$key] ?? null;
6128 if ($cached) {
6129 $this->currPos = $cached->nextPos;
6130 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
6131 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
6132 return $cached->result;
6133 }
6134 $saved_preproc=$param_preproc;
6135 $saved_th=$param_th;
6136 $r1 = [];
6137 for (;;) {
6138 // start choice_1
6139 $p3 = $this->currPos;
6140 // start seq_1
6141 $p4 = $this->currPos;
6142 $this->savedPos = $this->currPos;
6143 $r5 = $this->a60();
6144 if ($r5) {
6145 $r5 = false;
6146 } else {
6147 $r5 = self::$FAILED;
6148 $r2 = self::$FAILED;
6149 goto seq_1;
6150 }
6151 $r2 = true;
6152 seq_1:
6153 if ($r2!==self::$FAILED) {
6154 $this->savedPos = $p3;
6155 $r2 = $this->a61();
6156 goto choice_1;
6157 }
6158 // free $p4
6159 $p4 = $this->currPos;
6160 // start seq_2
6161 $p6 = $this->currPos;
6162 $this->savedPos = $this->currPos;
6163 $r7 = $this->a62();
6164 if ($r7) {
6165 $r7 = false;
6166 } else {
6167 $r7 = self::$FAILED;
6168 $r2 = self::$FAILED;
6169 goto seq_2;
6170 }
6171 $r8 = $this->parseautolink($silence, $boolParams, $param_preproc, $param_th);
6172 // al <- $r8
6173 if ($r8===self::$FAILED) {
6174 $this->currPos = $p6;
6175 $r2 = self::$FAILED;
6176 goto seq_2;
6177 }
6178 $r2 = true;
6179 seq_2:
6180 if ($r2!==self::$FAILED) {
6181 $this->savedPos = $p4;
6182 $r2 = $this->a63($r8);
6183 goto choice_1;
6184 }
6185 // free $p6
6186 $p6 = $this->currPos;
6187 // start seq_3
6188 $p9 = $this->currPos;
6189 $p10 = $this->currPos;
6190 if (($this->input[$this->currPos] ?? null) === "&") {
6191 $this->currPos++;
6192 $r11 = "&";
6193 $r11 = false;
6194 $this->currPos = $p10;
6195 } else {
6196 $r11 = self::$FAILED;
6197 $r2 = self::$FAILED;
6198 goto seq_3;
6199 }
6200 // free $p10
6201 $r12 = $this->parsehtmlentity($silence);
6202 // he <- $r12
6203 if ($r12===self::$FAILED) {
6204 $this->currPos = $p9;
6205 $r2 = self::$FAILED;
6206 goto seq_3;
6207 }
6208 $r2 = true;
6209 seq_3:
6210 if ($r2!==self::$FAILED) {
6211 $this->savedPos = $p6;
6212 $r2 = $this->a64($r12);
6213 goto choice_1;
6214 }
6215 // free $p9
6216 $p9 = $this->currPos;
6217 // start seq_4
6218 $p10 = $this->currPos;
6219 $p13 = $this->currPos;
6220 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) {
6221 $r14 = "__";
6222 $this->currPos += 2;
6223 $r14 = false;
6224 $this->currPos = $p13;
6225 } else {
6226 $r14 = self::$FAILED;
6227 $r2 = self::$FAILED;
6228 goto seq_4;
6229 }
6230 // free $p13
6231 $r15 = $this->parsebehavior_switch($silence);
6232 // bs <- $r15
6233 if ($r15===self::$FAILED) {
6234 $this->currPos = $p10;
6235 $r2 = self::$FAILED;
6236 goto seq_4;
6237 }
6238 $r2 = true;
6239 seq_4:
6240 if ($r2!==self::$FAILED) {
6241 $this->savedPos = $p9;
6242 $r2 = $this->a65($r15);
6243 goto choice_1;
6244 }
6245 // free $p10
6246 $r2 = $this->parsetext_char($silence);
6247 choice_1:
6248 if ($r2!==self::$FAILED) {
6249 $r1[] = $r2;
6250 } else {
6251 break;
6252 }
6253 }
6254 if (count($r1) === 0) {
6255 $r1 = self::$FAILED;
6256 }
6257 // free $r2
6258 $this->cache[$bucket][$key] = new GrammarCacheEntry(
6259 $this->currPos,
6260 $r1,
6261 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
6262 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
6263 );
6264 return $r1;
6265 }
6266 private function parseinline_element($silence, $boolParams, &$param_preproc, &$param_th) {
6267 $key = json_encode([316, $boolParams & 0x3fff, $param_preproc, $param_th]);
6268 $bucket = $this->currPos;
6269 $cached = $this->cache[$bucket][$key] ?? null;
6270 if ($cached) {
6271 $this->currPos = $cached->nextPos;
6272 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
6273 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
6274 return $cached->result;
6275 }
6276 $saved_preproc=$param_preproc;
6277 $saved_th=$param_th;
6278 // start choice_1
6279 $p2 = $this->currPos;
6280 // start seq_1
6281 $p3 = $this->currPos;
6282 $p4 = $this->currPos;
6283 if (($this->input[$this->currPos] ?? null) === "<") {
6284 $this->currPos++;
6285 $r5 = "<";
6286 $r5 = false;
6287 $this->currPos = $p4;
6288 } else {
6289 $r5 = self::$FAILED;
6290 $r1 = self::$FAILED;
6291 goto seq_1;
6292 }
6293 // free $p4
6294 // start choice_2
6295 $r6 = $this->parseinline_xmlish_tag($silence, $boolParams, $param_preproc, $param_th);
6296 if ($r6!==self::$FAILED) {
6297 goto choice_2;
6298 }
6299 $r6 = $this->parsecomment($silence);
6300 choice_2:
6301 // r <- $r6
6302 if ($r6===self::$FAILED) {
6303 $this->currPos = $p3;
6304 $r1 = self::$FAILED;
6305 goto seq_1;
6306 }
6307 $r1 = true;
6308 seq_1:
6309 if ($r1!==self::$FAILED) {
6310 $this->savedPos = $p2;
6311 $r1 = $this->a24($r6);
6312 goto choice_1;
6313 }
6314 // free $p3
6315 $p3 = $this->currPos;
6316 // start seq_2
6317 $p4 = $this->currPos;
6318 $p7 = $this->currPos;
6319 if (($this->input[$this->currPos] ?? null) === "{") {
6320 $this->currPos++;
6321 $r8 = "{";
6322 $r8 = false;
6323 $this->currPos = $p7;
6324 } else {
6325 $r8 = self::$FAILED;
6326 $r1 = self::$FAILED;
6327 goto seq_2;
6328 }
6329 // free $p7
6330 $r9 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc);
6331 // r <- $r9
6332 if ($r9===self::$FAILED) {
6333 $this->currPos = $p4;
6334 $r1 = self::$FAILED;
6335 goto seq_2;
6336 }
6337 $r1 = true;
6338 seq_2:
6339 if ($r1!==self::$FAILED) {
6340 $this->savedPos = $p3;
6341 $r1 = $this->a24($r9);
6342 goto choice_1;
6343 }
6344 // free $p4
6345 $p4 = $this->currPos;
6346 // start seq_3
6347 $p7 = $this->currPos;
6348 $p10 = $this->currPos;
6349 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) {
6350 $r11 = "-{";
6351 $this->currPos += 2;
6352 $r11 = false;
6353 $this->currPos = $p10;
6354 } else {
6355 $r11 = self::$FAILED;
6356 $r1 = self::$FAILED;
6357 goto seq_3;
6358 }
6359 // free $p10
6360 $r12 = $this->parselang_variant_or_tpl($silence, $boolParams, $param_th, $param_preproc);
6361 // r <- $r12
6362 if ($r12===self::$FAILED) {
6363 $this->currPos = $p7;
6364 $r1 = self::$FAILED;
6365 goto seq_3;
6366 }
6367 $r1 = true;
6368 seq_3:
6369 if ($r1!==self::$FAILED) {
6370 $this->savedPos = $p4;
6371 $r1 = $this->a24($r12);
6372 goto choice_1;
6373 }
6374 // free $p7
6375 $p7 = $this->currPos;
6376 $r1 = self::$FAILED;
6377 for (;;) {
6378 // start seq_4
6379 $p10 = $this->currPos;
6380 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) {
6381 $r14 = "[[";
6382 $this->currPos += 2;
6383 } else {
6384 if (!$silence) {$this->fail(41);}
6385 $r14 = self::$FAILED;
6386 $r13 = self::$FAILED;
6387 goto seq_4;
6388 }
6389 $p15 = $this->currPos;
6390 if (($this->input[$this->currPos] ?? null) === "[") {
6391 $this->currPos++;
6392 $r16 = "[";
6393 $r16 = false;
6394 $this->currPos = $p15;
6395 } else {
6396 $r16 = self::$FAILED;
6397 $this->currPos = $p10;
6398 $r13 = self::$FAILED;
6399 goto seq_4;
6400 }
6401 // free $p15
6402 $r13 = true;
6403 seq_4:
6404 if ($r13!==self::$FAILED) {
6405 $r1 = true;
6406 } else {
6407 break;
6408 }
6409 // free $p10
6410 }
6411 if ($r1!==self::$FAILED) {
6412 $r1 = substr($this->input, $p7, $this->currPos - $p7);
6413 goto choice_1;
6414 } else {
6415 $r1 = self::$FAILED;
6416 }
6417 // free $r13
6418 // free $p7
6419 $p7 = $this->currPos;
6420 // start seq_5
6421 $p10 = $this->currPos;
6422 $p15 = $this->currPos;
6423 if (($this->input[$this->currPos] ?? null) === "[") {
6424 $this->currPos++;
6425 $r13 = "[";
6426 $r13 = false;
6427 $this->currPos = $p15;
6428 } else {
6429 $r13 = self::$FAILED;
6430 $r1 = self::$FAILED;
6431 goto seq_5;
6432 }
6433 // free $p15
6434 // start choice_3
6435 $r17 = $this->parsewikilink($silence, $boolParams, $param_th, $param_preproc);
6436 if ($r17!==self::$FAILED) {
6437 goto choice_3;
6438 }
6439 $r17 = $this->parseextlink($silence, $boolParams, $param_preproc, $param_th);
6440 choice_3:
6441 // r <- $r17
6442 if ($r17===self::$FAILED) {
6443 $this->currPos = $p10;
6444 $r1 = self::$FAILED;
6445 goto seq_5;
6446 }
6447 $r1 = true;
6448 seq_5:
6449 if ($r1!==self::$FAILED) {
6450 $this->savedPos = $p7;
6451 $r1 = $this->a24($r17);
6452 goto choice_1;
6453 }
6454 // free $p10
6455 $p10 = $this->currPos;
6456 // start seq_6
6457 $p15 = $this->currPos;
6458 $p18 = $this->currPos;
6459 if (($this->input[$this->currPos] ?? null) === "'") {
6460 $this->currPos++;
6461 $r19 = "'";
6462 $r19 = false;
6463 $this->currPos = $p18;
6464 } else {
6465 $r19 = self::$FAILED;
6466 $r1 = self::$FAILED;
6467 goto seq_6;
6468 }
6469 // free $p18
6470 $r20 = $this->parsequote($silence);
6471 // r <- $r20
6472 if ($r20===self::$FAILED) {
6473 $this->currPos = $p15;
6474 $r1 = self::$FAILED;
6475 goto seq_6;
6476 }
6477 $r1 = true;
6478 seq_6:
6479 if ($r1!==self::$FAILED) {
6480 $this->savedPos = $p10;
6481 $r1 = $this->a24($r20);
6482 }
6483 // free $p15
6484 choice_1:
6485 $this->cache[$bucket][$key] = new GrammarCacheEntry(
6486 $this->currPos,
6487 $r1,
6488 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
6489 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
6490 );
6491 return $r1;
6492 }
6493 private function discardlist_char($silence) {
6494 $key = 457;
6495 $bucket = $this->currPos;
6496 $cached = $this->cache[$bucket][$key] ?? null;
6497 if ($cached) {
6498 $this->currPos = $cached->nextPos;
6499
6500 return $cached->result;
6501 }
6502
6503 if (strspn($this->input, "*#:;", $this->currPos, 1) !== 0) {
6504 $r1 = $this->input[$this->currPos++];
6505 } else {
6506 $r1 = self::$FAILED;
6507 if (!$silence) {$this->fail(42);}
6508 }
6509 $this->cache[$bucket][$key] = new GrammarCacheEntry(
6510 $this->currPos,
6511 $r1,
6512 self::$UNDEFINED,
6513 self::$UNDEFINED
6514 );
6515 return $r1;
6516 }
6517 private function parselist_char($silence) {
6518 $key = 456;
6519 $bucket = $this->currPos;
6520 $cached = $this->cache[$bucket][$key] ?? null;
6521 if ($cached) {
6522 $this->currPos = $cached->nextPos;
6523
6524 return $cached->result;
6525 }
6526
6527 if (strspn($this->input, "*#:;", $this->currPos, 1) !== 0) {
6528 $r1 = $this->input[$this->currPos++];
6529 } else {
6530 $r1 = self::$FAILED;
6531 if (!$silence) {$this->fail(42);}
6532 }
6533 $this->cache[$bucket][$key] = new GrammarCacheEntry(
6534 $this->currPos,
6535 $r1,
6536 self::$UNDEFINED,
6537 self::$UNDEFINED
6538 );
6539 return $r1;
6540 }
6541 private function parsedtdd_colon($silence, $boolParams, &$param_preproc, &$param_th) {
6542 $key = json_encode([452, $boolParams & 0x2fff, $param_preproc, $param_th]);
6543 $bucket = $this->currPos;
6544 $cached = $this->cache[$bucket][$key] ?? null;
6545 if ($cached) {
6546 $this->currPos = $cached->nextPos;
6547 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
6548 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
6549 return $cached->result;
6550 }
6551 $saved_preproc=$param_preproc;
6552 $saved_th=$param_th;
6553 $p2 = $this->currPos;
6554 // start seq_1
6555 $p3 = $this->currPos;
6556 $r4 = $this->parseinlineline_break_on_colon($silence, $boolParams, $param_preproc, $param_th);
6557 if ($r4===self::$FAILED) {
6558 $r4 = null;
6559 }
6560 // c <- $r4
6561 $p6 = $this->currPos;
6562 // cpos <- $r5
6563 if (($this->input[$this->currPos] ?? null) === ":") {
6564 $this->currPos++;
6565 $r5 = ":";
6566 $this->savedPos = $p6;
6567 $r5 = $this->a66($r4);
6568 } else {
6569 if (!$silence) {$this->fail(18);}
6570 $r5 = self::$FAILED;
6571 $this->currPos = $p3;
6572 $r1 = self::$FAILED;
6573 goto seq_1;
6574 }
6575 $r1 = true;
6576 seq_1:
6577 if ($r1!==self::$FAILED) {
6578 $this->savedPos = $p2;
6579 $r1 = $this->a67($r4, $r5);
6580 }
6581 // free $p3
6582 $this->cache[$bucket][$key] = new GrammarCacheEntry(
6583 $this->currPos,
6584 $r1,
6585 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
6586 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
6587 );
6588 return $r1;
6589 }
6590 private function discardeolf($silence) {
6591 $key = 539;
6592 $bucket = $this->currPos;
6593 $cached = $this->cache[$bucket][$key] ?? null;
6594 if ($cached) {
6595 $this->currPos = $cached->nextPos;
6596
6597 return $cached->result;
6598 }
6599
6600 // start choice_1
6601 $r1 = $this->discardnewline($silence);
6602 if ($r1!==self::$FAILED) {
6603 goto choice_1;
6604 }
6605 $r1 = $this->discardeof($silence);
6606 choice_1:
6607 $this->cache[$bucket][$key] = new GrammarCacheEntry(
6608 $this->currPos,
6609 $r1,
6610 self::$UNDEFINED,
6611 self::$UNDEFINED
6612 );
6613 return $r1;
6614 }
6615 private function parsetable_line($silence, $boolParams, &$param_preproc, &$param_th) {
6616 $key = json_encode([464, $boolParams & 0x3fff, $param_preproc, $param_th]);
6617 $bucket = $this->currPos;
6618 $cached = $this->cache[$bucket][$key] ?? null;
6619 if ($cached) {
6620 $this->currPos = $cached->nextPos;
6621 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
6622 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
6623 return $cached->result;
6624 }
6625 $saved_preproc=$param_preproc;
6626 $saved_th=$param_th;
6627 $p2 = $this->currPos;
6628 // start seq_1
6629 $p3 = $this->currPos;
6630 // start choice_1
6631 $p5 = $this->currPos;
6632 $r4 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
6633 if ($r4 === self::$FAILED) {
6634 $r4 = false;
6635 goto choice_1;
6636 } else {
6637 $r4 = self::$FAILED;
6638 $this->currPos = $p5;
6639 }
6640 // free $p5
6641 $p5 = $this->currPos;
6642 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}", $this->currPos, 5, false) === 0) {
6643 $r4 = "{{!}}";
6644 $this->currPos += 5;
6645 $r4 = false;
6646 $this->currPos = $p5;
6647 } else {
6648 $r4 = self::$FAILED;
6649 }
6650 // free $p5
6651 choice_1:
6652 if ($r4===self::$FAILED) {
6653 $r1 = self::$FAILED;
6654 goto seq_1;
6655 }
6656 // start choice_2
6657 $r6 = $this->parsetable_start_tag($silence, $boolParams, $param_preproc, $param_th);
6658 if ($r6!==self::$FAILED) {
6659 goto choice_2;
6660 }
6661 $r6 = $this->parsetable_content_line($silence, $boolParams | 0x40, $param_preproc, $param_th);
6662 if ($r6!==self::$FAILED) {
6663 goto choice_2;
6664 }
6665 $r6 = $this->parsetable_end_tag($silence);
6666 choice_2:
6667 // tl <- $r6
6668 if ($r6===self::$FAILED) {
6669 $this->currPos = $p3;
6670 $r1 = self::$FAILED;
6671 goto seq_1;
6672 }
6673 $r1 = true;
6674 seq_1:
6675 if ($r1!==self::$FAILED) {
6676 $this->savedPos = $p2;
6677 $r1 = $this->a68($r6);
6678 }
6679 // free $p3
6680 $this->cache[$bucket][$key] = new GrammarCacheEntry(
6681 $this->currPos,
6682 $r1,
6683 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
6684 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
6685 );
6686 return $r1;
6687 }
6688 private function parsesol($silence, $boolParams, &$param_preproc, &$param_th) {
6689 $key = json_encode([558, $boolParams & 0x3ebf, $param_preproc, $param_th]);
6690 $bucket = $this->currPos;
6691 $cached = $this->cache[$bucket][$key] ?? null;
6692 if ($cached) {
6693 $this->currPos = $cached->nextPos;
6694 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
6695 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
6696 return $cached->result;
6697 }
6698 $saved_preproc=$param_preproc;
6699 $saved_th=$param_th;
6700 // start seq_1
6701 $p1 = $this->currPos;
6702 // start choice_1
6703 $r3 = $this->parseempty_line_with_comments($silence);
6704 if ($r3!==self::$FAILED) {
6705 goto choice_1;
6706 }
6707 $r3 = $this->parsesol_prefix($silence);
6708 choice_1:
6709 if ($r3===self::$FAILED) {
6710 $r2 = self::$FAILED;
6711 goto seq_1;
6712 }
6713 $r4 = [];
6714 for (;;) {
6715 $r5 = $this->parsesol_transparent($silence, $boolParams, $param_preproc, $param_th);
6716 if ($r5!==self::$FAILED) {
6717 $r4[] = $r5;
6718 } else {
6719 break;
6720 }
6721 }
6722 // free $r5
6723 $r2 = [$r3,$r4];
6724 seq_1:
6725 // free $r2,$p1
6726 $this->cache[$bucket][$key] = new GrammarCacheEntry(
6727 $this->currPos,
6728 $r2,
6729 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
6730 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
6731 );
6732 return $r2;
6733 }
6734 private function discardcomment($silence) {
6735 $key = 541;
6736 $bucket = $this->currPos;
6737 $cached = $this->cache[$bucket][$key] ?? null;
6738 if ($cached) {
6739 $this->currPos = $cached->nextPos;
6740
6741 return $cached->result;
6742 }
6743
6744 $p2 = $this->currPos;
6745 // start seq_1
6746 $p3 = $this->currPos;
6747 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "<!--", $this->currPos, 4, false) === 0) {
6748 $r4 = "<!--";
6749 $this->currPos += 4;
6750 } else {
6751 if (!$silence) {$this->fail(11);}
6752 $r4 = self::$FAILED;
6753 $r1 = self::$FAILED;
6754 goto seq_1;
6755 }
6756 $p6 = $this->currPos;
6757 for (;;) {
6758 // start seq_2
6759 $p8 = $this->currPos;
6760 $p9 = $this->currPos;
6761 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) {
6762 $r10 = "-->";
6763 $this->currPos += 3;
6764 } else {
6765 $r10 = self::$FAILED;
6766 }
6767 if ($r10 === self::$FAILED) {
6768 $r10 = false;
6769 } else {
6770 $r10 = self::$FAILED;
6771 $this->currPos = $p9;
6772 $r7 = self::$FAILED;
6773 goto seq_2;
6774 }
6775 // free $p9
6776 if ($this->currPos < $this->inputLength) {
6777 $r11 = self::consumeChar($this->input, $this->currPos);;
6778 } else {
6779 $r11 = self::$FAILED;
6780 if (!$silence) {$this->fail(7);}
6781 $this->currPos = $p8;
6782 $r7 = self::$FAILED;
6783 goto seq_2;
6784 }
6785 $r7 = true;
6786 seq_2:
6787 if ($r7===self::$FAILED) {
6788 break;
6789 }
6790 // free $p8
6791 }
6792 // free $r7
6793 $r5 = true;
6794 // c <- $r5
6795 if ($r5!==self::$FAILED) {
6796 $r5 = substr($this->input, $p6, $this->currPos - $p6);
6797 } else {
6798 $r5 = self::$FAILED;
6799 $this->currPos = $p3;
6800 $r1 = self::$FAILED;
6801 goto seq_1;
6802 }
6803 // free $p6
6804 $p6 = $this->currPos;
6805 // start choice_1
6806 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-->", $this->currPos, 3, false) === 0) {
6807 $r7 = "-->";
6808 $this->currPos += 3;
6809 goto choice_1;
6810 } else {
6811 if (!$silence) {$this->fail(12);}
6812 $r7 = self::$FAILED;
6813 }
6814 $r7 = $this->discardeof($silence);
6815 choice_1:
6816 // cEnd <- $r7
6817 if ($r7!==self::$FAILED) {
6818 $r7 = substr($this->input, $p6, $this->currPos - $p6);
6819 } else {
6820 $r7 = self::$FAILED;
6821 $this->currPos = $p3;
6822 $r1 = self::$FAILED;
6823 goto seq_1;
6824 }
6825 // free $p6
6826 $r1 = true;
6827 seq_1:
6828 if ($r1!==self::$FAILED) {
6829 $this->savedPos = $p2;
6830 $r1 = $this->a27($r5, $r7);
6831 }
6832 // free $p3
6833 $this->cache[$bucket][$key] = new GrammarCacheEntry(
6834 $this->currPos,
6835 $r1,
6836 self::$UNDEFINED,
6837 self::$UNDEFINED
6838 );
6839 return $r1;
6840 }
6841 private function discardsof($silence) {
6842 $key = 531;
6843 $bucket = $this->currPos;
6844 $cached = $this->cache[$bucket][$key] ?? null;
6845 if ($cached) {
6846 $this->currPos = $cached->nextPos;
6847
6848 return $cached->result;
6849 }
6850
6851 $this->savedPos = $this->currPos;
6852 $r1 = $this->a69();
6853 if ($r1) {
6854 $r1 = false;
6855 } else {
6856 $r1 = self::$FAILED;
6857 }
6858 $this->cache[$bucket][$key] = new GrammarCacheEntry(
6859 $this->currPos,
6860 $r1,
6861 self::$UNDEFINED,
6862 self::$UNDEFINED
6863 );
6864 return $r1;
6865 }
6866 private function parseredirect($silence, $boolParams, &$param_th, &$param_preproc) {
6867 $key = json_encode([292, $boolParams & 0x3fff, $param_th, $param_preproc]);
6868 $bucket = $this->currPos;
6869 $cached = $this->cache[$bucket][$key] ?? null;
6870 if ($cached) {
6871 $this->currPos = $cached->nextPos;
6872 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
6873 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
6874 return $cached->result;
6875 }
6876 $saved_th=$param_th;
6877 $saved_preproc=$param_preproc;
6878 $p2 = $this->currPos;
6879 // start seq_1
6880 $p3 = $this->currPos;
6881 $r4 = $this->parseredirect_word($silence);
6882 // rw <- $r4
6883 if ($r4===self::$FAILED) {
6884 $r1 = self::$FAILED;
6885 goto seq_1;
6886 }
6887 $p6 = $this->currPos;
6888 for (;;) {
6889 $r7 = $this->discardspace_or_newline($silence);
6890 if ($r7===self::$FAILED) {
6891 break;
6892 }
6893 }
6894 // free $r7
6895 $r5 = true;
6896 // sp <- $r5
6897 if ($r5!==self::$FAILED) {
6898 $r5 = substr($this->input, $p6, $this->currPos - $p6);
6899 } else {
6900 $r5 = self::$FAILED;
6901 $this->currPos = $p3;
6902 $r1 = self::$FAILED;
6903 goto seq_1;
6904 }
6905 // free $p6
6906 $p6 = $this->currPos;
6907 // start seq_2
6908 $p8 = $this->currPos;
6909 if (($this->input[$this->currPos] ?? null) === ":") {
6910 $this->currPos++;
6911 $r9 = ":";
6912 } else {
6913 if (!$silence) {$this->fail(18);}
6914 $r9 = self::$FAILED;
6915 $r7 = self::$FAILED;
6916 goto seq_2;
6917 }
6918 for (;;) {
6919 $r11 = $this->discardspace_or_newline($silence);
6920 if ($r11===self::$FAILED) {
6921 break;
6922 }
6923 }
6924 // free $r11
6925 $r10 = true;
6926 if ($r10===self::$FAILED) {
6927 $this->currPos = $p8;
6928 $r7 = self::$FAILED;
6929 goto seq_2;
6930 }
6931 // free $r10
6932 $r7 = true;
6933 seq_2:
6934 if ($r7===self::$FAILED) {
6935 $r7 = null;
6936 }
6937 // free $p8
6938 // c <- $r7
6939 $r7 = substr($this->input, $p6, $this->currPos - $p6);
6940 // free $p6
6941 $r10 = $this->parsewikilink($silence, $boolParams, $param_th, $param_preproc);
6942 // wl <- $r10
6943 if ($r10===self::$FAILED) {
6944 $this->currPos = $p3;
6945 $r1 = self::$FAILED;
6946 goto seq_1;
6947 }
6948 $this->savedPos = $this->currPos;
6949 $r11 = $this->a70($r4, $r5, $r7, $r10);
6950 if ($r11) {
6951 $r11 = false;
6952 } else {
6953 $r11 = self::$FAILED;
6954 $this->currPos = $p3;
6955 $r1 = self::$FAILED;
6956 goto seq_1;
6957 }
6958 $r1 = true;
6959 seq_1:
6960 if ($r1!==self::$FAILED) {
6961 $this->savedPos = $p2;
6962 $r1 = $this->a71($r4, $r5, $r7, $r10);
6963 }
6964 // free $p3
6965 $this->cache[$bucket][$key] = new GrammarCacheEntry(
6966 $this->currPos,
6967 $r1,
6968 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
6969 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
6970 );
6971 return $r1;
6972 }
6973 private function parsesol_transparent($silence, $boolParams, &$param_preproc, &$param_th) {
6974 $key = json_encode([556, $boolParams & 0x3ebf, $param_preproc, $param_th]);
6975 $bucket = $this->currPos;
6976 $cached = $this->cache[$bucket][$key] ?? null;
6977 if ($cached) {
6978 $this->currPos = $cached->nextPos;
6979 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
6980 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
6981 return $cached->result;
6982 }
6983 $saved_preproc=$param_preproc;
6984 $saved_th=$param_th;
6985 // start choice_1
6986 $r1 = $this->parsecomment($silence);
6987 if ($r1!==self::$FAILED) {
6988 goto choice_1;
6989 }
6990 $r1 = $this->parseinclude_limits($silence, $boolParams | 0x2000, $param_preproc, $param_th);
6991 if ($r1!==self::$FAILED) {
6992 goto choice_1;
6993 }
6994 $r1 = $this->parseannotation_tag($silence, $boolParams, $param_preproc, $param_th);
6995 if ($r1!==self::$FAILED) {
6996 goto choice_1;
6997 }
6998 $r1 = $this->parsebehavior_switch($silence);
6999 choice_1:
7000 $this->cache[$bucket][$key] = new GrammarCacheEntry(
7001 $this->currPos,
7002 $r1,
7003 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
7004 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
7005 );
7006 return $r1;
7007 }
7008 private function parseblock_line($silence, $boolParams, &$param_preproc, &$param_th) {
7009 $key = json_encode([306, $boolParams & 0x3fff, $param_preproc, $param_th]);
7010 $bucket = $this->currPos;
7011 $cached = $this->cache[$bucket][$key] ?? null;
7012 if ($cached) {
7013 $this->currPos = $cached->nextPos;
7014 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
7015 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
7016 return $cached->result;
7017 }
7018 $saved_preproc=$param_preproc;
7019 $saved_th=$param_th;
7020 // start choice_1
7021 $r1 = $this->parseheading($silence, $boolParams, $param_preproc, $param_th);
7022 if ($r1!==self::$FAILED) {
7023 goto choice_1;
7024 }
7025 $r1 = $this->parselist_item($silence, $boolParams, $param_preproc, $param_th);
7026 if ($r1!==self::$FAILED) {
7027 goto choice_1;
7028 }
7029 $r1 = $this->parsehr($silence, $boolParams, $param_preproc, $param_th);
7030 if ($r1!==self::$FAILED) {
7031 goto choice_1;
7032 }
7033 $p2 = $this->currPos;
7034 // start seq_1
7035 $p3 = $this->currPos;
7036 $r4 = $this->parseoptionalSpaceToken($silence);
7037 // st <- $r4
7038 if ($r4===self::$FAILED) {
7039 $r1 = self::$FAILED;
7040 goto seq_1;
7041 }
7042 $p5 = $this->currPos;
7043 if (strspn($this->input, " <{}|!", $this->currPos, 1) !== 0) {
7044 $r6 = $this->input[$this->currPos++];
7045 $r6 = false;
7046 $this->currPos = $p5;
7047 } else {
7048 $r6 = self::$FAILED;
7049 $this->currPos = $p3;
7050 $r1 = self::$FAILED;
7051 goto seq_1;
7052 }
7053 // free $p5
7054 $r7 = $this->parsetable_line($silence, $boolParams, $param_preproc, $param_th);
7055 // tl <- $r7
7056 if ($r7===self::$FAILED) {
7057 $this->currPos = $p3;
7058 $r1 = self::$FAILED;
7059 goto seq_1;
7060 }
7061 $r1 = true;
7062 seq_1:
7063 if ($r1!==self::$FAILED) {
7064 $this->savedPos = $p2;
7065 $r1 = $this->a72($r4, $r7);
7066 }
7067 // free $p3
7068 choice_1:
7069 $this->cache[$bucket][$key] = new GrammarCacheEntry(
7070 $this->currPos,
7071 $r1,
7072 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
7073 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
7074 );
7075 return $r1;
7076 }
7077 private function parseblock_lines($silence, $boolParams, &$param_preproc, &$param_th) {
7078 $key = json_encode([302, $boolParams & 0x3fff, $param_preproc, $param_th]);
7079 $bucket = $this->currPos;
7080 $cached = $this->cache[$bucket][$key] ?? null;
7081 if ($cached) {
7082 $this->currPos = $cached->nextPos;
7083 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
7084 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
7085 return $cached->result;
7086 }
7087 $saved_preproc=$param_preproc;
7088 $saved_th=$param_th;
7089 $p2 = $this->currPos;
7090 // start seq_1
7091 $p3 = $this->currPos;
7092 $r4 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th);
7093 // s <- $r4
7094 if ($r4===self::$FAILED) {
7095 $r1 = self::$FAILED;
7096 goto seq_1;
7097 }
7098 $p6 = $this->currPos;
7099 // start seq_2
7100 $p7 = $this->currPos;
7101 $r8 = $this->parseoptionalSpaceToken($silence);
7102 // os <- $r8
7103 if ($r8===self::$FAILED) {
7104 $r5 = self::$FAILED;
7105 goto seq_2;
7106 }
7107 $r9 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th);
7108 // so <- $r9
7109 if ($r9===self::$FAILED) {
7110 $this->currPos = $p7;
7111 $r5 = self::$FAILED;
7112 goto seq_2;
7113 }
7114 $r5 = true;
7115 seq_2:
7116 if ($r5!==self::$FAILED) {
7117 $this->savedPos = $p6;
7118 $r5 = $this->a73($r4, $r8, $r9);
7119 } else {
7120 $r5 = null;
7121 }
7122 // free $p7
7123 // s2 <- $r5
7124 $r10 = $this->parseblock_line($silence, $boolParams, $param_preproc, $param_th);
7125 // bl <- $r10
7126 if ($r10===self::$FAILED) {
7127 $this->currPos = $p3;
7128 $r1 = self::$FAILED;
7129 goto seq_1;
7130 }
7131 $r1 = true;
7132 seq_1:
7133 if ($r1!==self::$FAILED) {
7134 $this->savedPos = $p2;
7135 $r1 = $this->a74($r4, $r5, $r10);
7136 }
7137 // free $p3
7138 $this->cache[$bucket][$key] = new GrammarCacheEntry(
7139 $this->currPos,
7140 $r1,
7141 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
7142 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
7143 );
7144 return $r1;
7145 }
7146 private function discardtplarg($silence, $boolParams, &$param_th) {
7147 $key = json_encode([359, $boolParams & 0x3fff, $param_th]);
7148 $bucket = $this->currPos;
7149 $cached = $this->cache[$bucket][$key] ?? null;
7150 if ($cached) {
7151 $this->currPos = $cached->nextPos;
7152 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
7153 return $cached->result;
7154 }
7155 $saved_th=$param_th;
7156 $r1 = $this->discardtplarg_preproc($silence, $boolParams, self::newRef("}}"), $param_th);
7157 $this->cache[$bucket][$key] = new GrammarCacheEntry(
7158 $this->currPos,
7159 $r1,
7160 self::$UNDEFINED,
7161 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
7162 );
7163 return $r1;
7164 }
7165 private function parsetemplate($silence, $boolParams, &$param_th) {
7166 $key = json_encode([352, $boolParams & 0x3fff, $param_th]);
7167 $bucket = $this->currPos;
7168 $cached = $this->cache[$bucket][$key] ?? null;
7169 if ($cached) {
7170 $this->currPos = $cached->nextPos;
7171 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
7172 return $cached->result;
7173 }
7174 $saved_th=$param_th;
7175 $r1 = $this->parsetemplate_preproc($silence, $boolParams, self::newRef("}}"), $param_th);
7176 $this->cache[$bucket][$key] = new GrammarCacheEntry(
7177 $this->currPos,
7178 $r1,
7179 self::$UNDEFINED,
7180 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
7181 );
7182 return $r1;
7183 }
7184 private function parsebroken_template($silence, &$param_preproc) {
7185 $key = json_encode([354, $param_preproc]);
7186 $bucket = $this->currPos;
7187 $cached = $this->cache[$bucket][$key] ?? null;
7188 if ($cached) {
7189 $this->currPos = $cached->nextPos;
7190 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
7191 return $cached->result;
7192 }
7193 $saved_preproc=$param_preproc;
7194 $p2 = $this->currPos;
7195 // start seq_1
7196 $p3 = $this->currPos;
7197 // t <- $r4
7198 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) {
7199 $r4 = "{{";
7200 $this->currPos += 2;
7201 } else {
7202 if (!$silence) {$this->fail(43);}
7203 $r4 = self::$FAILED;
7204 $this->currPos = $p3;
7205 $r1 = self::$FAILED;
7206 goto seq_1;
7207 }
7208 $r1 = true;
7209 seq_1:
7210 if ($r1!==self::$FAILED) {
7211 $this->savedPos = $p2;
7212 $r1 = $this->a75($param_preproc, $r4);
7213 }
7214 // free $p3
7215 $this->cache[$bucket][$key] = new GrammarCacheEntry(
7216 $this->currPos,
7217 $r1,
7218 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
7219 self::$UNDEFINED
7220 );
7221 return $r1;
7222 }
7223 private function parsetplarg($silence, $boolParams, &$param_th) {
7224 $key = json_encode([358, $boolParams & 0x3fff, $param_th]);
7225 $bucket = $this->currPos;
7226 $cached = $this->cache[$bucket][$key] ?? null;
7227 if ($cached) {
7228 $this->currPos = $cached->nextPos;
7229 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
7230 return $cached->result;
7231 }
7232 $saved_th=$param_th;
7233 $r1 = $this->parsetplarg_preproc($silence, $boolParams, self::newRef("}}"), $param_th);
7234 $this->cache[$bucket][$key] = new GrammarCacheEntry(
7235 $this->currPos,
7236 $r1,
7237 self::$UNDEFINED,
7238 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
7239 );
7240 return $r1;
7241 }
7242 private function discardwikilink($silence, $boolParams, &$param_th, &$param_preproc) {
7243 $key = json_encode([403, $boolParams & 0x3fff, $param_th, $param_preproc]);
7244 $bucket = $this->currPos;
7245 $cached = $this->cache[$bucket][$key] ?? null;
7246 if ($cached) {
7247 $this->currPos = $cached->nextPos;
7248 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
7249 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
7250 return $cached->result;
7251 }
7252 $saved_th=$param_th;
7253 $saved_preproc=$param_preproc;
7254 // start choice_1
7255 $r1 = $this->discardwikilink_preproc($silence, $boolParams, self::newRef("]]"), $param_th);
7256 if ($r1!==self::$FAILED) {
7257 goto choice_1;
7258 }
7259 $r1 = $this->discardbroken_wikilink($silence, $boolParams, $param_preproc, $param_th);
7260 choice_1:
7261 $this->cache[$bucket][$key] = new GrammarCacheEntry(
7262 $this->currPos,
7263 $r1,
7264 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
7265 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
7266 );
7267 return $r1;
7268 }
7269 private function parsedirective($silence, $boolParams, &$param_preproc, &$param_th) {
7270 $key = json_encode([502, $boolParams & 0x3fff, $param_preproc, $param_th]);
7271 $bucket = $this->currPos;
7272 $cached = $this->cache[$bucket][$key] ?? null;
7273 if ($cached) {
7274 $this->currPos = $cached->nextPos;
7275 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
7276 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
7277 return $cached->result;
7278 }
7279 $saved_preproc=$param_preproc;
7280 $saved_th=$param_th;
7281 // start choice_1
7282 $r1 = $this->parsecomment($silence);
7283 if ($r1!==self::$FAILED) {
7284 goto choice_1;
7285 }
7286 $r1 = $this->parseextension_annotation_tag($silence, $boolParams, $param_preproc, $param_th);
7287 if ($r1!==self::$FAILED) {
7288 goto choice_1;
7289 }
7290 $r1 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc);
7291 if ($r1!==self::$FAILED) {
7292 goto choice_1;
7293 }
7294 $p2 = $this->currPos;
7295 // start seq_1
7296 $p3 = $this->currPos;
7297 $p4 = $this->currPos;
7298 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) {
7299 $r5 = "-{";
7300 $this->currPos += 2;
7301 $r5 = false;
7302 $this->currPos = $p4;
7303 } else {
7304 $r5 = self::$FAILED;
7305 $r1 = self::$FAILED;
7306 goto seq_1;
7307 }
7308 // free $p4
7309 $r6 = $this->parselang_variant_or_tpl($silence, $boolParams, $param_th, $param_preproc);
7310 // v <- $r6
7311 if ($r6===self::$FAILED) {
7312 $this->currPos = $p3;
7313 $r1 = self::$FAILED;
7314 goto seq_1;
7315 }
7316 $r1 = true;
7317 seq_1:
7318 if ($r1!==self::$FAILED) {
7319 $this->savedPos = $p2;
7320 $r1 = $this->a76($r6);
7321 goto choice_1;
7322 }
7323 // free $p3
7324 $p3 = $this->currPos;
7325 // start seq_2
7326 $p4 = $this->currPos;
7327 $p7 = $this->currPos;
7328 if (($this->input[$this->currPos] ?? null) === "&") {
7329 $this->currPos++;
7330 $r8 = "&";
7331 $r8 = false;
7332 $this->currPos = $p7;
7333 } else {
7334 $r8 = self::$FAILED;
7335 $r1 = self::$FAILED;
7336 goto seq_2;
7337 }
7338 // free $p7
7339 $r9 = $this->parsehtmlentity($silence);
7340 // e <- $r9
7341 if ($r9===self::$FAILED) {
7342 $this->currPos = $p4;
7343 $r1 = self::$FAILED;
7344 goto seq_2;
7345 }
7346 $r1 = true;
7347 seq_2:
7348 if ($r1!==self::$FAILED) {
7349 $this->savedPos = $p3;
7350 $r1 = $this->a77($r9);
7351 goto choice_1;
7352 }
7353 // free $p4
7354 $r1 = $this->parseinclude_limits($silence, $boolParams, $param_preproc, $param_th);
7355 choice_1:
7356 $this->cache[$bucket][$key] = new GrammarCacheEntry(
7357 $this->currPos,
7358 $r1,
7359 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
7360 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
7361 );
7362 return $r1;
7363 }
7364 private function parseinline_xmlish_tag($silence, $boolParams, &$param_preproc, &$param_th) {
7365 $key = json_encode([314, $boolParams & 0x3ebd, $param_preproc, $param_th]);
7366 $bucket = $this->currPos;
7367 $cached = $this->cache[$bucket][$key] ?? null;
7368 if ($cached) {
7369 $this->currPos = $cached->nextPos;
7370 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
7371 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
7372 return $cached->result;
7373 }
7374 $saved_preproc=$param_preproc;
7375 $saved_th=$param_th;
7376 $p2 = $this->currPos;
7377 // start seq_1
7378 $p3 = $this->currPos;
7379 if (($this->input[$this->currPos] ?? null) === "<") {
7380 $this->currPos++;
7381 $r4 = "<";
7382 } else {
7383 if (!$silence) {$this->fail(44);}
7384 $r4 = self::$FAILED;
7385 $r1 = self::$FAILED;
7386 goto seq_1;
7387 }
7388 // start choice_1
7389 $r5 = $this->parsexmlish_tag($silence, $boolParams | 0x2, $param_preproc, $param_th);
7390 if ($r5!==self::$FAILED) {
7391 goto choice_1;
7392 }
7393 $r5 = $this->parsexmlish_tag($silence, $boolParams & ~0x2, $param_preproc, $param_th);
7394 if ($r5!==self::$FAILED) {
7395 goto choice_1;
7396 }
7397 $r5 = $this->parsetvar_old_syntax_closing_HACK($silence);
7398 choice_1:
7399 // tag <- $r5
7400 if ($r5===self::$FAILED) {
7401 $this->currPos = $p3;
7402 $r1 = self::$FAILED;
7403 goto seq_1;
7404 }
7405 $r1 = true;
7406 seq_1:
7407 if ($r1!==self::$FAILED) {
7408 $this->savedPos = $p2;
7409 $r1 = $this->a78($r5);
7410 }
7411 // free $p3
7412 $this->cache[$bucket][$key] = new GrammarCacheEntry(
7413 $this->currPos,
7414 $r1,
7415 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
7416 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
7417 );
7418 return $r1;
7419 }
7420 private function parsetable_attribute_preprocessor_text_single($silence, $boolParams, &$param_preproc, &$param_th) {
7421 $key = json_encode([518, $boolParams & 0x3fff, $param_preproc, $param_th]);
7422 $bucket = $this->currPos;
7423 $cached = $this->cache[$bucket][$key] ?? null;
7424 if ($cached) {
7425 $this->currPos = $cached->nextPos;
7426 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
7427 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
7428 return $cached->result;
7429 }
7430 $saved_preproc=$param_preproc;
7431 $saved_th=$param_th;
7432 $p2 = $this->currPos;
7433 $r3 = [];
7434 for (;;) {
7435 // start choice_1
7436 $p5 = $this->currPos;
7437 $r4 = self::$FAILED;
7438 for (;;) {
7439 if (strcspn($this->input, "{}&<-!['\x0d\x0a|", $this->currPos, 1) !== 0) {
7440 $r6 = self::consumeChar($this->input, $this->currPos);
7441 $r4 = true;
7442 } else {
7443 $r6 = self::$FAILED;
7444 if (!$silence) {$this->fail(45);}
7445 break;
7446 }
7447 }
7448 if ($r4!==self::$FAILED) {
7449 $r4 = substr($this->input, $p5, $this->currPos - $p5);
7450 goto choice_1;
7451 } else {
7452 $r4 = self::$FAILED;
7453 }
7454 // free $r6
7455 // free $p5
7456 $p5 = $this->currPos;
7457 // start seq_1
7458 $p7 = $this->currPos;
7459 $p8 = $this->currPos;
7460 $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
7461 if ($r6 === self::$FAILED) {
7462 $r6 = false;
7463 } else {
7464 $r6 = self::$FAILED;
7465 $this->currPos = $p8;
7466 $r4 = self::$FAILED;
7467 goto seq_1;
7468 }
7469 // free $p8
7470 // start choice_2
7471 $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th);
7472 if ($r9!==self::$FAILED) {
7473 goto choice_2;
7474 }
7475 if (strspn($this->input, "{}&<-![", $this->currPos, 1) !== 0) {
7476 $r9 = $this->input[$this->currPos++];
7477 } else {
7478 $r9 = self::$FAILED;
7479 if (!$silence) {$this->fail(46);}
7480 }
7481 choice_2:
7482 // s <- $r9
7483 if ($r9===self::$FAILED) {
7484 $this->currPos = $p7;
7485 $r4 = self::$FAILED;
7486 goto seq_1;
7487 }
7488 $r4 = true;
7489 seq_1:
7490 if ($r4!==self::$FAILED) {
7491 $this->savedPos = $p5;
7492 $r4 = $this->a42($r9);
7493 }
7494 // free $p7
7495 choice_1:
7496 if ($r4!==self::$FAILED) {
7497 $r3[] = $r4;
7498 } else {
7499 break;
7500 }
7501 }
7502 // r <- $r3
7503 // free $r4
7504 $r1 = $r3;
7505 if ($r1!==self::$FAILED) {
7506 $this->savedPos = $p2;
7507 $r1 = $this->a59($r3);
7508 }
7509 $this->cache[$bucket][$key] = new GrammarCacheEntry(
7510 $this->currPos,
7511 $r1,
7512 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
7513 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
7514 );
7515 return $r1;
7516 }
7517 private function parsetable_attribute_preprocessor_text_double($silence, $boolParams, &$param_preproc, &$param_th) {
7518 $key = json_encode([520, $boolParams & 0x3fff, $param_preproc, $param_th]);
7519 $bucket = $this->currPos;
7520 $cached = $this->cache[$bucket][$key] ?? null;
7521 if ($cached) {
7522 $this->currPos = $cached->nextPos;
7523 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
7524 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
7525 return $cached->result;
7526 }
7527 $saved_preproc=$param_preproc;
7528 $saved_th=$param_th;
7529 $p2 = $this->currPos;
7530 $r3 = [];
7531 for (;;) {
7532 // start choice_1
7533 $p5 = $this->currPos;
7534 $r4 = self::$FAILED;
7535 for (;;) {
7536 if (strcspn($this->input, "{}&<-![\"\x0d\x0a|", $this->currPos, 1) !== 0) {
7537 $r6 = self::consumeChar($this->input, $this->currPos);
7538 $r4 = true;
7539 } else {
7540 $r6 = self::$FAILED;
7541 if (!$silence) {$this->fail(47);}
7542 break;
7543 }
7544 }
7545 if ($r4!==self::$FAILED) {
7546 $r4 = substr($this->input, $p5, $this->currPos - $p5);
7547 goto choice_1;
7548 } else {
7549 $r4 = self::$FAILED;
7550 }
7551 // free $r6
7552 // free $p5
7553 $p5 = $this->currPos;
7554 // start seq_1
7555 $p7 = $this->currPos;
7556 $p8 = $this->currPos;
7557 $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
7558 if ($r6 === self::$FAILED) {
7559 $r6 = false;
7560 } else {
7561 $r6 = self::$FAILED;
7562 $this->currPos = $p8;
7563 $r4 = self::$FAILED;
7564 goto seq_1;
7565 }
7566 // free $p8
7567 // start choice_2
7568 $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th);
7569 if ($r9!==self::$FAILED) {
7570 goto choice_2;
7571 }
7572 if (strspn($this->input, "{}&<-![", $this->currPos, 1) !== 0) {
7573 $r9 = $this->input[$this->currPos++];
7574 } else {
7575 $r9 = self::$FAILED;
7576 if (!$silence) {$this->fail(46);}
7577 }
7578 choice_2:
7579 // s <- $r9
7580 if ($r9===self::$FAILED) {
7581 $this->currPos = $p7;
7582 $r4 = self::$FAILED;
7583 goto seq_1;
7584 }
7585 $r4 = true;
7586 seq_1:
7587 if ($r4!==self::$FAILED) {
7588 $this->savedPos = $p5;
7589 $r4 = $this->a42($r9);
7590 }
7591 // free $p7
7592 choice_1:
7593 if ($r4!==self::$FAILED) {
7594 $r3[] = $r4;
7595 } else {
7596 break;
7597 }
7598 }
7599 // r <- $r3
7600 // free $r4
7601 $r1 = $r3;
7602 if ($r1!==self::$FAILED) {
7603 $this->savedPos = $p2;
7604 $r1 = $this->a59($r3);
7605 }
7606 $this->cache[$bucket][$key] = new GrammarCacheEntry(
7607 $this->currPos,
7608 $r1,
7609 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
7610 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
7611 );
7612 return $r1;
7613 }
7614 private function parsetable_attribute_preprocessor_text($silence, $boolParams, &$param_preproc, &$param_th) {
7615 $key = json_encode([516, $boolParams & 0x3fff, $param_preproc, $param_th]);
7616 $bucket = $this->currPos;
7617 $cached = $this->cache[$bucket][$key] ?? null;
7618 if ($cached) {
7619 $this->currPos = $cached->nextPos;
7620 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
7621 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
7622 return $cached->result;
7623 }
7624 $saved_preproc=$param_preproc;
7625 $saved_th=$param_th;
7626 $p2 = $this->currPos;
7627 $r3 = [];
7628 for (;;) {
7629 // start choice_1
7630 $p5 = $this->currPos;
7631 $r4 = self::$FAILED;
7632 for (;;) {
7633 if (strcspn($this->input, "{}&<-![ \x09\x0a\x0d\x0c|", $this->currPos, 1) !== 0) {
7634 $r6 = self::consumeChar($this->input, $this->currPos);
7635 $r4 = true;
7636 } else {
7637 $r6 = self::$FAILED;
7638 if (!$silence) {$this->fail(48);}
7639 break;
7640 }
7641 }
7642 if ($r4!==self::$FAILED) {
7643 $r4 = substr($this->input, $p5, $this->currPos - $p5);
7644 goto choice_1;
7645 } else {
7646 $r4 = self::$FAILED;
7647 }
7648 // free $r6
7649 // free $p5
7650 $p5 = $this->currPos;
7651 // start seq_1
7652 $p7 = $this->currPos;
7653 $p8 = $this->currPos;
7654 $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
7655 if ($r6 === self::$FAILED) {
7656 $r6 = false;
7657 } else {
7658 $r6 = self::$FAILED;
7659 $this->currPos = $p8;
7660 $r4 = self::$FAILED;
7661 goto seq_1;
7662 }
7663 // free $p8
7664 // start choice_2
7665 $r9 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th);
7666 if ($r9!==self::$FAILED) {
7667 goto choice_2;
7668 }
7669 if (strspn($this->input, "{}&<-![", $this->currPos, 1) !== 0) {
7670 $r9 = $this->input[$this->currPos++];
7671 } else {
7672 $r9 = self::$FAILED;
7673 if (!$silence) {$this->fail(46);}
7674 }
7675 choice_2:
7676 // s <- $r9
7677 if ($r9===self::$FAILED) {
7678 $this->currPos = $p7;
7679 $r4 = self::$FAILED;
7680 goto seq_1;
7681 }
7682 $r4 = true;
7683 seq_1:
7684 if ($r4!==self::$FAILED) {
7685 $this->savedPos = $p5;
7686 $r4 = $this->a42($r9);
7687 }
7688 // free $p7
7689 choice_1:
7690 if ($r4!==self::$FAILED) {
7691 $r3[] = $r4;
7692 } else {
7693 break;
7694 }
7695 }
7696 if (count($r3) === 0) {
7697 $r3 = self::$FAILED;
7698 }
7699 // r <- $r3
7700 // free $r4
7701 $r1 = $r3;
7702 if ($r1!==self::$FAILED) {
7703 $this->savedPos = $p2;
7704 $r1 = $this->a59($r3);
7705 }
7706 $this->cache[$bucket][$key] = new GrammarCacheEntry(
7707 $this->currPos,
7708 $r1,
7709 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
7710 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
7711 );
7712 return $r1;
7713 }
7714 private function parseless_than($silence, $boolParams) {
7715 $key = json_encode([434, $boolParams & 0x2]);
7716 $bucket = $this->currPos;
7717 $cached = $this->cache[$bucket][$key] ?? null;
7718 if ($cached) {
7719 $this->currPos = $cached->nextPos;
7720
7721 return $cached->result;
7722 }
7723
7724 $p1 = $this->currPos;
7725 // start seq_1
7726 $p3 = $this->currPos;
7727 if (/*annOrExtTag*/($boolParams & 0x2) !== 0) {
7728 $r4 = false;
7729 } else {
7730 $r4 = self::$FAILED;
7731 $r2 = self::$FAILED;
7732 goto seq_1;
7733 }
7734 if (($this->input[$this->currPos] ?? null) === "<") {
7735 $this->currPos++;
7736 $r5 = "<";
7737 } else {
7738 if (!$silence) {$this->fail(44);}
7739 $r5 = self::$FAILED;
7740 $this->currPos = $p3;
7741 $r2 = self::$FAILED;
7742 goto seq_1;
7743 }
7744 $r2 = true;
7745 seq_1:
7746 if ($r2!==self::$FAILED) {
7747 $r2 = substr($this->input, $p1, $this->currPos - $p1);
7748 } else {
7749 $r2 = self::$FAILED;
7750 }
7751 // free $p3
7752 // free $p1
7753 $this->cache[$bucket][$key] = new GrammarCacheEntry(
7754 $this->currPos,
7755 $r2,
7756 self::$UNDEFINED,
7757 self::$UNDEFINED
7758 );
7759 return $r2;
7760 }
7761 private function parseattribute_preprocessor_text_single($silence, $boolParams, &$param_preproc, &$param_th) {
7762 $key = json_encode([512, $boolParams & 0x3fff, $param_preproc, $param_th]);
7763 $bucket = $this->currPos;
7764 $cached = $this->cache[$bucket][$key] ?? null;
7765 if ($cached) {
7766 $this->currPos = $cached->nextPos;
7767 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
7768 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
7769 return $cached->result;
7770 }
7771 $saved_preproc=$param_preproc;
7772 $saved_th=$param_th;
7773 $p2 = $this->currPos;
7774 $r3 = [];
7775 for (;;) {
7776 // start choice_1
7777 $p5 = $this->currPos;
7778 $r4 = self::$FAILED;
7779 for (;;) {
7780 if (strcspn($this->input, "{}&<-|/'>", $this->currPos, 1) !== 0) {
7781 $r6 = self::consumeChar($this->input, $this->currPos);
7782 $r4 = true;
7783 } else {
7784 $r6 = self::$FAILED;
7785 if (!$silence) {$this->fail(49);}
7786 break;
7787 }
7788 }
7789 if ($r4!==self::$FAILED) {
7790 $r4 = substr($this->input, $p5, $this->currPos - $p5);
7791 goto choice_1;
7792 } else {
7793 $r4 = self::$FAILED;
7794 }
7795 // free $r6
7796 // free $p5
7797 $p5 = $this->currPos;
7798 // start seq_1
7799 $p7 = $this->currPos;
7800 $p8 = $this->currPos;
7801 $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
7802 if ($r6 === self::$FAILED) {
7803 $r6 = false;
7804 } else {
7805 $r6 = self::$FAILED;
7806 $this->currPos = $p8;
7807 $r4 = self::$FAILED;
7808 goto seq_1;
7809 }
7810 // free $p8
7811 $p8 = $this->currPos;
7812 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) {
7813 $r9 = "/>";
7814 $this->currPos += 2;
7815 } else {
7816 $r9 = self::$FAILED;
7817 }
7818 if ($r9 === self::$FAILED) {
7819 $r9 = false;
7820 } else {
7821 $r9 = self::$FAILED;
7822 $this->currPos = $p8;
7823 $this->currPos = $p7;
7824 $r4 = self::$FAILED;
7825 goto seq_1;
7826 }
7827 // free $p8
7828 // start choice_2
7829 $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th);
7830 if ($r10!==self::$FAILED) {
7831 goto choice_2;
7832 }
7833 $r10 = $this->parseless_than($silence, $boolParams);
7834 if ($r10!==self::$FAILED) {
7835 goto choice_2;
7836 }
7837 if (strspn($this->input, "{}&-|/", $this->currPos, 1) !== 0) {
7838 $r10 = $this->input[$this->currPos++];
7839 } else {
7840 $r10 = self::$FAILED;
7841 if (!$silence) {$this->fail(50);}
7842 }
7843 choice_2:
7844 // s <- $r10
7845 if ($r10===self::$FAILED) {
7846 $this->currPos = $p7;
7847 $r4 = self::$FAILED;
7848 goto seq_1;
7849 }
7850 $r4 = true;
7851 seq_1:
7852 if ($r4!==self::$FAILED) {
7853 $this->savedPos = $p5;
7854 $r4 = $this->a42($r10);
7855 }
7856 // free $p7
7857 choice_1:
7858 if ($r4!==self::$FAILED) {
7859 $r3[] = $r4;
7860 } else {
7861 break;
7862 }
7863 }
7864 // r <- $r3
7865 // free $r4
7866 $r1 = $r3;
7867 if ($r1!==self::$FAILED) {
7868 $this->savedPos = $p2;
7869 $r1 = $this->a59($r3);
7870 }
7871 $this->cache[$bucket][$key] = new GrammarCacheEntry(
7872 $this->currPos,
7873 $r1,
7874 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
7875 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
7876 );
7877 return $r1;
7878 }
7879 private function parseattribute_preprocessor_text_double($silence, $boolParams, &$param_preproc, &$param_th) {
7880 $key = json_encode([514, $boolParams & 0x3fff, $param_preproc, $param_th]);
7881 $bucket = $this->currPos;
7882 $cached = $this->cache[$bucket][$key] ?? null;
7883 if ($cached) {
7884 $this->currPos = $cached->nextPos;
7885 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
7886 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
7887 return $cached->result;
7888 }
7889 $saved_preproc=$param_preproc;
7890 $saved_th=$param_th;
7891 $p2 = $this->currPos;
7892 $r3 = [];
7893 for (;;) {
7894 // start choice_1
7895 $p5 = $this->currPos;
7896 $r4 = self::$FAILED;
7897 for (;;) {
7898 if (strcspn($this->input, "{}&<-|/\">", $this->currPos, 1) !== 0) {
7899 $r6 = self::consumeChar($this->input, $this->currPos);
7900 $r4 = true;
7901 } else {
7902 $r6 = self::$FAILED;
7903 if (!$silence) {$this->fail(51);}
7904 break;
7905 }
7906 }
7907 if ($r4!==self::$FAILED) {
7908 $r4 = substr($this->input, $p5, $this->currPos - $p5);
7909 goto choice_1;
7910 } else {
7911 $r4 = self::$FAILED;
7912 }
7913 // free $r6
7914 // free $p5
7915 $p5 = $this->currPos;
7916 // start seq_1
7917 $p7 = $this->currPos;
7918 $p8 = $this->currPos;
7919 $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
7920 if ($r6 === self::$FAILED) {
7921 $r6 = false;
7922 } else {
7923 $r6 = self::$FAILED;
7924 $this->currPos = $p8;
7925 $r4 = self::$FAILED;
7926 goto seq_1;
7927 }
7928 // free $p8
7929 $p8 = $this->currPos;
7930 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) {
7931 $r9 = "/>";
7932 $this->currPos += 2;
7933 } else {
7934 $r9 = self::$FAILED;
7935 }
7936 if ($r9 === self::$FAILED) {
7937 $r9 = false;
7938 } else {
7939 $r9 = self::$FAILED;
7940 $this->currPos = $p8;
7941 $this->currPos = $p7;
7942 $r4 = self::$FAILED;
7943 goto seq_1;
7944 }
7945 // free $p8
7946 // start choice_2
7947 $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th);
7948 if ($r10!==self::$FAILED) {
7949 goto choice_2;
7950 }
7951 $r10 = $this->parseless_than($silence, $boolParams);
7952 if ($r10!==self::$FAILED) {
7953 goto choice_2;
7954 }
7955 if (strspn($this->input, "{}&-|/", $this->currPos, 1) !== 0) {
7956 $r10 = $this->input[$this->currPos++];
7957 } else {
7958 $r10 = self::$FAILED;
7959 if (!$silence) {$this->fail(50);}
7960 }
7961 choice_2:
7962 // s <- $r10
7963 if ($r10===self::$FAILED) {
7964 $this->currPos = $p7;
7965 $r4 = self::$FAILED;
7966 goto seq_1;
7967 }
7968 $r4 = true;
7969 seq_1:
7970 if ($r4!==self::$FAILED) {
7971 $this->savedPos = $p5;
7972 $r4 = $this->a42($r10);
7973 }
7974 // free $p7
7975 choice_1:
7976 if ($r4!==self::$FAILED) {
7977 $r3[] = $r4;
7978 } else {
7979 break;
7980 }
7981 }
7982 // r <- $r3
7983 // free $r4
7984 $r1 = $r3;
7985 if ($r1!==self::$FAILED) {
7986 $this->savedPos = $p2;
7987 $r1 = $this->a59($r3);
7988 }
7989 $this->cache[$bucket][$key] = new GrammarCacheEntry(
7990 $this->currPos,
7991 $r1,
7992 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
7993 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
7994 );
7995 return $r1;
7996 }
7997 private function parseattribute_preprocessor_text($silence, $boolParams, &$param_preproc, &$param_th) {
7998 $key = json_encode([510, $boolParams & 0x3fff, $param_preproc, $param_th]);
7999 $bucket = $this->currPos;
8000 $cached = $this->cache[$bucket][$key] ?? null;
8001 if ($cached) {
8002 $this->currPos = $cached->nextPos;
8003 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
8004 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
8005 return $cached->result;
8006 }
8007 $saved_preproc=$param_preproc;
8008 $saved_th=$param_th;
8009 $p2 = $this->currPos;
8010 $r3 = [];
8011 for (;;) {
8012 // start choice_1
8013 $p5 = $this->currPos;
8014 $r4 = self::$FAILED;
8015 for (;;) {
8016 if (strcspn($this->input, "{}&<-|/ \x09\x0a\x0d\x0c>", $this->currPos, 1) !== 0) {
8017 $r6 = self::consumeChar($this->input, $this->currPos);
8018 $r4 = true;
8019 } else {
8020 $r6 = self::$FAILED;
8021 if (!$silence) {$this->fail(52);}
8022 break;
8023 }
8024 }
8025 if ($r4!==self::$FAILED) {
8026 $r4 = substr($this->input, $p5, $this->currPos - $p5);
8027 goto choice_1;
8028 } else {
8029 $r4 = self::$FAILED;
8030 }
8031 // free $r6
8032 // free $p5
8033 $p5 = $this->currPos;
8034 // start seq_1
8035 $p7 = $this->currPos;
8036 $p8 = $this->currPos;
8037 $r6 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
8038 if ($r6 === self::$FAILED) {
8039 $r6 = false;
8040 } else {
8041 $r6 = self::$FAILED;
8042 $this->currPos = $p8;
8043 $r4 = self::$FAILED;
8044 goto seq_1;
8045 }
8046 // free $p8
8047 $p8 = $this->currPos;
8048 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) {
8049 $r9 = "/>";
8050 $this->currPos += 2;
8051 } else {
8052 $r9 = self::$FAILED;
8053 }
8054 if ($r9 === self::$FAILED) {
8055 $r9 = false;
8056 } else {
8057 $r9 = self::$FAILED;
8058 $this->currPos = $p8;
8059 $this->currPos = $p7;
8060 $r4 = self::$FAILED;
8061 goto seq_1;
8062 }
8063 // free $p8
8064 // start choice_2
8065 $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th);
8066 if ($r10!==self::$FAILED) {
8067 goto choice_2;
8068 }
8069 $r10 = $this->parseless_than($silence, $boolParams);
8070 if ($r10!==self::$FAILED) {
8071 goto choice_2;
8072 }
8073 if (strspn($this->input, "{}&-|/", $this->currPos, 1) !== 0) {
8074 $r10 = $this->input[$this->currPos++];
8075 } else {
8076 $r10 = self::$FAILED;
8077 if (!$silence) {$this->fail(50);}
8078 }
8079 choice_2:
8080 // s <- $r10
8081 if ($r10===self::$FAILED) {
8082 $this->currPos = $p7;
8083 $r4 = self::$FAILED;
8084 goto seq_1;
8085 }
8086 $r4 = true;
8087 seq_1:
8088 if ($r4!==self::$FAILED) {
8089 $this->savedPos = $p5;
8090 $r4 = $this->a42($r10);
8091 }
8092 // free $p7
8093 choice_1:
8094 if ($r4!==self::$FAILED) {
8095 $r3[] = $r4;
8096 } else {
8097 break;
8098 }
8099 }
8100 if (count($r3) === 0) {
8101 $r3 = self::$FAILED;
8102 }
8103 // r <- $r3
8104 // free $r4
8105 $r1 = $r3;
8106 if ($r1!==self::$FAILED) {
8107 $this->savedPos = $p2;
8108 $r1 = $this->a59($r3);
8109 }
8110 $this->cache[$bucket][$key] = new GrammarCacheEntry(
8111 $this->currPos,
8112 $r1,
8113 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
8114 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
8115 );
8116 return $r1;
8117 }
8118 private function parseautolink($silence, $boolParams, &$param_preproc, &$param_th) {
8119 $key = json_encode([324, $boolParams & 0x3fff, $param_preproc, $param_th]);
8120 $bucket = $this->currPos;
8121 $cached = $this->cache[$bucket][$key] ?? null;
8122 if ($cached) {
8123 $this->currPos = $cached->nextPos;
8124 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
8125 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
8126 return $cached->result;
8127 }
8128 $saved_preproc=$param_preproc;
8129 $saved_th=$param_th;
8130 $p2 = $this->currPos;
8131 // start seq_1
8132 $p3 = $this->currPos;
8133 if (!(/*extlink*/($boolParams & 0x8) !== 0)) {
8134 $r4 = false;
8135 } else {
8136 $r4 = self::$FAILED;
8137 $r1 = self::$FAILED;
8138 goto seq_1;
8139 }
8140 $this->savedPos = $this->currPos;
8141 $r5 = $this->a79();
8142 if (!$r5) {
8143 $r5 = false;
8144 } else {
8145 $r5 = self::$FAILED;
8146 $this->currPos = $p3;
8147 $r1 = self::$FAILED;
8148 goto seq_1;
8149 }
8150 // start choice_1
8151 $r6 = $this->parseautourl($silence, $boolParams, $param_preproc, $param_th);
8152 if ($r6!==self::$FAILED) {
8153 goto choice_1;
8154 }
8155 $r6 = $this->parseautoref($silence);
8156 if ($r6!==self::$FAILED) {
8157 goto choice_1;
8158 }
8159 $r6 = $this->parseisbn($silence);
8160 choice_1:
8161 // r <- $r6
8162 if ($r6===self::$FAILED) {
8163 $this->currPos = $p3;
8164 $r1 = self::$FAILED;
8165 goto seq_1;
8166 }
8167 $r1 = true;
8168 seq_1:
8169 if ($r1!==self::$FAILED) {
8170 $this->savedPos = $p2;
8171 $r1 = $this->a24($r6);
8172 }
8173 // free $p3
8174 $this->cache[$bucket][$key] = new GrammarCacheEntry(
8175 $this->currPos,
8176 $r1,
8177 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
8178 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
8179 );
8180 return $r1;
8181 }
8182 private function parsebehavior_switch($silence) {
8183 $key = 320;
8184 $bucket = $this->currPos;
8185 $cached = $this->cache[$bucket][$key] ?? null;
8186 if ($cached) {
8187 $this->currPos = $cached->nextPos;
8188
8189 return $cached->result;
8190 }
8191
8192 $p2 = $this->currPos;
8193 $p4 = $this->currPos;
8194 // start seq_1
8195 $p5 = $this->currPos;
8196 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) {
8197 $r6 = "__";
8198 $this->currPos += 2;
8199 } else {
8200 if (!$silence) {$this->fail(53);}
8201 $r6 = self::$FAILED;
8202 $r3 = self::$FAILED;
8203 goto seq_1;
8204 }
8205 $r7 = $this->discardbehavior_text($silence);
8206 if ($r7===self::$FAILED) {
8207 $this->currPos = $p5;
8208 $r3 = self::$FAILED;
8209 goto seq_1;
8210 }
8211 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) {
8212 $r8 = "__";
8213 $this->currPos += 2;
8214 } else {
8215 if (!$silence) {$this->fail(53);}
8216 $r8 = self::$FAILED;
8217 $this->currPos = $p5;
8218 $r3 = self::$FAILED;
8219 goto seq_1;
8220 }
8221 $r3 = true;
8222 seq_1:
8223 // bs <- $r3
8224 if ($r3!==self::$FAILED) {
8225 $r3 = substr($this->input, $p4, $this->currPos - $p4);
8226 } else {
8227 $r3 = self::$FAILED;
8228 }
8229 // free $p5
8230 // free $p4
8231 $r1 = $r3;
8232 if ($r1!==self::$FAILED) {
8233 $this->savedPos = $p2;
8234 $r1 = $this->a80($r3);
8235 }
8236 $this->cache[$bucket][$key] = new GrammarCacheEntry(
8237 $this->currPos,
8238 $r1,
8239 self::$UNDEFINED,
8240 self::$UNDEFINED
8241 );
8242 return $r1;
8243 }
8244 private function parsetext_char($silence) {
8245 $key = 492;
8246 $bucket = $this->currPos;
8247 $cached = $this->cache[$bucket][$key] ?? null;
8248 if ($cached) {
8249 $this->currPos = $cached->nextPos;
8250
8251 return $cached->result;
8252 }
8253
8254 if (strcspn($this->input, "-'<[{\x0a\x0d:;]}|!=", $this->currPos, 1) !== 0) {
8255 $r1 = self::consumeChar($this->input, $this->currPos);
8256 } else {
8257 $r1 = self::$FAILED;
8258 if (!$silence) {$this->fail(54);}
8259 }
8260 $this->cache[$bucket][$key] = new GrammarCacheEntry(
8261 $this->currPos,
8262 $r1,
8263 self::$UNDEFINED,
8264 self::$UNDEFINED
8265 );
8266 return $r1;
8267 }
8268 private function parselang_variant_or_tpl($silence, $boolParams, &$param_th, &$param_preproc) {
8269 $key = json_encode([370, $boolParams & 0x3fff, $param_th, $param_preproc]);
8270 $bucket = $this->currPos;
8271 $cached = $this->cache[$bucket][$key] ?? null;
8272 if ($cached) {
8273 $this->currPos = $cached->nextPos;
8274 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
8275 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
8276 return $cached->result;
8277 }
8278 $saved_th=$param_th;
8279 $saved_preproc=$param_preproc;
8280 // start choice_1
8281 $p2 = $this->currPos;
8282 // start seq_1
8283 $p3 = $this->currPos;
8284 $p4 = $this->currPos;
8285 // start seq_2
8286 $p6 = $this->currPos;
8287 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) {
8288 $r7 = "-{";
8289 $this->currPos += 2;
8290 } else {
8291 $r7 = self::$FAILED;
8292 $r5 = self::$FAILED;
8293 goto seq_2;
8294 }
8295 $p8 = $this->currPos;
8296 // start seq_3
8297 $p10 = $this->currPos;
8298 $r11 = self::$FAILED;
8299 for (;;) {
8300 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) {
8301 $r12 = "{{{";
8302 $this->currPos += 3;
8303 $r11 = true;
8304 } else {
8305 $r12 = self::$FAILED;
8306 break;
8307 }
8308 }
8309 if ($r11===self::$FAILED) {
8310 $r9 = self::$FAILED;
8311 goto seq_3;
8312 }
8313 // free $r12
8314 $p13 = $this->currPos;
8315 if (($this->input[$this->currPos] ?? null) === "{") {
8316 $this->currPos++;
8317 $r12 = "{";
8318 } else {
8319 $r12 = self::$FAILED;
8320 }
8321 if ($r12 === self::$FAILED) {
8322 $r12 = false;
8323 } else {
8324 $r12 = self::$FAILED;
8325 $this->currPos = $p13;
8326 $this->currPos = $p10;
8327 $r9 = self::$FAILED;
8328 goto seq_3;
8329 }
8330 // free $p13
8331 $r9 = true;
8332 seq_3:
8333 if ($r9!==self::$FAILED) {
8334 $r9 = false;
8335 $this->currPos = $p8;
8336 } else {
8337 $this->currPos = $p6;
8338 $r5 = self::$FAILED;
8339 goto seq_2;
8340 }
8341 // free $p10
8342 // free $p8
8343 $r14 = $this->discardtplarg(true, $boolParams, $param_th);
8344 if ($r14===self::$FAILED) {
8345 $this->currPos = $p6;
8346 $r5 = self::$FAILED;
8347 goto seq_2;
8348 }
8349 $r5 = true;
8350 seq_2:
8351 if ($r5!==self::$FAILED) {
8352 $r5 = false;
8353 $this->currPos = $p4;
8354 } else {
8355 $r1 = self::$FAILED;
8356 goto seq_1;
8357 }
8358 // free $p6
8359 // free $p4
8360 $r15 = $this->parselang_variant($silence, $boolParams, $param_th, $param_preproc);
8361 // a <- $r15
8362 if ($r15===self::$FAILED) {
8363 $this->currPos = $p3;
8364 $r1 = self::$FAILED;
8365 goto seq_1;
8366 }
8367 $r1 = true;
8368 seq_1:
8369 if ($r1!==self::$FAILED) {
8370 $this->savedPos = $p2;
8371 $r1 = $this->a50($r15);
8372 goto choice_1;
8373 }
8374 // free $p3
8375 $p3 = $this->currPos;
8376 // start seq_4
8377 $p4 = $this->currPos;
8378 $p6 = $this->currPos;
8379 // start seq_5
8380 $p8 = $this->currPos;
8381 if (($this->input[$this->currPos] ?? null) === "-") {
8382 $this->currPos++;
8383 $r17 = "-";
8384 } else {
8385 if (!$silence) {$this->fail(55);}
8386 $r17 = self::$FAILED;
8387 $r16 = self::$FAILED;
8388 goto seq_5;
8389 }
8390 $p10 = $this->currPos;
8391 // start seq_6
8392 $p13 = $this->currPos;
8393 $r19 = self::$FAILED;
8394 for (;;) {
8395 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) {
8396 $r20 = "{{{";
8397 $this->currPos += 3;
8398 $r19 = true;
8399 } else {
8400 $r20 = self::$FAILED;
8401 break;
8402 }
8403 }
8404 if ($r19===self::$FAILED) {
8405 $r18 = self::$FAILED;
8406 goto seq_6;
8407 }
8408 // free $r20
8409 $p21 = $this->currPos;
8410 if (($this->input[$this->currPos] ?? null) === "{") {
8411 $this->currPos++;
8412 $r20 = "{";
8413 } else {
8414 $r20 = self::$FAILED;
8415 }
8416 if ($r20 === self::$FAILED) {
8417 $r20 = false;
8418 } else {
8419 $r20 = self::$FAILED;
8420 $this->currPos = $p21;
8421 $this->currPos = $p13;
8422 $r18 = self::$FAILED;
8423 goto seq_6;
8424 }
8425 // free $p21
8426 $r18 = true;
8427 seq_6:
8428 if ($r18!==self::$FAILED) {
8429 $r18 = false;
8430 $this->currPos = $p10;
8431 } else {
8432 $this->currPos = $p8;
8433 $r16 = self::$FAILED;
8434 goto seq_5;
8435 }
8436 // free $p13
8437 // free $p10
8438 $r16 = true;
8439 seq_5:
8440 // a <- $r16
8441 if ($r16!==self::$FAILED) {
8442 $r16 = substr($this->input, $p6, $this->currPos - $p6);
8443 } else {
8444 $r16 = self::$FAILED;
8445 $r1 = self::$FAILED;
8446 goto seq_4;
8447 }
8448 // free $p8
8449 // free $p6
8450 $r22 = $this->parsetplarg($silence, $boolParams, $param_th);
8451 // b <- $r22
8452 if ($r22===self::$FAILED) {
8453 $this->currPos = $p4;
8454 $r1 = self::$FAILED;
8455 goto seq_4;
8456 }
8457 $r1 = true;
8458 seq_4:
8459 if ($r1!==self::$FAILED) {
8460 $this->savedPos = $p3;
8461 $r1 = $this->a51($r16, $r22);
8462 goto choice_1;
8463 }
8464 // free $p4
8465 $p4 = $this->currPos;
8466 // start seq_7
8467 $p6 = $this->currPos;
8468 $p8 = $this->currPos;
8469 // start seq_8
8470 $p10 = $this->currPos;
8471 if (($this->input[$this->currPos] ?? null) === "-") {
8472 $this->currPos++;
8473 $r24 = "-";
8474 } else {
8475 if (!$silence) {$this->fail(55);}
8476 $r24 = self::$FAILED;
8477 $r23 = self::$FAILED;
8478 goto seq_8;
8479 }
8480 $p13 = $this->currPos;
8481 // start seq_9
8482 $p21 = $this->currPos;
8483 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) {
8484 $r26 = "{{";
8485 $this->currPos += 2;
8486 } else {
8487 $r26 = self::$FAILED;
8488 $r25 = self::$FAILED;
8489 goto seq_9;
8490 }
8491 for (;;) {
8492 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) {
8493 $r28 = "{{{";
8494 $this->currPos += 3;
8495 } else {
8496 $r28 = self::$FAILED;
8497 break;
8498 }
8499 }
8500 // free $r28
8501 $r27 = true;
8502 if ($r27===self::$FAILED) {
8503 $this->currPos = $p21;
8504 $r25 = self::$FAILED;
8505 goto seq_9;
8506 }
8507 // free $r27
8508 $p29 = $this->currPos;
8509 if (($this->input[$this->currPos] ?? null) === "{") {
8510 $this->currPos++;
8511 $r27 = "{";
8512 } else {
8513 $r27 = self::$FAILED;
8514 }
8515 if ($r27 === self::$FAILED) {
8516 $r27 = false;
8517 } else {
8518 $r27 = self::$FAILED;
8519 $this->currPos = $p29;
8520 $this->currPos = $p21;
8521 $r25 = self::$FAILED;
8522 goto seq_9;
8523 }
8524 // free $p29
8525 $r25 = true;
8526 seq_9:
8527 if ($r25!==self::$FAILED) {
8528 $r25 = false;
8529 $this->currPos = $p13;
8530 } else {
8531 $this->currPos = $p10;
8532 $r23 = self::$FAILED;
8533 goto seq_8;
8534 }
8535 // free $p21
8536 // free $p13
8537 $r23 = true;
8538 seq_8:
8539 // a <- $r23
8540 if ($r23!==self::$FAILED) {
8541 $r23 = substr($this->input, $p8, $this->currPos - $p8);
8542 } else {
8543 $r23 = self::$FAILED;
8544 $r1 = self::$FAILED;
8545 goto seq_7;
8546 }
8547 // free $p10
8548 // free $p8
8549 $r28 = $this->parsetemplate($silence, $boolParams, $param_th);
8550 // b <- $r28
8551 if ($r28===self::$FAILED) {
8552 $this->currPos = $p6;
8553 $r1 = self::$FAILED;
8554 goto seq_7;
8555 }
8556 $r1 = true;
8557 seq_7:
8558 if ($r1!==self::$FAILED) {
8559 $this->savedPos = $p4;
8560 $r1 = $this->a51($r23, $r28);
8561 goto choice_1;
8562 }
8563 // free $p6
8564 $p6 = $this->currPos;
8565 // start seq_10
8566 $p8 = $this->currPos;
8567 $p10 = $this->currPos;
8568 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) {
8569 $r30 = "-{";
8570 $this->currPos += 2;
8571 $r30 = false;
8572 $this->currPos = $p10;
8573 } else {
8574 $r30 = self::$FAILED;
8575 $r1 = self::$FAILED;
8576 goto seq_10;
8577 }
8578 // free $p10
8579 $r31 = $this->parselang_variant($silence, $boolParams, $param_th, $param_preproc);
8580 // a <- $r31
8581 if ($r31===self::$FAILED) {
8582 $this->currPos = $p8;
8583 $r1 = self::$FAILED;
8584 goto seq_10;
8585 }
8586 $r1 = true;
8587 seq_10:
8588 if ($r1!==self::$FAILED) {
8589 $this->savedPos = $p6;
8590 $r1 = $this->a50($r31);
8591 }
8592 // free $p8
8593 choice_1:
8594 $this->cache[$bucket][$key] = new GrammarCacheEntry(
8595 $this->currPos,
8596 $r1,
8597 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
8598 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
8599 );
8600 return $r1;
8601 }
8602 private function parsewikilink($silence, $boolParams, &$param_th, &$param_preproc) {
8603 $key = json_encode([402, $boolParams & 0x3fff, $param_th, $param_preproc]);
8604 $bucket = $this->currPos;
8605 $cached = $this->cache[$bucket][$key] ?? null;
8606 if ($cached) {
8607 $this->currPos = $cached->nextPos;
8608 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
8609 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
8610 return $cached->result;
8611 }
8612 $saved_th=$param_th;
8613 $saved_preproc=$param_preproc;
8614 // start choice_1
8615 $r1 = $this->parsewikilink_preproc($silence, $boolParams, self::newRef("]]"), $param_th);
8616 if ($r1!==self::$FAILED) {
8617 goto choice_1;
8618 }
8619 $r1 = $this->parsebroken_wikilink($silence, $boolParams, $param_preproc, $param_th);
8620 choice_1:
8621 $this->cache[$bucket][$key] = new GrammarCacheEntry(
8622 $this->currPos,
8623 $r1,
8624 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
8625 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
8626 );
8627 return $r1;
8628 }
8629 private function parsequote($silence) {
8630 $key = 412;
8631 $bucket = $this->currPos;
8632 $cached = $this->cache[$bucket][$key] ?? null;
8633 if ($cached) {
8634 $this->currPos = $cached->nextPos;
8635
8636 return $cached->result;
8637 }
8638
8639 $p2 = $this->currPos;
8640 $p4 = $this->currPos;
8641 // start seq_1
8642 $p5 = $this->currPos;
8643 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "''", $this->currPos, 2, false) === 0) {
8644 $r6 = "''";
8645 $this->currPos += 2;
8646 } else {
8647 if (!$silence) {$this->fail(56);}
8648 $r6 = self::$FAILED;
8649 $r3 = self::$FAILED;
8650 goto seq_1;
8651 }
8652 for (;;) {
8653 if (($this->input[$this->currPos] ?? null) === "'") {
8654 $this->currPos++;
8655 $r8 = "'";
8656 } else {
8657 if (!$silence) {$this->fail(33);}
8658 $r8 = self::$FAILED;
8659 break;
8660 }
8661 }
8662 // free $r8
8663 $r7 = true;
8664 if ($r7===self::$FAILED) {
8665 $this->currPos = $p5;
8666 $r3 = self::$FAILED;
8667 goto seq_1;
8668 }
8669 // free $r7
8670 $r3 = true;
8671 seq_1:
8672 // quotes <- $r3
8673 if ($r3!==self::$FAILED) {
8674 $r3 = substr($this->input, $p4, $this->currPos - $p4);
8675 } else {
8676 $r3 = self::$FAILED;
8677 }
8678 // free $p5
8679 // free $p4
8680 $r1 = $r3;
8681 if ($r1!==self::$FAILED) {
8682 $this->savedPos = $p2;
8683 $r1 = $this->a81($r3);
8684 }
8685 $this->cache[$bucket][$key] = new GrammarCacheEntry(
8686 $this->currPos,
8687 $r1,
8688 self::$UNDEFINED,
8689 self::$UNDEFINED
8690 );
8691 return $r1;
8692 }
8693 private function parseinlineline_break_on_colon($silence, $boolParams, &$param_preproc, &$param_th) {
8694 $key = json_encode([458, $boolParams & 0x2fff, $param_preproc, $param_th]);
8695 $bucket = $this->currPos;
8696 $cached = $this->cache[$bucket][$key] ?? null;
8697 if ($cached) {
8698 $this->currPos = $cached->nextPos;
8699 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
8700 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
8701 return $cached->result;
8702 }
8703 $saved_preproc=$param_preproc;
8704 $saved_th=$param_th;
8705 $r1 = $this->parseinlineline($silence, $boolParams | 0x1000, $param_preproc, $param_th);
8706 $this->cache[$bucket][$key] = new GrammarCacheEntry(
8707 $this->currPos,
8708 $r1,
8709 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
8710 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
8711 );
8712 return $r1;
8713 }
8714 private function parsetable_content_line($silence, $boolParams, &$param_preproc, &$param_th) {
8715 $key = json_encode([466, $boolParams & 0x3fff, $param_preproc, $param_th]);
8716 $bucket = $this->currPos;
8717 $cached = $this->cache[$bucket][$key] ?? null;
8718 if ($cached) {
8719 $this->currPos = $cached->nextPos;
8720 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
8721 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
8722 return $cached->result;
8723 }
8724 $saved_preproc=$param_preproc;
8725 $saved_th=$param_th;
8726 // start seq_1
8727 $p1 = $this->currPos;
8728 $r3 = [];
8729 for (;;) {
8730 // start choice_1
8731 $r4 = $this->parsespace($silence);
8732 if ($r4!==self::$FAILED) {
8733 goto choice_1;
8734 }
8735 $r4 = $this->parsecomment($silence);
8736 choice_1:
8737 if ($r4!==self::$FAILED) {
8738 $r3[] = $r4;
8739 } else {
8740 break;
8741 }
8742 }
8743 // free $r4
8744 // start choice_2
8745 $r4 = $this->parsetable_heading_tags($silence, $boolParams, $param_preproc);
8746 if ($r4!==self::$FAILED) {
8747 goto choice_2;
8748 }
8749 $r4 = $this->parsetable_row_tag($silence, $boolParams, $param_preproc, $param_th);
8750 if ($r4!==self::$FAILED) {
8751 goto choice_2;
8752 }
8753 $r4 = $this->parsetable_data_tags($silence, $boolParams, $param_preproc, $param_th);
8754 if ($r4!==self::$FAILED) {
8755 goto choice_2;
8756 }
8757 $r4 = $this->parsetable_caption_tag($silence, $boolParams, $param_preproc, $param_th);
8758 choice_2:
8759 if ($r4===self::$FAILED) {
8760 $this->currPos = $p1;
8761 $r2 = self::$FAILED;
8762 goto seq_1;
8763 }
8764 $r2 = [$r3,$r4];
8765 seq_1:
8766 // free $r2,$p1
8767 $this->cache[$bucket][$key] = new GrammarCacheEntry(
8768 $this->currPos,
8769 $r2,
8770 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
8771 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
8772 );
8773 return $r2;
8774 }
8775 private function parsetable_end_tag($silence) {
8776 $key = 488;
8777 $bucket = $this->currPos;
8778 $cached = $this->cache[$bucket][$key] ?? null;
8779 if ($cached) {
8780 $this->currPos = $cached->nextPos;
8781
8782 return $cached->result;
8783 }
8784
8785 $p2 = $this->currPos;
8786 // start seq_1
8787 $p3 = $this->currPos;
8788 $r4 = [];
8789 for (;;) {
8790 // start choice_1
8791 $r5 = $this->parsespace($silence);
8792 if ($r5!==self::$FAILED) {
8793 goto choice_1;
8794 }
8795 $r5 = $this->parsecomment($silence);
8796 choice_1:
8797 if ($r5!==self::$FAILED) {
8798 $r4[] = $r5;
8799 } else {
8800 break;
8801 }
8802 }
8803 // sc <- $r4
8804 // free $r5
8805 $p6 = $this->currPos;
8806 $r5 = '';
8807 // startPos <- $r5
8808 if ($r5!==self::$FAILED) {
8809 $this->savedPos = $p6;
8810 $r5 = $this->a5($r4);
8811 } else {
8812 $this->currPos = $p3;
8813 $r1 = self::$FAILED;
8814 goto seq_1;
8815 }
8816 $r7 = $this->parsepipe($silence);
8817 // p <- $r7
8818 if ($r7===self::$FAILED) {
8819 $this->currPos = $p3;
8820 $r1 = self::$FAILED;
8821 goto seq_1;
8822 }
8823 // b <- $r8
8824 if (($this->input[$this->currPos] ?? null) === "}") {
8825 $this->currPos++;
8826 $r8 = "}";
8827 } else {
8828 if (!$silence) {$this->fail(57);}
8829 $r8 = self::$FAILED;
8830 $this->currPos = $p3;
8831 $r1 = self::$FAILED;
8832 goto seq_1;
8833 }
8834 $r1 = true;
8835 seq_1:
8836 if ($r1!==self::$FAILED) {
8837 $this->savedPos = $p2;
8838 $r1 = $this->a82($r4, $r5, $r7, $r8);
8839 }
8840 // free $p3
8841 $this->cache[$bucket][$key] = new GrammarCacheEntry(
8842 $this->currPos,
8843 $r1,
8844 self::$UNDEFINED,
8845 self::$UNDEFINED
8846 );
8847 return $r1;
8848 }
8849 private function parseempty_line_with_comments($silence) {
8850 $key = 562;
8851 $bucket = $this->currPos;
8852 $cached = $this->cache[$bucket][$key] ?? null;
8853 if ($cached) {
8854 $this->currPos = $cached->nextPos;
8855
8856 return $cached->result;
8857 }
8858
8859 $p2 = $this->currPos;
8860 // start seq_1
8861 $p3 = $this->currPos;
8862 $r4 = $this->parsesol_prefix($silence);
8863 // sp <- $r4
8864 if ($r4===self::$FAILED) {
8865 $r1 = self::$FAILED;
8866 goto seq_1;
8867 }
8868 $p6 = $this->currPos;
8869 $r5 = '';
8870 // p <- $r5
8871 if ($r5!==self::$FAILED) {
8872 $this->savedPos = $p6;
8873 $r5 = $this->a83($r4);
8874 } else {
8875 $this->currPos = $p3;
8876 $r1 = self::$FAILED;
8877 goto seq_1;
8878 }
8879 $r7 = [];
8880 for (;;) {
8881 // start seq_2
8882 $p9 = $this->currPos;
8883 $r10 = [];
8884 for (;;) {
8885 $r11 = $this->parsespace($silence);
8886 if ($r11!==self::$FAILED) {
8887 $r10[] = $r11;
8888 } else {
8889 break;
8890 }
8891 }
8892 // free $r11
8893 $r11 = $this->parsecomment($silence);
8894 if ($r11===self::$FAILED) {
8895 $this->currPos = $p9;
8896 $r8 = self::$FAILED;
8897 goto seq_2;
8898 }
8899 $r12 = [];
8900 for (;;) {
8901 // start choice_1
8902 $r13 = $this->parsespace($silence);
8903 if ($r13!==self::$FAILED) {
8904 goto choice_1;
8905 }
8906 $r13 = $this->parsecomment($silence);
8907 choice_1:
8908 if ($r13!==self::$FAILED) {
8909 $r12[] = $r13;
8910 } else {
8911 break;
8912 }
8913 }
8914 // free $r13
8915 $r13 = $this->parsenewline($silence);
8916 if ($r13===self::$FAILED) {
8917 $this->currPos = $p9;
8918 $r8 = self::$FAILED;
8919 goto seq_2;
8920 }
8921 $r8 = [$r10,$r11,$r12,$r13];
8922 seq_2:
8923 if ($r8!==self::$FAILED) {
8924 $r7[] = $r8;
8925 } else {
8926 break;
8927 }
8928 // free $p9
8929 }
8930 if (count($r7) === 0) {
8931 $r7 = self::$FAILED;
8932 }
8933 // c <- $r7
8934 if ($r7===self::$FAILED) {
8935 $this->currPos = $p3;
8936 $r1 = self::$FAILED;
8937 goto seq_1;
8938 }
8939 // free $r8
8940 $r1 = true;
8941 seq_1:
8942 if ($r1!==self::$FAILED) {
8943 $this->savedPos = $p2;
8944 $r1 = $this->a84($r4, $r5, $r7);
8945 }
8946 // free $p3
8947 $this->cache[$bucket][$key] = new GrammarCacheEntry(
8948 $this->currPos,
8949 $r1,
8950 self::$UNDEFINED,
8951 self::$UNDEFINED
8952 );
8953 return $r1;
8954 }
8955 private function parsesol_prefix($silence) {
8956 $key = 560;
8957 $bucket = $this->currPos;
8958 $cached = $this->cache[$bucket][$key] ?? null;
8959 if ($cached) {
8960 $this->currPos = $cached->nextPos;
8961
8962 return $cached->result;
8963 }
8964
8965 // start choice_1
8966 $r1 = $this->parsenewlineToken($silence);
8967 if ($r1!==self::$FAILED) {
8968 goto choice_1;
8969 }
8970 $p2 = $this->currPos;
8971 $this->savedPos = $this->currPos;
8972 $r1 = $this->a85();
8973 if ($r1) {
8974 $r1 = false;
8975 $this->savedPos = $p2;
8976 $r1 = $this->a86();
8977 } else {
8978 $r1 = self::$FAILED;
8979 }
8980 choice_1:
8981 $this->cache[$bucket][$key] = new GrammarCacheEntry(
8982 $this->currPos,
8983 $r1,
8984 self::$UNDEFINED,
8985 self::$UNDEFINED
8986 );
8987 return $r1;
8988 }
8989 private function parseredirect_word($silence) {
8990 $key = 294;
8991 $bucket = $this->currPos;
8992 $cached = $this->cache[$bucket][$key] ?? null;
8993 if ($cached) {
8994 $this->currPos = $cached->nextPos;
8995
8996 return $cached->result;
8997 }
8998
8999 $p1 = $this->currPos;
9000 // start seq_1
9001 $p3 = $this->currPos;
9002 for (;;) {
9003 if (strspn($this->input, " \x09\x0a\x0d\x00\x0b", $this->currPos, 1) !== 0) {
9004 $r5 = $this->input[$this->currPos++];
9005 } else {
9006 $r5 = self::$FAILED;
9007 if (!$silence) {$this->fail(58);}
9008 break;
9009 }
9010 }
9011 // free $r5
9012 $r4 = true;
9013 if ($r4===self::$FAILED) {
9014 $r2 = self::$FAILED;
9015 goto seq_1;
9016 }
9017 // free $r4
9018 $p6 = $this->currPos;
9019 $r4 = self::$FAILED;
9020 for (;;) {
9021 // start seq_2
9022 $p7 = $this->currPos;
9023 $p8 = $this->currPos;
9024 $r9 = $this->discardspace_or_newline(true);
9025 if ($r9 === self::$FAILED) {
9026 $r9 = false;
9027 } else {
9028 $r9 = self::$FAILED;
9029 $this->currPos = $p8;
9030 $r5 = self::$FAILED;
9031 goto seq_2;
9032 }
9033 // free $p8
9034 $p8 = $this->currPos;
9035 $r10 = $this->input[$this->currPos] ?? '';
9036 if ($r10 === ":" || $r10 === "[") {
9037 $this->currPos++;
9038 } else {
9039 $r10 = self::$FAILED;
9040 }
9041 if ($r10 === self::$FAILED) {
9042 $r10 = false;
9043 } else {
9044 $r10 = self::$FAILED;
9045 $this->currPos = $p8;
9046 $this->currPos = $p7;
9047 $r5 = self::$FAILED;
9048 goto seq_2;
9049 }
9050 // free $p8
9051 if ($this->currPos < $this->inputLength) {
9052 $r11 = self::consumeChar($this->input, $this->currPos);;
9053 } else {
9054 $r11 = self::$FAILED;
9055 if (!$silence) {$this->fail(7);}
9056 $this->currPos = $p7;
9057 $r5 = self::$FAILED;
9058 goto seq_2;
9059 }
9060 $r5 = true;
9061 seq_2:
9062 if ($r5!==self::$FAILED) {
9063 $r4 = true;
9064 } else {
9065 break;
9066 }
9067 // free $p7
9068 }
9069 // rw <- $r4
9070 if ($r4!==self::$FAILED) {
9071 $r4 = substr($this->input, $p6, $this->currPos - $p6);
9072 } else {
9073 $r4 = self::$FAILED;
9074 $this->currPos = $p3;
9075 $r2 = self::$FAILED;
9076 goto seq_1;
9077 }
9078 // free $r5
9079 // free $p6
9080 $this->savedPos = $this->currPos;
9081 $r5 = $this->a87($r4);
9082 if ($r5) {
9083 $r5 = false;
9084 } else {
9085 $r5 = self::$FAILED;
9086 $this->currPos = $p3;
9087 $r2 = self::$FAILED;
9088 goto seq_1;
9089 }
9090 $r2 = true;
9091 seq_1:
9092 if ($r2!==self::$FAILED) {
9093 $r2 = substr($this->input, $p1, $this->currPos - $p1);
9094 } else {
9095 $r2 = self::$FAILED;
9096 }
9097 // free $p3
9098 // free $p1
9099 $this->cache[$bucket][$key] = new GrammarCacheEntry(
9100 $this->currPos,
9101 $r2,
9102 self::$UNDEFINED,
9103 self::$UNDEFINED
9104 );
9105 return $r2;
9106 }
9107 private function parseinclude_limits($silence, $boolParams, &$param_preproc, &$param_th) {
9108 $key = json_encode([500, $boolParams & 0x3ebd, $param_preproc, $param_th]);
9109 $bucket = $this->currPos;
9110 $cached = $this->cache[$bucket][$key] ?? null;
9111 if ($cached) {
9112 $this->currPos = $cached->nextPos;
9113 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
9114 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
9115 return $cached->result;
9116 }
9117 $saved_preproc=$param_preproc;
9118 $saved_th=$param_th;
9119 $p2 = $this->currPos;
9120 // start seq_1
9121 $p3 = $this->currPos;
9122 $p4 = $this->currPos;
9123 // start seq_2
9124 $p6 = $this->currPos;
9125 if (($this->input[$this->currPos] ?? null) === "<") {
9126 $this->currPos++;
9127 $r7 = "<";
9128 } else {
9129 $r7 = self::$FAILED;
9130 $r5 = self::$FAILED;
9131 goto seq_2;
9132 }
9133 if (($this->input[$this->currPos] ?? null) === "/") {
9134 $this->currPos++;
9135 $r8 = "/";
9136 } else {
9137 $r8 = self::$FAILED;
9138 $r8 = null;
9139 }
9140 // start choice_1
9141 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "includeonly", $this->currPos, 11, true) === 0) {
9142 $r9 = substr($this->input, $this->currPos, 11);
9143 $this->currPos += 11;
9144 goto choice_1;
9145 } else {
9146 $r9 = self::$FAILED;
9147 }
9148 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "noinclude", $this->currPos, 9, true) === 0) {
9149 $r9 = substr($this->input, $this->currPos, 9);
9150 $this->currPos += 9;
9151 goto choice_1;
9152 } else {
9153 $r9 = self::$FAILED;
9154 }
9155 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "onlyinclude", $this->currPos, 11, true) === 0) {
9156 $r9 = substr($this->input, $this->currPos, 11);
9157 $this->currPos += 11;
9158 } else {
9159 $r9 = self::$FAILED;
9160 }
9161 choice_1:
9162 if ($r9===self::$FAILED) {
9163 $this->currPos = $p6;
9164 $r5 = self::$FAILED;
9165 goto seq_2;
9166 }
9167 $r5 = true;
9168 seq_2:
9169 if ($r5!==self::$FAILED) {
9170 $r5 = false;
9171 $this->currPos = $p4;
9172 } else {
9173 $r1 = self::$FAILED;
9174 goto seq_1;
9175 }
9176 // free $p6
9177 // free $p4
9178 if (($this->input[$this->currPos] ?? null) === "<") {
9179 $this->currPos++;
9180 $r10 = "<";
9181 } else {
9182 if (!$silence) {$this->fail(44);}
9183 $r10 = self::$FAILED;
9184 $this->currPos = $p3;
9185 $r1 = self::$FAILED;
9186 goto seq_1;
9187 }
9188 $r11 = $this->parsexmlish_tag($silence, $boolParams | 0x2, $param_preproc, $param_th);
9189 // il <- $r11
9190 if ($r11===self::$FAILED) {
9191 $this->currPos = $p3;
9192 $r1 = self::$FAILED;
9193 goto seq_1;
9194 }
9195 $this->savedPos = $this->currPos;
9196 $r12 = $this->a88($r11, /*sol_il*/($boolParams & 0x2000) !== 0);
9197 if ($r12) {
9198 $r12 = false;
9199 } else {
9200 $r12 = self::$FAILED;
9201 $this->currPos = $p3;
9202 $r1 = self::$FAILED;
9203 goto seq_1;
9204 }
9205 $r1 = true;
9206 seq_1:
9207 if ($r1!==self::$FAILED) {
9208 $this->savedPos = $p2;
9209 $r1 = $this->a89($r11, /*sol_il*/($boolParams & 0x2000) !== 0);
9210 }
9211 // free $p3
9212 $this->cache[$bucket][$key] = new GrammarCacheEntry(
9213 $this->currPos,
9214 $r1,
9215 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
9216 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
9217 );
9218 return $r1;
9219 }
9220 private function parseannotation_tag($silence, $boolParams, &$param_preproc, &$param_th) {
9221 $key = json_encode([416, $boolParams & 0x3ebf, $param_preproc, $param_th]);
9222 $bucket = $this->currPos;
9223 $cached = $this->cache[$bucket][$key] ?? null;
9224 if ($cached) {
9225 $this->currPos = $cached->nextPos;
9226 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
9227 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
9228 return $cached->result;
9229 }
9230 $saved_preproc=$param_preproc;
9231 $saved_th=$param_th;
9232 $p2 = $this->currPos;
9233 // start seq_1
9234 $p3 = $this->currPos;
9235 $r4 = $this->parseextension_annotation_tag($silence, $boolParams, $param_preproc, $param_th);
9236 // annToken <- $r4
9237 if ($r4===self::$FAILED) {
9238 $r1 = self::$FAILED;
9239 goto seq_1;
9240 }
9241 $this->savedPos = $this->currPos;
9242 $r5 = $this->a90($r4);
9243 if ($r5) {
9244 $r5 = false;
9245 } else {
9246 $r5 = self::$FAILED;
9247 $this->currPos = $p3;
9248 $r1 = self::$FAILED;
9249 goto seq_1;
9250 }
9251 $r1 = true;
9252 seq_1:
9253 if ($r1!==self::$FAILED) {
9254 $this->savedPos = $p2;
9255 $r1 = $this->a91($r4);
9256 }
9257 // free $p3
9258 $this->cache[$bucket][$key] = new GrammarCacheEntry(
9259 $this->currPos,
9260 $r1,
9261 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
9262 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
9263 );
9264 return $r1;
9265 }
9266 private function parseheading($silence, $boolParams, &$param_preproc, &$param_th) {
9267 $key = json_encode([318, $boolParams & 0x3fff, $param_preproc, $param_th]);
9268 $bucket = $this->currPos;
9269 $cached = $this->cache[$bucket][$key] ?? null;
9270 if ($cached) {
9271 $this->currPos = $cached->nextPos;
9272 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
9273 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
9274 return $cached->result;
9275 }
9276 $saved_preproc=$param_preproc;
9277 $saved_th=$param_th;
9278 $p2 = $this->currPos;
9279 // start seq_1
9280 $p3 = $this->currPos;
9281 $p4 = $this->currPos;
9282 if (($this->input[$this->currPos] ?? null) === "=") {
9283 $this->currPos++;
9284 $r5 = "=";
9285 $r5 = false;
9286 $this->currPos = $p4;
9287 } else {
9288 $r5 = self::$FAILED;
9289 $r1 = self::$FAILED;
9290 goto seq_1;
9291 }
9292 // free $p4
9293 $p4 = $this->currPos;
9294 // start seq_2
9295 $p7 = $this->currPos;
9296 $p9 = $this->currPos;
9297 $r8 = self::$FAILED;
9298 for (;;) {
9299 if (($this->input[$this->currPos] ?? null) === "=") {
9300 $this->currPos++;
9301 $r10 = "=";
9302 $r8 = true;
9303 } else {
9304 if (!$silence) {$this->fail(23);}
9305 $r10 = self::$FAILED;
9306 break;
9307 }
9308 }
9309 // s <- $r8
9310 if ($r8!==self::$FAILED) {
9311 $r8 = substr($this->input, $p9, $this->currPos - $p9);
9312 } else {
9313 $r8 = self::$FAILED;
9314 $r6 = self::$FAILED;
9315 goto seq_2;
9316 }
9317 // free $r10
9318 // free $p9
9319 // start seq_3
9320 $p9 = $this->currPos;
9321 $p12 = $this->currPos;
9322 $r13 = $this->parseinlineline($silence, $boolParams | 0x4, $param_preproc, $param_th);
9323 if ($r13===self::$FAILED) {
9324 $r13 = null;
9325 }
9326 // ill <- $r13
9327 $r11 = $r13;
9328 if ($r11!==self::$FAILED) {
9329 $this->savedPos = $p12;
9330 $r11 = $this->a92($r8, $r13);
9331 } else {
9332 $r10 = self::$FAILED;
9333 goto seq_3;
9334 }
9335 $p14 = $this->currPos;
9336 $r15 = self::$FAILED;
9337 for (;;) {
9338 if (($this->input[$this->currPos] ?? null) === "=") {
9339 $this->currPos++;
9340 $r16 = "=";
9341 $r15 = true;
9342 } else {
9343 if (!$silence) {$this->fail(23);}
9344 $r16 = self::$FAILED;
9345 break;
9346 }
9347 }
9348 if ($r15!==self::$FAILED) {
9349 $r15 = substr($this->input, $p14, $this->currPos - $p14);
9350 } else {
9351 $r15 = self::$FAILED;
9352 $this->currPos = $p9;
9353 $r10 = self::$FAILED;
9354 goto seq_3;
9355 }
9356 // free $r16
9357 // free $p14
9358 $r10 = [$r11,$r15];
9359 seq_3:
9360 if ($r10===self::$FAILED) {
9361 $r10 = null;
9362 }
9363 // free $p9
9364 // ce <- $r10
9365 $this->savedPos = $this->currPos;
9366 $r16 = $this->a93($r8, $r10);
9367 if ($r16) {
9368 $r16 = false;
9369 } else {
9370 $r16 = self::$FAILED;
9371 $this->currPos = $p7;
9372 $r6 = self::$FAILED;
9373 goto seq_2;
9374 }
9375 $p9 = $this->currPos;
9376 $r17 = '';
9377 // endTPos <- $r17
9378 if ($r17!==self::$FAILED) {
9379 $this->savedPos = $p9;
9380 $r17 = $this->a94($r8, $r10);
9381 } else {
9382 $this->currPos = $p7;
9383 $r6 = self::$FAILED;
9384 goto seq_2;
9385 }
9386 $r18 = [];
9387 for (;;) {
9388 // start choice_1
9389 $r19 = $this->parsespace($silence);
9390 if ($r19!==self::$FAILED) {
9391 goto choice_1;
9392 }
9393 $r19 = $this->parsesol_transparent($silence, $boolParams, $param_preproc, $param_th);
9394 choice_1:
9395 if ($r19!==self::$FAILED) {
9396 $r18[] = $r19;
9397 } else {
9398 break;
9399 }
9400 }
9401 // spc <- $r18
9402 // free $r19
9403 $p14 = $this->currPos;
9404 $r19 = $this->discardeolf(true);
9405 if ($r19!==self::$FAILED) {
9406 $r19 = false;
9407 $this->currPos = $p14;
9408 } else {
9409 $this->currPos = $p7;
9410 $r6 = self::$FAILED;
9411 goto seq_2;
9412 }
9413 // free $p14
9414 $r6 = true;
9415 seq_2:
9416 // r <- $r6
9417 if ($r6!==self::$FAILED) {
9418 $this->savedPos = $p4;
9419 $r6 = $this->a95($r8, $r10, $r17, $r18);
9420 } else {
9421 $this->currPos = $p3;
9422 $r1 = self::$FAILED;
9423 goto seq_1;
9424 }
9425 // free $p7
9426 $r1 = true;
9427 seq_1:
9428 if ($r1!==self::$FAILED) {
9429 $this->savedPos = $p2;
9430 $r1 = $this->a24($r6);
9431 }
9432 // free $p3
9433 $this->cache[$bucket][$key] = new GrammarCacheEntry(
9434 $this->currPos,
9435 $r1,
9436 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
9437 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
9438 );
9439 return $r1;
9440 }
9441 private function parsehr($silence, $boolParams, &$param_preproc, &$param_th) {
9442 $key = json_encode([304, $boolParams & 0x3ebf, $param_preproc, $param_th]);
9443 $bucket = $this->currPos;
9444 $cached = $this->cache[$bucket][$key] ?? null;
9445 if ($cached) {
9446 $this->currPos = $cached->nextPos;
9447 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
9448 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
9449 return $cached->result;
9450 }
9451 $saved_preproc=$param_preproc;
9452 $saved_th=$param_th;
9453 $p2 = $this->currPos;
9454 // start seq_1
9455 $p3 = $this->currPos;
9456 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "----", $this->currPos, 4, false) === 0) {
9457 $r4 = "----";
9458 $this->currPos += 4;
9459 } else {
9460 if (!$silence) {$this->fail(59);}
9461 $r4 = self::$FAILED;
9462 $r1 = self::$FAILED;
9463 goto seq_1;
9464 }
9465 $p6 = $this->currPos;
9466 for (;;) {
9467 if (($this->input[$this->currPos] ?? null) === "-") {
9468 $this->currPos++;
9469 $r7 = "-";
9470 } else {
9471 if (!$silence) {$this->fail(55);}
9472 $r7 = self::$FAILED;
9473 break;
9474 }
9475 }
9476 // free $r7
9477 $r5 = true;
9478 // d <- $r5
9479 if ($r5!==self::$FAILED) {
9480 $r5 = substr($this->input, $p6, $this->currPos - $p6);
9481 } else {
9482 $r5 = self::$FAILED;
9483 $this->currPos = $p3;
9484 $r1 = self::$FAILED;
9485 goto seq_1;
9486 }
9487 // free $p6
9488 // start choice_1
9489 $p6 = $this->currPos;
9490 // start seq_2
9491 $p8 = $this->currPos;
9492 $p9 = $this->currPos;
9493 $r10 = $this->discardsol(true, $boolParams, $param_preproc, $param_th);
9494 if ($r10!==self::$FAILED) {
9495 $r10 = false;
9496 $this->currPos = $p9;
9497 } else {
9498 $r7 = self::$FAILED;
9499 goto seq_2;
9500 }
9501 // free $p9
9502 $r7 = true;
9503 seq_2:
9504 if ($r7!==self::$FAILED) {
9505 $this->savedPos = $p6;
9506 $r7 = $this->a96($r5);
9507 goto choice_1;
9508 }
9509 // free $p8
9510 $p8 = $this->currPos;
9511 $r7 = '';
9512 if ($r7!==self::$FAILED) {
9513 $this->savedPos = $p8;
9514 $r7 = $this->a97($r5);
9515 }
9516 choice_1:
9517 // lineContent <- $r7
9518 if ($r7===self::$FAILED) {
9519 $this->currPos = $p3;
9520 $r1 = self::$FAILED;
9521 goto seq_1;
9522 }
9523 $r1 = true;
9524 seq_1:
9525 if ($r1!==self::$FAILED) {
9526 $this->savedPos = $p2;
9527 $r1 = $this->a98($r5, $r7);
9528 }
9529 // free $p3
9530 $this->cache[$bucket][$key] = new GrammarCacheEntry(
9531 $this->currPos,
9532 $r1,
9533 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
9534 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
9535 );
9536 return $r1;
9537 }
9538 private function discardtplarg_preproc($silence, $boolParams, &$param_preproc, &$param_th) {
9539 $key = json_encode([361, $boolParams & 0x3fff, $param_preproc, $param_th]);
9540 $bucket = $this->currPos;
9541 $cached = $this->cache[$bucket][$key] ?? null;
9542 if ($cached) {
9543 $this->currPos = $cached->nextPos;
9544 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
9545 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
9546 return $cached->result;
9547 }
9548 $saved_preproc=$param_preproc;
9549 $saved_th=$param_th;
9550 $p2 = $this->currPos;
9551 // start seq_1
9552 $p3 = $this->currPos;
9553 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) {
9554 $r4 = "{{{";
9555 $this->currPos += 3;
9556 } else {
9557 if (!$silence) {$this->fail(60);}
9558 $r4 = self::$FAILED;
9559 $r1 = self::$FAILED;
9560 goto seq_1;
9561 }
9562 $p6 = $this->currPos;
9563 $r5 = '';
9564 // p <- $r5
9565 if ($r5!==self::$FAILED) {
9566 $this->savedPos = $p6;
9567 $r5 = $this->a17();
9568 } else {
9569 $this->currPos = $p3;
9570 $r1 = self::$FAILED;
9571 goto seq_1;
9572 }
9573 $r7 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th);
9574 if ($r7===self::$FAILED) {
9575 $r7 = null;
9576 }
9577 // target <- $r7
9578 $r8 = [];
9579 for (;;) {
9580 $p10 = $this->currPos;
9581 // start seq_2
9582 $p11 = $this->currPos;
9583 for (;;) {
9584 $r13 = $this->discardnl_comment_space($silence);
9585 if ($r13===self::$FAILED) {
9586 break;
9587 }
9588 }
9589 // free $r13
9590 $r12 = true;
9591 if ($r12===self::$FAILED) {
9592 $r9 = self::$FAILED;
9593 goto seq_2;
9594 }
9595 // free $r12
9596 if (($this->input[$this->currPos] ?? null) === "|") {
9597 $this->currPos++;
9598 $r12 = "|";
9599 } else {
9600 if (!$silence) {$this->fail(13);}
9601 $r12 = self::$FAILED;
9602 $this->currPos = $p11;
9603 $r9 = self::$FAILED;
9604 goto seq_2;
9605 }
9606 // start choice_1
9607 $p14 = $this->currPos;
9608 // start seq_3
9609 $p15 = $this->currPos;
9610 $p17 = $this->currPos;
9611 $r16 = '';
9612 // p0 <- $r16
9613 if ($r16!==self::$FAILED) {
9614 $this->savedPos = $p17;
9615 $r16 = $this->a99($r5, $r7);
9616 } else {
9617 $r13 = self::$FAILED;
9618 goto seq_3;
9619 }
9620 $r18 = [];
9621 for (;;) {
9622 $r19 = $this->parsenl_comment_space($silence);
9623 if ($r19!==self::$FAILED) {
9624 $r18[] = $r19;
9625 } else {
9626 break;
9627 }
9628 }
9629 // v <- $r18
9630 // free $r19
9631 $p20 = $this->currPos;
9632 $r19 = '';
9633 // p1 <- $r19
9634 if ($r19!==self::$FAILED) {
9635 $this->savedPos = $p20;
9636 $r19 = $this->a100($r5, $r7, $r16, $r18);
9637 } else {
9638 $this->currPos = $p15;
9639 $r13 = self::$FAILED;
9640 goto seq_3;
9641 }
9642 $p21 = $this->currPos;
9643 // start choice_2
9644 if (($this->input[$this->currPos] ?? null) === "|") {
9645 $this->currPos++;
9646 $r22 = "|";
9647 goto choice_2;
9648 } else {
9649 $r22 = self::$FAILED;
9650 }
9651 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) {
9652 $r22 = "}}}";
9653 $this->currPos += 3;
9654 } else {
9655 $r22 = self::$FAILED;
9656 }
9657 choice_2:
9658 if ($r22!==self::$FAILED) {
9659 $r22 = false;
9660 $this->currPos = $p21;
9661 } else {
9662 $this->currPos = $p15;
9663 $r13 = self::$FAILED;
9664 goto seq_3;
9665 }
9666 // free $p21
9667 $r13 = true;
9668 seq_3:
9669 if ($r13!==self::$FAILED) {
9670 $this->savedPos = $p14;
9671 $r13 = $this->a101($r5, $r7, $r16, $r18, $r19);
9672 goto choice_1;
9673 }
9674 // free $p15
9675 $r13 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th);
9676 choice_1:
9677 // r <- $r13
9678 if ($r13===self::$FAILED) {
9679 $this->currPos = $p11;
9680 $r9 = self::$FAILED;
9681 goto seq_2;
9682 }
9683 $r9 = true;
9684 seq_2:
9685 if ($r9!==self::$FAILED) {
9686 $this->savedPos = $p10;
9687 $r9 = $this->a102($r5, $r7, $r13);
9688 $r8[] = $r9;
9689 } else {
9690 break;
9691 }
9692 // free $p11
9693 }
9694 // params <- $r8
9695 // free $r9
9696 for (;;) {
9697 $r23 = $this->discardnl_comment_space($silence);
9698 if ($r23===self::$FAILED) {
9699 break;
9700 }
9701 }
9702 // free $r23
9703 $r9 = true;
9704 if ($r9===self::$FAILED) {
9705 $this->currPos = $p3;
9706 $r1 = self::$FAILED;
9707 goto seq_1;
9708 }
9709 // free $r9
9710 $r9 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th);
9711 if ($r9===self::$FAILED) {
9712 $this->currPos = $p3;
9713 $r1 = self::$FAILED;
9714 goto seq_1;
9715 }
9716 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) {
9717 $r23 = "}}}";
9718 $this->currPos += 3;
9719 } else {
9720 if (!$silence) {$this->fail(61);}
9721 $r23 = self::$FAILED;
9722 $this->currPos = $p3;
9723 $r1 = self::$FAILED;
9724 goto seq_1;
9725 }
9726 $r1 = true;
9727 seq_1:
9728 if ($r1!==self::$FAILED) {
9729 $this->savedPos = $p2;
9730 $r1 = $this->a103($r5, $r7, $r8);
9731 }
9732 // free $p3
9733 $this->cache[$bucket][$key] = new GrammarCacheEntry(
9734 $this->currPos,
9735 $r1,
9736 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
9737 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
9738 );
9739 return $r1;
9740 }
9741 private function parsetemplate_preproc($silence, $boolParams, &$param_preproc, &$param_th) {
9742 $key = json_encode([356, $boolParams & 0x3fff, $param_preproc, $param_th]);
9743 $bucket = $this->currPos;
9744 $cached = $this->cache[$bucket][$key] ?? null;
9745 if ($cached) {
9746 $this->currPos = $cached->nextPos;
9747 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
9748 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
9749 return $cached->result;
9750 }
9751 $saved_preproc=$param_preproc;
9752 $saved_th=$param_th;
9753 // start choice_1
9754 $p2 = $this->currPos;
9755 // start seq_1
9756 $p3 = $this->currPos;
9757 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) {
9758 $r4 = "{{";
9759 $this->currPos += 2;
9760 } else {
9761 if (!$silence) {$this->fail(43);}
9762 $r4 = self::$FAILED;
9763 $r1 = self::$FAILED;
9764 goto seq_1;
9765 }
9766 $p6 = $this->currPos;
9767 for (;;) {
9768 $r7 = $this->discardnl_comment_space($silence);
9769 if ($r7===self::$FAILED) {
9770 break;
9771 }
9772 }
9773 // free $r7
9774 $r5 = true;
9775 // leadWS <- $r5
9776 if ($r5!==self::$FAILED) {
9777 $r5 = substr($this->input, $p6, $this->currPos - $p6);
9778 } else {
9779 $r5 = self::$FAILED;
9780 $this->currPos = $p3;
9781 $r1 = self::$FAILED;
9782 goto seq_1;
9783 }
9784 // free $p6
9785 $r7 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th);
9786 // target <- $r7
9787 if ($r7===self::$FAILED) {
9788 $this->currPos = $p3;
9789 $r1 = self::$FAILED;
9790 goto seq_1;
9791 }
9792 $r8 = [];
9793 for (;;) {
9794 $p6 = $this->currPos;
9795 // start seq_2
9796 $p10 = $this->currPos;
9797 for (;;) {
9798 $r12 = $this->discardnl_comment_space($silence);
9799 if ($r12===self::$FAILED) {
9800 break;
9801 }
9802 }
9803 // free $r12
9804 $r11 = true;
9805 if ($r11===self::$FAILED) {
9806 $r9 = self::$FAILED;
9807 goto seq_2;
9808 }
9809 // free $r11
9810 if (($this->input[$this->currPos] ?? null) === "|") {
9811 $this->currPos++;
9812 $r11 = "|";
9813 } else {
9814 if (!$silence) {$this->fail(13);}
9815 $r11 = self::$FAILED;
9816 $this->currPos = $p10;
9817 $r9 = self::$FAILED;
9818 goto seq_2;
9819 }
9820 // start choice_2
9821 $p13 = $this->currPos;
9822 // start seq_3
9823 $p14 = $this->currPos;
9824 $p16 = $this->currPos;
9825 $r15 = '';
9826 // p0 <- $r15
9827 if ($r15!==self::$FAILED) {
9828 $this->savedPos = $p16;
9829 $r15 = $this->a104($r5, $r7);
9830 } else {
9831 $r12 = self::$FAILED;
9832 goto seq_3;
9833 }
9834 $r17 = [];
9835 for (;;) {
9836 $r18 = $this->parsenl_comment_space($silence);
9837 if ($r18!==self::$FAILED) {
9838 $r17[] = $r18;
9839 } else {
9840 break;
9841 }
9842 }
9843 // v <- $r17
9844 // free $r18
9845 $p19 = $this->currPos;
9846 $r18 = '';
9847 // p1 <- $r18
9848 if ($r18!==self::$FAILED) {
9849 $this->savedPos = $p19;
9850 $r18 = $this->a105($r5, $r7, $r15, $r17);
9851 } else {
9852 $this->currPos = $p14;
9853 $r12 = self::$FAILED;
9854 goto seq_3;
9855 }
9856 $p20 = $this->currPos;
9857 // start choice_3
9858 if (($this->input[$this->currPos] ?? null) === "|") {
9859 $this->currPos++;
9860 $r21 = "|";
9861 goto choice_3;
9862 } else {
9863 $r21 = self::$FAILED;
9864 }
9865 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}", $this->currPos, 2, false) === 0) {
9866 $r21 = "}}";
9867 $this->currPos += 2;
9868 } else {
9869 $r21 = self::$FAILED;
9870 }
9871 choice_3:
9872 if ($r21!==self::$FAILED) {
9873 $r21 = false;
9874 $this->currPos = $p20;
9875 } else {
9876 $this->currPos = $p14;
9877 $r12 = self::$FAILED;
9878 goto seq_3;
9879 }
9880 // free $p20
9881 $r12 = true;
9882 seq_3:
9883 if ($r12!==self::$FAILED) {
9884 $this->savedPos = $p13;
9885 $r12 = $this->a106($r5, $r7, $r15, $r17, $r18);
9886 goto choice_2;
9887 }
9888 // free $p14
9889 $r12 = $this->parsetemplate_param($silence, $boolParams, $param_preproc, $param_th);
9890 choice_2:
9891 // r <- $r12
9892 if ($r12===self::$FAILED) {
9893 $this->currPos = $p10;
9894 $r9 = self::$FAILED;
9895 goto seq_2;
9896 }
9897 $r9 = true;
9898 seq_2:
9899 if ($r9!==self::$FAILED) {
9900 $this->savedPos = $p6;
9901 $r9 = $this->a107($r5, $r7, $r12);
9902 $r8[] = $r9;
9903 } else {
9904 break;
9905 }
9906 // free $p10
9907 }
9908 // params <- $r8
9909 // free $r9
9910 $p10 = $this->currPos;
9911 for (;;) {
9912 $r22 = $this->discardnl_comment_space($silence);
9913 if ($r22===self::$FAILED) {
9914 break;
9915 }
9916 }
9917 // free $r22
9918 $r9 = true;
9919 // trailWS <- $r9
9920 if ($r9!==self::$FAILED) {
9921 $r9 = substr($this->input, $p10, $this->currPos - $p10);
9922 } else {
9923 $r9 = self::$FAILED;
9924 $this->currPos = $p3;
9925 $r1 = self::$FAILED;
9926 goto seq_1;
9927 }
9928 // free $p10
9929 $r22 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th);
9930 if ($r22===self::$FAILED) {
9931 $this->currPos = $p3;
9932 $r1 = self::$FAILED;
9933 goto seq_1;
9934 }
9935 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}", $this->currPos, 2, false) === 0) {
9936 $r23 = "}}";
9937 $this->currPos += 2;
9938 } else {
9939 if (!$silence) {$this->fail(62);}
9940 $r23 = self::$FAILED;
9941 $this->currPos = $p3;
9942 $r1 = self::$FAILED;
9943 goto seq_1;
9944 }
9945 $r1 = true;
9946 seq_1:
9947 if ($r1!==self::$FAILED) {
9948 $this->savedPos = $p2;
9949 $r1 = $this->a108($r5, $r7, $r8, $r9);
9950 goto choice_1;
9951 }
9952 // free $p3
9953 $p3 = $this->currPos;
9954 // start seq_4
9955 $p10 = $this->currPos;
9956 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{", $this->currPos, 2, false) === 0) {
9957 $r24 = "{{";
9958 $this->currPos += 2;
9959 } else {
9960 if (!$silence) {$this->fail(43);}
9961 $r24 = self::$FAILED;
9962 $r1 = self::$FAILED;
9963 goto seq_4;
9964 }
9965 for (;;) {
9966 $r26 = $this->discardspace_or_newline($silence);
9967 if ($r26===self::$FAILED) {
9968 break;
9969 }
9970 }
9971 // free $r26
9972 $r25 = true;
9973 if ($r25===self::$FAILED) {
9974 $this->currPos = $p10;
9975 $r1 = self::$FAILED;
9976 goto seq_4;
9977 }
9978 // free $r25
9979 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}", $this->currPos, 2, false) === 0) {
9980 $r25 = "}}";
9981 $this->currPos += 2;
9982 } else {
9983 if (!$silence) {$this->fail(62);}
9984 $r25 = self::$FAILED;
9985 $this->currPos = $p10;
9986 $r1 = self::$FAILED;
9987 goto seq_4;
9988 }
9989 $r1 = true;
9990 seq_4:
9991 if ($r1!==self::$FAILED) {
9992 $r1 = substr($this->input, $p3, $this->currPos - $p3);
9993 } else {
9994 $r1 = self::$FAILED;
9995 }
9996 // free $p10
9997 // free $p3
9998 choice_1:
9999 $this->cache[$bucket][$key] = new GrammarCacheEntry(
10000 $this->currPos,
10001 $r1,
10002 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
10003 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
10004 );
10005 return $r1;
10006 }
10007 private function parsetplarg_preproc($silence, $boolParams, &$param_preproc, &$param_th) {
10008 $key = json_encode([360, $boolParams & 0x3fff, $param_preproc, $param_th]);
10009 $bucket = $this->currPos;
10010 $cached = $this->cache[$bucket][$key] ?? null;
10011 if ($cached) {
10012 $this->currPos = $cached->nextPos;
10013 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
10014 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
10015 return $cached->result;
10016 }
10017 $saved_preproc=$param_preproc;
10018 $saved_th=$param_th;
10019 $p2 = $this->currPos;
10020 // start seq_1
10021 $p3 = $this->currPos;
10022 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{{", $this->currPos, 3, false) === 0) {
10023 $r4 = "{{{";
10024 $this->currPos += 3;
10025 } else {
10026 if (!$silence) {$this->fail(60);}
10027 $r4 = self::$FAILED;
10028 $r1 = self::$FAILED;
10029 goto seq_1;
10030 }
10031 $p6 = $this->currPos;
10032 $r5 = '';
10033 // p <- $r5
10034 if ($r5!==self::$FAILED) {
10035 $this->savedPos = $p6;
10036 $r5 = $this->a17();
10037 } else {
10038 $this->currPos = $p3;
10039 $r1 = self::$FAILED;
10040 goto seq_1;
10041 }
10042 $r7 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th);
10043 if ($r7===self::$FAILED) {
10044 $r7 = null;
10045 }
10046 // target <- $r7
10047 $r8 = [];
10048 for (;;) {
10049 $p10 = $this->currPos;
10050 // start seq_2
10051 $p11 = $this->currPos;
10052 for (;;) {
10053 $r13 = $this->discardnl_comment_space($silence);
10054 if ($r13===self::$FAILED) {
10055 break;
10056 }
10057 }
10058 // free $r13
10059 $r12 = true;
10060 if ($r12===self::$FAILED) {
10061 $r9 = self::$FAILED;
10062 goto seq_2;
10063 }
10064 // free $r12
10065 if (($this->input[$this->currPos] ?? null) === "|") {
10066 $this->currPos++;
10067 $r12 = "|";
10068 } else {
10069 if (!$silence) {$this->fail(13);}
10070 $r12 = self::$FAILED;
10071 $this->currPos = $p11;
10072 $r9 = self::$FAILED;
10073 goto seq_2;
10074 }
10075 // start choice_1
10076 $p14 = $this->currPos;
10077 // start seq_3
10078 $p15 = $this->currPos;
10079 $p17 = $this->currPos;
10080 $r16 = '';
10081 // p0 <- $r16
10082 if ($r16!==self::$FAILED) {
10083 $this->savedPos = $p17;
10084 $r16 = $this->a99($r5, $r7);
10085 } else {
10086 $r13 = self::$FAILED;
10087 goto seq_3;
10088 }
10089 $r18 = [];
10090 for (;;) {
10091 $r19 = $this->parsenl_comment_space($silence);
10092 if ($r19!==self::$FAILED) {
10093 $r18[] = $r19;
10094 } else {
10095 break;
10096 }
10097 }
10098 // v <- $r18
10099 // free $r19
10100 $p20 = $this->currPos;
10101 $r19 = '';
10102 // p1 <- $r19
10103 if ($r19!==self::$FAILED) {
10104 $this->savedPos = $p20;
10105 $r19 = $this->a100($r5, $r7, $r16, $r18);
10106 } else {
10107 $this->currPos = $p15;
10108 $r13 = self::$FAILED;
10109 goto seq_3;
10110 }
10111 $p21 = $this->currPos;
10112 // start choice_2
10113 if (($this->input[$this->currPos] ?? null) === "|") {
10114 $this->currPos++;
10115 $r22 = "|";
10116 goto choice_2;
10117 } else {
10118 $r22 = self::$FAILED;
10119 }
10120 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) {
10121 $r22 = "}}}";
10122 $this->currPos += 3;
10123 } else {
10124 $r22 = self::$FAILED;
10125 }
10126 choice_2:
10127 if ($r22!==self::$FAILED) {
10128 $r22 = false;
10129 $this->currPos = $p21;
10130 } else {
10131 $this->currPos = $p15;
10132 $r13 = self::$FAILED;
10133 goto seq_3;
10134 }
10135 // free $p21
10136 $r13 = true;
10137 seq_3:
10138 if ($r13!==self::$FAILED) {
10139 $this->savedPos = $p14;
10140 $r13 = $this->a101($r5, $r7, $r16, $r18, $r19);
10141 goto choice_1;
10142 }
10143 // free $p15
10144 $r13 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th);
10145 choice_1:
10146 // r <- $r13
10147 if ($r13===self::$FAILED) {
10148 $this->currPos = $p11;
10149 $r9 = self::$FAILED;
10150 goto seq_2;
10151 }
10152 $r9 = true;
10153 seq_2:
10154 if ($r9!==self::$FAILED) {
10155 $this->savedPos = $p10;
10156 $r9 = $this->a102($r5, $r7, $r13);
10157 $r8[] = $r9;
10158 } else {
10159 break;
10160 }
10161 // free $p11
10162 }
10163 // params <- $r8
10164 // free $r9
10165 for (;;) {
10166 $r23 = $this->discardnl_comment_space($silence);
10167 if ($r23===self::$FAILED) {
10168 break;
10169 }
10170 }
10171 // free $r23
10172 $r9 = true;
10173 if ($r9===self::$FAILED) {
10174 $this->currPos = $p3;
10175 $r1 = self::$FAILED;
10176 goto seq_1;
10177 }
10178 // free $r9
10179 $r9 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th);
10180 if ($r9===self::$FAILED) {
10181 $this->currPos = $p3;
10182 $r1 = self::$FAILED;
10183 goto seq_1;
10184 }
10185 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}}}", $this->currPos, 3, false) === 0) {
10186 $r23 = "}}}";
10187 $this->currPos += 3;
10188 } else {
10189 if (!$silence) {$this->fail(61);}
10190 $r23 = self::$FAILED;
10191 $this->currPos = $p3;
10192 $r1 = self::$FAILED;
10193 goto seq_1;
10194 }
10195 $r1 = true;
10196 seq_1:
10197 if ($r1!==self::$FAILED) {
10198 $this->savedPos = $p2;
10199 $r1 = $this->a103($r5, $r7, $r8);
10200 }
10201 // free $p3
10202 $this->cache[$bucket][$key] = new GrammarCacheEntry(
10203 $this->currPos,
10204 $r1,
10205 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
10206 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
10207 );
10208 return $r1;
10209 }
10210 private function discardwikilink_preproc($silence, $boolParams, &$param_preproc, &$param_th) {
10211 $key = json_encode([407, $boolParams & 0x3fff, $param_preproc, $param_th]);
10212 $bucket = $this->currPos;
10213 $cached = $this->cache[$bucket][$key] ?? null;
10214 if ($cached) {
10215 $this->currPos = $cached->nextPos;
10216 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
10217 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
10218 return $cached->result;
10219 }
10220 $saved_preproc=$param_preproc;
10221 $saved_th=$param_th;
10222 $p2 = $this->currPos;
10223 // start seq_1
10224 $p3 = $this->currPos;
10225 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) {
10226 $r4 = "[[";
10227 $this->currPos += 2;
10228 } else {
10229 if (!$silence) {$this->fail(41);}
10230 $r4 = self::$FAILED;
10231 $r1 = self::$FAILED;
10232 goto seq_1;
10233 }
10234 $p6 = $this->currPos;
10235 $r5 = '';
10236 // spos <- $r5
10237 if ($r5!==self::$FAILED) {
10238 $this->savedPos = $p6;
10239 $r5 = $this->a17();
10240 } else {
10241 $this->currPos = $p3;
10242 $r1 = self::$FAILED;
10243 goto seq_1;
10244 }
10245 $r7 = $this->parsewikilink_preprocessor_text($silence, $boolParams, $param_preproc, $param_th);
10246 if ($r7===self::$FAILED) {
10247 $r7 = null;
10248 }
10249 // target <- $r7
10250 $p9 = $this->currPos;
10251 $r8 = '';
10252 // tpos <- $r8
10253 if ($r8!==self::$FAILED) {
10254 $this->savedPos = $p9;
10255 $r8 = $this->a109($r5, $r7);
10256 } else {
10257 $this->currPos = $p3;
10258 $r1 = self::$FAILED;
10259 goto seq_1;
10260 }
10261 $r10 = $this->parsewikilink_content($silence, $boolParams, $param_preproc, $param_th);
10262 // lcs <- $r10
10263 if ($r10===self::$FAILED) {
10264 $this->currPos = $p3;
10265 $r1 = self::$FAILED;
10266 goto seq_1;
10267 }
10268 $r11 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th);
10269 if ($r11===self::$FAILED) {
10270 $this->currPos = $p3;
10271 $r1 = self::$FAILED;
10272 goto seq_1;
10273 }
10274 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "]]", $this->currPos, 2, false) === 0) {
10275 $r12 = "]]";
10276 $this->currPos += 2;
10277 } else {
10278 if (!$silence) {$this->fail(63);}
10279 $r12 = self::$FAILED;
10280 $this->currPos = $p3;
10281 $r1 = self::$FAILED;
10282 goto seq_1;
10283 }
10284 $r1 = true;
10285 seq_1:
10286 if ($r1!==self::$FAILED) {
10287 $this->savedPos = $p2;
10288 $r1 = $this->a110($r5, $r7, $r8, $r10);
10289 }
10290 // free $p3
10291 $this->cache[$bucket][$key] = new GrammarCacheEntry(
10292 $this->currPos,
10293 $r1,
10294 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
10295 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
10296 );
10297 return $r1;
10298 }
10299 private function discardbroken_wikilink($silence, $boolParams, &$param_preproc, &$param_th) {
10300 $key = json_encode([405, $boolParams & 0x3fff, $param_preproc, $param_th]);
10301 $bucket = $this->currPos;
10302 $cached = $this->cache[$bucket][$key] ?? null;
10303 if ($cached) {
10304 $this->currPos = $cached->nextPos;
10305 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
10306 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
10307 return $cached->result;
10308 }
10309 $saved_preproc=$param_preproc;
10310 $saved_th=$param_th;
10311 $p2 = $this->currPos;
10312 // start seq_1
10313 $p3 = $this->currPos;
10314 $p4 = $this->currPos;
10315 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) {
10316 $r5 = "[[";
10317 $this->currPos += 2;
10318 $r5 = false;
10319 $this->currPos = $p4;
10320 } else {
10321 $r5 = self::$FAILED;
10322 $r1 = self::$FAILED;
10323 goto seq_1;
10324 }
10325 // free $p4
10326 $this->savedPos = $this->currPos;
10327 $r6 = $this->a111($param_preproc);
10328 if ($r6) {
10329 $r6 = false;
10330 } else {
10331 $r6 = self::$FAILED;
10332 $this->currPos = $p3;
10333 $r1 = self::$FAILED;
10334 goto seq_1;
10335 }
10336 // start seq_2
10337 $p4 = $this->currPos;
10338 if (($this->input[$this->currPos] ?? null) === "[") {
10339 $this->currPos++;
10340 $r8 = "[";
10341 } else {
10342 if (!$silence) {$this->fail(19);}
10343 $r8 = self::$FAILED;
10344 $r7 = self::$FAILED;
10345 goto seq_2;
10346 }
10347 // start choice_1
10348 $r9 = $this->parseextlink($silence, $boolParams, $param_preproc, $param_th);
10349 if ($r9!==self::$FAILED) {
10350 goto choice_1;
10351 }
10352 if (($this->input[$this->currPos] ?? null) === "[") {
10353 $this->currPos++;
10354 $r9 = "[";
10355 } else {
10356 if (!$silence) {$this->fail(19);}
10357 $r9 = self::$FAILED;
10358 }
10359 choice_1:
10360 if ($r9===self::$FAILED) {
10361 $this->currPos = $p4;
10362 $r7 = self::$FAILED;
10363 goto seq_2;
10364 }
10365 $r7 = [$r8,$r9];
10366 seq_2:
10367 // a <- $r7
10368 if ($r7===self::$FAILED) {
10369 $this->currPos = $p3;
10370 $r1 = self::$FAILED;
10371 goto seq_1;
10372 }
10373 // free $p4
10374 $r1 = true;
10375 seq_1:
10376 if ($r1!==self::$FAILED) {
10377 $this->savedPos = $p2;
10378 $r1 = $this->a112($param_preproc, $r7);
10379 }
10380 // free $p3
10381 $this->cache[$bucket][$key] = new GrammarCacheEntry(
10382 $this->currPos,
10383 $r1,
10384 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
10385 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
10386 );
10387 return $r1;
10388 }
10389 private function parseextension_annotation_tag($silence, $boolParams, &$param_preproc, &$param_th) {
10390 $key = json_encode([418, $boolParams & 0x3ebf, $param_preproc, $param_th]);
10391 $bucket = $this->currPos;
10392 $cached = $this->cache[$bucket][$key] ?? null;
10393 if ($cached) {
10394 $this->currPos = $cached->nextPos;
10395 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
10396 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
10397 return $cached->result;
10398 }
10399 $saved_preproc=$param_preproc;
10400 $saved_th=$param_th;
10401 $p2 = $this->currPos;
10402 // start seq_1
10403 $p3 = $this->currPos;
10404 if (!(/*annOrExtTag*/($boolParams & 0x2) !== 0)) {
10405 $r4 = false;
10406 } else {
10407 $r4 = self::$FAILED;
10408 $r1 = self::$FAILED;
10409 goto seq_1;
10410 }
10411 if (($this->input[$this->currPos] ?? null) === "<") {
10412 $this->currPos++;
10413 $r5 = "<";
10414 } else {
10415 if (!$silence) {$this->fail(44);}
10416 $r5 = self::$FAILED;
10417 $this->currPos = $p3;
10418 $r1 = self::$FAILED;
10419 goto seq_1;
10420 }
10421 // start choice_1
10422 $p7 = $this->currPos;
10423 // start seq_2
10424 $p8 = $this->currPos;
10425 $r9 = $this->parsexmlish_tag($silence, $boolParams | 0x2, $param_preproc, $param_th);
10426 // extToken <- $r9
10427 if ($r9===self::$FAILED) {
10428 $r6 = self::$FAILED;
10429 goto seq_2;
10430 }
10431 $this->savedPos = $this->currPos;
10432 $r10 = $this->a113($r9);
10433 if ($r10) {
10434 $r10 = false;
10435 } else {
10436 $r10 = self::$FAILED;
10437 $this->currPos = $p8;
10438 $r6 = self::$FAILED;
10439 goto seq_2;
10440 }
10441 $r6 = true;
10442 seq_2:
10443 if ($r6!==self::$FAILED) {
10444 $this->savedPos = $p7;
10445 $r6 = $this->a114($r9);
10446 goto choice_1;
10447 }
10448 // free $p8
10449 $r6 = $this->parsetvar_old_syntax_closing_HACK($silence);
10450 choice_1:
10451 // tag <- $r6
10452 if ($r6===self::$FAILED) {
10453 $this->currPos = $p3;
10454 $r1 = self::$FAILED;
10455 goto seq_1;
10456 }
10457 $r1 = true;
10458 seq_1:
10459 if ($r1!==self::$FAILED) {
10460 $this->savedPos = $p2;
10461 $r1 = $this->a78($r6);
10462 }
10463 // free $p3
10464 $this->cache[$bucket][$key] = new GrammarCacheEntry(
10465 $this->currPos,
10466 $r1,
10467 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
10468 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
10469 );
10470 return $r1;
10471 }
10472 private function parsexmlish_tag($silence, $boolParams, &$param_preproc, &$param_th) {
10473 $key = json_encode([428, $boolParams & 0x3ebf, $param_preproc, $param_th]);
10474 $bucket = $this->currPos;
10475 $cached = $this->cache[$bucket][$key] ?? null;
10476 if ($cached) {
10477 $this->currPos = $cached->nextPos;
10478 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
10479 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
10480 return $cached->result;
10481 }
10482 $saved_preproc=$param_preproc;
10483 $saved_th=$param_th;
10484 $p2 = $this->currPos;
10485 // start seq_1
10486 $p3 = $this->currPos;
10487 $this->savedPos = $this->currPos;
10488 $r4 = $this->a115();
10489 if ($r4) {
10490 $r4 = false;
10491 } else {
10492 $r4 = self::$FAILED;
10493 $r1 = self::$FAILED;
10494 goto seq_1;
10495 }
10496 if (($this->input[$this->currPos] ?? null) === "/") {
10497 $this->currPos++;
10498 $r5 = "/";
10499 } else {
10500 if (!$silence) {$this->fail(35);}
10501 $r5 = self::$FAILED;
10502 $r5 = null;
10503 }
10504 // end <- $r5
10505 $r6 = $this->parsetag_name($silence);
10506 // name <- $r6
10507 if ($r6===self::$FAILED) {
10508 $this->currPos = $p3;
10509 $r1 = self::$FAILED;
10510 goto seq_1;
10511 }
10512 $this->savedPos = $this->currPos;
10513 $r7 = $this->a116($r5, $r6, /*annOrExtTag*/($boolParams & 0x2) !== 0);
10514 if ($r7) {
10515 $r7 = false;
10516 } else {
10517 $r7 = self::$FAILED;
10518 $this->currPos = $p3;
10519 $r1 = self::$FAILED;
10520 goto seq_1;
10521 }
10522 $r8 = $this->parsegeneric_newline_attributes($silence, $boolParams & ~0x140, $param_preproc, $param_th);
10523 // attribs <- $r8
10524 if ($r8===self::$FAILED) {
10525 $this->currPos = $p3;
10526 $r1 = self::$FAILED;
10527 goto seq_1;
10528 }
10529 for (;;) {
10530 $r10 = $this->discardspace_or_newline_or_solidus($silence);
10531 if ($r10===self::$FAILED) {
10532 break;
10533 }
10534 }
10535 // free $r10
10536 $r9 = true;
10537 if ($r9===self::$FAILED) {
10538 $this->currPos = $p3;
10539 $r1 = self::$FAILED;
10540 goto seq_1;
10541 }
10542 // free $r9
10543 if (($this->input[$this->currPos] ?? null) === "/") {
10544 $this->currPos++;
10545 $r9 = "/";
10546 } else {
10547 if (!$silence) {$this->fail(35);}
10548 $r9 = self::$FAILED;
10549 $r9 = null;
10550 }
10551 // selfclose <- $r9
10552 for (;;) {
10553 $r11 = $this->discardspace($silence);
10554 if ($r11===self::$FAILED) {
10555 break;
10556 }
10557 }
10558 // free $r11
10559 $r10 = true;
10560 if ($r10===self::$FAILED) {
10561 $this->currPos = $p3;
10562 $r1 = self::$FAILED;
10563 goto seq_1;
10564 }
10565 // free $r10
10566 if (($this->input[$this->currPos] ?? null) === ">") {
10567 $this->currPos++;
10568 $r10 = ">";
10569 } else {
10570 if (!$silence) {$this->fail(64);}
10571 $r10 = self::$FAILED;
10572 $this->currPos = $p3;
10573 $r1 = self::$FAILED;
10574 goto seq_1;
10575 }
10576 $r1 = true;
10577 seq_1:
10578 if ($r1!==self::$FAILED) {
10579 $this->savedPos = $p2;
10580 $r1 = $this->a117($r5, $r6, /*annOrExtTag*/($boolParams & 0x2) !== 0, $r8, $r9);
10581 }
10582 // free $p3
10583 $this->cache[$bucket][$key] = new GrammarCacheEntry(
10584 $this->currPos,
10585 $r1,
10586 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
10587 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
10588 );
10589 return $r1;
10590 }
10591 private function parsetvar_old_syntax_closing_HACK($silence) {
10592 $key = 414;
10593 $bucket = $this->currPos;
10594 $cached = $this->cache[$bucket][$key] ?? null;
10595 if ($cached) {
10596 $this->currPos = $cached->nextPos;
10597
10598 return $cached->result;
10599 }
10600
10601 $p2 = $this->currPos;
10602 // start seq_1
10603 $p3 = $this->currPos;
10604 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "/>", $this->currPos, 2, false) === 0) {
10605 $r4 = "/>";
10606 $this->currPos += 2;
10607 } else {
10608 if (!$silence) {$this->fail(65);}
10609 $r4 = self::$FAILED;
10610 $r1 = self::$FAILED;
10611 goto seq_1;
10612 }
10613 $this->savedPos = $this->currPos;
10614 $r5 = $this->a118();
10615 if ($r5) {
10616 $r5 = false;
10617 } else {
10618 $r5 = self::$FAILED;
10619 $this->currPos = $p3;
10620 $r1 = self::$FAILED;
10621 goto seq_1;
10622 }
10623 $r1 = true;
10624 seq_1:
10625 if ($r1!==self::$FAILED) {
10626 $this->savedPos = $p2;
10627 $r1 = $this->a119();
10628 }
10629 // free $p3
10630 $this->cache[$bucket][$key] = new GrammarCacheEntry(
10631 $this->currPos,
10632 $r1,
10633 self::$UNDEFINED,
10634 self::$UNDEFINED
10635 );
10636 return $r1;
10637 }
10638 private function parseautourl($silence, $boolParams, &$param_preproc, &$param_th) {
10639 $key = json_encode([342, $boolParams & 0x3fff, $param_preproc, $param_th]);
10640 $bucket = $this->currPos;
10641 $cached = $this->cache[$bucket][$key] ?? null;
10642 if ($cached) {
10643 $this->currPos = $cached->nextPos;
10644 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
10645 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
10646 return $cached->result;
10647 }
10648 $saved_preproc=$param_preproc;
10649 $saved_th=$param_th;
10650 $p2 = $this->currPos;
10651 // start seq_1
10652 $p3 = $this->currPos;
10653 $p4 = $this->currPos;
10654 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "//", $this->currPos, 2, false) === 0) {
10655 $r5 = "//";
10656 $this->currPos += 2;
10657 } else {
10658 $r5 = self::$FAILED;
10659 }
10660 if ($r5 === self::$FAILED) {
10661 $r5 = false;
10662 } else {
10663 $r5 = self::$FAILED;
10664 $this->currPos = $p4;
10665 $r1 = self::$FAILED;
10666 goto seq_1;
10667 }
10668 // free $p4
10669 $p4 = $this->currPos;
10670 // start seq_2
10671 $p7 = $this->currPos;
10672 $r8 = $this->parseurl_protocol($silence);
10673 // proto <- $r8
10674 if ($r8===self::$FAILED) {
10675 $r6 = self::$FAILED;
10676 goto seq_2;
10677 }
10678 // start choice_1
10679 $r9 = $this->parseipv6urladdr($silence);
10680 if ($r9!==self::$FAILED) {
10681 goto choice_1;
10682 }
10683 $r9 = '';
10684 choice_1:
10685 // addr <- $r9
10686 if ($r9===self::$FAILED) {
10687 $this->currPos = $p7;
10688 $r6 = self::$FAILED;
10689 goto seq_2;
10690 }
10691 $r10 = [];
10692 for (;;) {
10693 $p12 = $this->currPos;
10694 // start seq_3
10695 $p13 = $this->currPos;
10696 $p14 = $this->currPos;
10697 $r15 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
10698 if ($r15 === self::$FAILED) {
10699 $r15 = false;
10700 } else {
10701 $r15 = self::$FAILED;
10702 $this->currPos = $p14;
10703 $r11 = self::$FAILED;
10704 goto seq_3;
10705 }
10706 // free $p14
10707 // start choice_2
10708 $r16 = $this->parseno_punctuation_char($silence);
10709 if ($r16!==self::$FAILED) {
10710 goto choice_2;
10711 }
10712 $r16 = $this->parsecomment($silence);
10713 if ($r16!==self::$FAILED) {
10714 goto choice_2;
10715 }
10716 $r16 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc);
10717 if ($r16!==self::$FAILED) {
10718 goto choice_2;
10719 }
10720 $p14 = $this->currPos;
10721 // start seq_4
10722 $p17 = $this->currPos;
10723 if (($this->input[$this->currPos] ?? null) === "'") {
10724 $this->currPos++;
10725 $r18 = "'";
10726 } else {
10727 if (!$silence) {$this->fail(33);}
10728 $r18 = self::$FAILED;
10729 $r16 = self::$FAILED;
10730 goto seq_4;
10731 }
10732 $p19 = $this->currPos;
10733 if (($this->input[$this->currPos] ?? null) === "'") {
10734 $this->currPos++;
10735 $r20 = "'";
10736 } else {
10737 $r20 = self::$FAILED;
10738 }
10739 if ($r20 === self::$FAILED) {
10740 $r20 = false;
10741 } else {
10742 $r20 = self::$FAILED;
10743 $this->currPos = $p19;
10744 $this->currPos = $p17;
10745 $r16 = self::$FAILED;
10746 goto seq_4;
10747 }
10748 // free $p19
10749 $r16 = true;
10750 seq_4:
10751 if ($r16!==self::$FAILED) {
10752 $r16 = substr($this->input, $p14, $this->currPos - $p14);
10753 goto choice_2;
10754 } else {
10755 $r16 = self::$FAILED;
10756 }
10757 // free $p17
10758 // free $p14
10759 if (($this->input[$this->currPos] ?? null) === "{") {
10760 $this->currPos++;
10761 $r16 = "{";
10762 goto choice_2;
10763 } else {
10764 if (!$silence) {$this->fail(29);}
10765 $r16 = self::$FAILED;
10766 }
10767 $p14 = $this->currPos;
10768 // start seq_5
10769 $p17 = $this->currPos;
10770 $p19 = $this->currPos;
10771 // start seq_6
10772 $p22 = $this->currPos;
10773 $r23 = $this->parseraw_htmlentity(true);
10774 // rhe <- $r23
10775 if ($r23===self::$FAILED) {
10776 $r21 = self::$FAILED;
10777 goto seq_6;
10778 }
10779 $this->savedPos = $this->currPos;
10780 $r24 = $this->a120($r8, $r9, $r23);
10781 if ($r24) {
10782 $r24 = false;
10783 } else {
10784 $r24 = self::$FAILED;
10785 $this->currPos = $p22;
10786 $r21 = self::$FAILED;
10787 goto seq_6;
10788 }
10789 $r21 = true;
10790 seq_6:
10791 // free $p22
10792 if ($r21 === self::$FAILED) {
10793 $r21 = false;
10794 } else {
10795 $r21 = self::$FAILED;
10796 $this->currPos = $p19;
10797 $r16 = self::$FAILED;
10798 goto seq_5;
10799 }
10800 // free $p19
10801 // start choice_3
10802 $p19 = $this->currPos;
10803 // start seq_7
10804 $p22 = $this->currPos;
10805 $p26 = $this->currPos;
10806 if (($this->input[$this->currPos] ?? null) === "&") {
10807 $this->currPos++;
10808 $r27 = "&";
10809 $r27 = false;
10810 $this->currPos = $p26;
10811 } else {
10812 $r27 = self::$FAILED;
10813 $r25 = self::$FAILED;
10814 goto seq_7;
10815 }
10816 // free $p26
10817 $r28 = $this->parsehtmlentity($silence);
10818 // he <- $r28
10819 if ($r28===self::$FAILED) {
10820 $this->currPos = $p22;
10821 $r25 = self::$FAILED;
10822 goto seq_7;
10823 }
10824 $r25 = true;
10825 seq_7:
10826 if ($r25!==self::$FAILED) {
10827 $this->savedPos = $p19;
10828 $r25 = $this->a9($r8, $r9, $r28);
10829 goto choice_3;
10830 }
10831 // free $p22
10832 if (($this->input[$this->currPos] ?? null) === "&") {
10833 $this->currPos++;
10834 $r25 = "&";
10835 } else {
10836 if (!$silence) {$this->fail(4);}
10837 $r25 = self::$FAILED;
10838 }
10839 choice_3:
10840 // r <- $r25
10841 if ($r25===self::$FAILED) {
10842 $this->currPos = $p17;
10843 $r16 = self::$FAILED;
10844 goto seq_5;
10845 }
10846 $r16 = true;
10847 seq_5:
10848 if ($r16!==self::$FAILED) {
10849 $this->savedPos = $p14;
10850 $r16 = $this->a10($r8, $r9, $r25);
10851 }
10852 // free $p17
10853 choice_2:
10854 // c <- $r16
10855 if ($r16===self::$FAILED) {
10856 $this->currPos = $p13;
10857 $r11 = self::$FAILED;
10858 goto seq_3;
10859 }
10860 $r11 = true;
10861 seq_3:
10862 if ($r11!==self::$FAILED) {
10863 $this->savedPos = $p12;
10864 $r11 = $this->a11($r8, $r9, $r16);
10865 $r10[] = $r11;
10866 } else {
10867 break;
10868 }
10869 // free $p13
10870 }
10871 // path <- $r10
10872 // free $r11
10873 $r6 = true;
10874 seq_2:
10875 // r <- $r6
10876 if ($r6!==self::$FAILED) {
10877 $this->savedPos = $p4;
10878 $r6 = $this->a121($r8, $r9, $r10);
10879 } else {
10880 $this->currPos = $p3;
10881 $r1 = self::$FAILED;
10882 goto seq_1;
10883 }
10884 // free $p7
10885 $this->savedPos = $this->currPos;
10886 $r11 = $this->a122($r6);
10887 if ($r11) {
10888 $r11 = false;
10889 } else {
10890 $r11 = self::$FAILED;
10891 $this->currPos = $p3;
10892 $r1 = self::$FAILED;
10893 goto seq_1;
10894 }
10895 $r1 = true;
10896 seq_1:
10897 if ($r1!==self::$FAILED) {
10898 $this->savedPos = $p2;
10899 $r1 = $this->a123($r6);
10900 }
10901 // free $p3
10902 $this->cache[$bucket][$key] = new GrammarCacheEntry(
10903 $this->currPos,
10904 $r1,
10905 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
10906 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
10907 );
10908 return $r1;
10909 }
10910 private function parseautoref($silence) {
10911 $key = 332;
10912 $bucket = $this->currPos;
10913 $cached = $this->cache[$bucket][$key] ?? null;
10914 if ($cached) {
10915 $this->currPos = $cached->nextPos;
10916
10917 return $cached->result;
10918 }
10919
10920 $p2 = $this->currPos;
10921 // start seq_1
10922 $p3 = $this->currPos;
10923 // start choice_1
10924 $r4 = $this->parseRFC($silence);
10925 if ($r4!==self::$FAILED) {
10926 goto choice_1;
10927 }
10928 $r4 = $this->parsePMID($silence);
10929 choice_1:
10930 // ref <- $r4
10931 if ($r4===self::$FAILED) {
10932 $r1 = self::$FAILED;
10933 goto seq_1;
10934 }
10935 $r5 = [];
10936 for (;;) {
10937 $r6 = $this->parsespace_or_nbsp($silence);
10938 if ($r6!==self::$FAILED) {
10939 $r5[] = $r6;
10940 } else {
10941 break;
10942 }
10943 }
10944 if (count($r5) === 0) {
10945 $r5 = self::$FAILED;
10946 }
10947 // sp <- $r5
10948 if ($r5===self::$FAILED) {
10949 $this->currPos = $p3;
10950 $r1 = self::$FAILED;
10951 goto seq_1;
10952 }
10953 // free $r6
10954 $p7 = $this->currPos;
10955 $r6 = self::$FAILED;
10956 for (;;) {
10957 $r8 = $this->input[$this->currPos] ?? '';
10958 if (preg_match("/^[0-9]/", $r8)) {
10959 $this->currPos++;
10960 $r6 = true;
10961 } else {
10962 $r8 = self::$FAILED;
10963 if (!$silence) {$this->fail(66);}
10964 break;
10965 }
10966 }
10967 // identifier <- $r6
10968 if ($r6!==self::$FAILED) {
10969 $r6 = substr($this->input, $p7, $this->currPos - $p7);
10970 } else {
10971 $r6 = self::$FAILED;
10972 $this->currPos = $p3;
10973 $r1 = self::$FAILED;
10974 goto seq_1;
10975 }
10976 // free $r8
10977 // free $p7
10978 $r8 = $this->discardend_of_word($silence);
10979 if ($r8===self::$FAILED) {
10980 $this->currPos = $p3;
10981 $r1 = self::$FAILED;
10982 goto seq_1;
10983 }
10984 $r1 = true;
10985 seq_1:
10986 if ($r1!==self::$FAILED) {
10987 $this->savedPos = $p2;
10988 $r1 = $this->a124($r4, $r5, $r6);
10989 }
10990 // free $p3
10991 $this->cache[$bucket][$key] = new GrammarCacheEntry(
10992 $this->currPos,
10993 $r1,
10994 self::$UNDEFINED,
10995 self::$UNDEFINED
10996 );
10997 return $r1;
10998 }
10999 private function parseisbn($silence) {
11000 $key = 334;
11001 $bucket = $this->currPos;
11002 $cached = $this->cache[$bucket][$key] ?? null;
11003 if ($cached) {
11004 $this->currPos = $cached->nextPos;
11005
11006 return $cached->result;
11007 }
11008
11009 $p2 = $this->currPos;
11010 // start seq_1
11011 $p3 = $this->currPos;
11012 $this->savedPos = $this->currPos;
11013 $r4 = $this->a125();
11014 if ($r4) {
11015 $r4 = false;
11016 } else {
11017 $r4 = self::$FAILED;
11018 $r1 = self::$FAILED;
11019 goto seq_1;
11020 }
11021 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "ISBN", $this->currPos, 4, false) === 0) {
11022 $r5 = "ISBN";
11023 $this->currPos += 4;
11024 } else {
11025 if (!$silence) {$this->fail(67);}
11026 $r5 = self::$FAILED;
11027 $this->currPos = $p3;
11028 $r1 = self::$FAILED;
11029 goto seq_1;
11030 }
11031 $r6 = [];
11032 for (;;) {
11033 $r7 = $this->parsespace_or_nbsp($silence);
11034 if ($r7!==self::$FAILED) {
11035 $r6[] = $r7;
11036 } else {
11037 break;
11038 }
11039 }
11040 if (count($r6) === 0) {
11041 $r6 = self::$FAILED;
11042 }
11043 // sp <- $r6
11044 if ($r6===self::$FAILED) {
11045 $this->currPos = $p3;
11046 $r1 = self::$FAILED;
11047 goto seq_1;
11048 }
11049 // free $r7
11050 // start seq_2
11051 $p8 = $this->currPos;
11052 $r9 = $this->input[$this->currPos] ?? '';
11053 if (preg_match("/^[0-9]/", $r9)) {
11054 $this->currPos++;
11055 } else {
11056 $r9 = self::$FAILED;
11057 if (!$silence) {$this->fail(66);}
11058 $r7 = self::$FAILED;
11059 goto seq_2;
11060 }
11061 $r10 = [];
11062 for (;;) {
11063 // start seq_3
11064 $p12 = $this->currPos;
11065 // start choice_1
11066 $r13 = $this->parsespace_or_nbsp_or_dash($silence);
11067 if ($r13!==self::$FAILED) {
11068 goto choice_1;
11069 }
11070 $r13 = '';
11071 choice_1:
11072 if ($r13===self::$FAILED) {
11073 $r11 = self::$FAILED;
11074 goto seq_3;
11075 }
11076 $r14 = $this->input[$this->currPos] ?? '';
11077 if (preg_match("/^[0-9]/", $r14)) {
11078 $this->currPos++;
11079 } else {
11080 $r14 = self::$FAILED;
11081 if (!$silence) {$this->fail(66);}
11082 $this->currPos = $p12;
11083 $r11 = self::$FAILED;
11084 goto seq_3;
11085 }
11086 $r11 = [$r13,$r14];
11087 seq_3:
11088 if ($r11!==self::$FAILED) {
11089 $r10[] = $r11;
11090 } else {
11091 break;
11092 }
11093 // free $p12
11094 }
11095 if (count($r10) === 0) {
11096 $r10 = self::$FAILED;
11097 }
11098 if ($r10===self::$FAILED) {
11099 $this->currPos = $p8;
11100 $r7 = self::$FAILED;
11101 goto seq_2;
11102 }
11103 // free $r11
11104 // start choice_2
11105 // start seq_4
11106 $p12 = $this->currPos;
11107 // start choice_3
11108 $r15 = $this->parsespace_or_nbsp_or_dash($silence);
11109 if ($r15!==self::$FAILED) {
11110 goto choice_3;
11111 }
11112 $r15 = '';
11113 choice_3:
11114 if ($r15===self::$FAILED) {
11115 $r11 = self::$FAILED;
11116 goto seq_4;
11117 }
11118 $r16 = $this->input[$this->currPos] ?? '';
11119 if ($r16 === "x" || $r16 === "X") {
11120 $this->currPos++;
11121 } else {
11122 $r16 = self::$FAILED;
11123 if (!$silence) {$this->fail(68);}
11124 $this->currPos = $p12;
11125 $r11 = self::$FAILED;
11126 goto seq_4;
11127 }
11128 $r11 = [$r15,$r16];
11129 seq_4:
11130 if ($r11!==self::$FAILED) {
11131 goto choice_2;
11132 }
11133 // free $p12
11134 $r11 = '';
11135 choice_2:
11136 if ($r11===self::$FAILED) {
11137 $this->currPos = $p8;
11138 $r7 = self::$FAILED;
11139 goto seq_2;
11140 }
11141 $r7 = [$r9,$r10,$r11];
11142 seq_2:
11143 // isbn <- $r7
11144 if ($r7===self::$FAILED) {
11145 $this->currPos = $p3;
11146 $r1 = self::$FAILED;
11147 goto seq_1;
11148 }
11149 // free $p8
11150 $p8 = $this->currPos;
11151 $r17 = $this->discardend_of_word($silence);
11152 // isbncode <- $r17
11153 if ($r17!==self::$FAILED) {
11154 $this->savedPos = $p8;
11155 $r17 = $this->a126($r6, $r7);
11156 } else {
11157 $this->currPos = $p3;
11158 $r1 = self::$FAILED;
11159 goto seq_1;
11160 }
11161 $this->savedPos = $this->currPos;
11162 $r18 = $this->a127($r6, $r7, $r17);
11163 if ($r18) {
11164 $r18 = false;
11165 } else {
11166 $r18 = self::$FAILED;
11167 $this->currPos = $p3;
11168 $r1 = self::$FAILED;
11169 goto seq_1;
11170 }
11171 $r1 = true;
11172 seq_1:
11173 if ($r1!==self::$FAILED) {
11174 $this->savedPos = $p2;
11175 $r1 = $this->a128($r6, $r7, $r17);
11176 }
11177 // free $p3
11178 $this->cache[$bucket][$key] = new GrammarCacheEntry(
11179 $this->currPos,
11180 $r1,
11181 self::$UNDEFINED,
11182 self::$UNDEFINED
11183 );
11184 return $r1;
11185 }
11186 private function discardbehavior_text($silence) {
11187 $key = 323;
11188 $bucket = $this->currPos;
11189 $cached = $this->cache[$bucket][$key] ?? null;
11190 if ($cached) {
11191 $this->currPos = $cached->nextPos;
11192
11193 return $cached->result;
11194 }
11195
11196 $p1 = $this->currPos;
11197 $r2 = self::$FAILED;
11198 for (;;) {
11199 // start seq_1
11200 $p4 = $this->currPos;
11201 $p5 = $this->currPos;
11202 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) {
11203 $r6 = "__";
11204 $this->currPos += 2;
11205 } else {
11206 $r6 = self::$FAILED;
11207 }
11208 if ($r6 === self::$FAILED) {
11209 $r6 = false;
11210 } else {
11211 $r6 = self::$FAILED;
11212 $this->currPos = $p5;
11213 $r3 = self::$FAILED;
11214 goto seq_1;
11215 }
11216 // free $p5
11217 // start choice_1
11218 $r7 = $this->discardtext_char($silence);
11219 if ($r7!==self::$FAILED) {
11220 goto choice_1;
11221 }
11222 if (($this->input[$this->currPos] ?? null) === "-") {
11223 $this->currPos++;
11224 $r7 = "-";
11225 } else {
11226 if (!$silence) {$this->fail(55);}
11227 $r7 = self::$FAILED;
11228 }
11229 choice_1:
11230 if ($r7===self::$FAILED) {
11231 $this->currPos = $p4;
11232 $r3 = self::$FAILED;
11233 goto seq_1;
11234 }
11235 $r3 = true;
11236 seq_1:
11237 if ($r3!==self::$FAILED) {
11238 $r2 = true;
11239 } else {
11240 break;
11241 }
11242 // free $p4
11243 }
11244 if ($r2!==self::$FAILED) {
11245 $r2 = substr($this->input, $p1, $this->currPos - $p1);
11246 } else {
11247 $r2 = self::$FAILED;
11248 }
11249 // free $r3
11250 // free $p1
11251 $this->cache[$bucket][$key] = new GrammarCacheEntry(
11252 $this->currPos,
11253 $r2,
11254 self::$UNDEFINED,
11255 self::$UNDEFINED
11256 );
11257 return $r2;
11258 }
11259 private function parselang_variant($silence, $boolParams, &$param_th, &$param_preproc) {
11260 $key = json_encode([374, $boolParams & 0x3ff7, $param_th, $param_preproc]);
11261 $bucket = $this->currPos;
11262 $cached = $this->cache[$bucket][$key] ?? null;
11263 if ($cached) {
11264 $this->currPos = $cached->nextPos;
11265 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
11266 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
11267 return $cached->result;
11268 }
11269 $saved_th=$param_th;
11270 $saved_preproc=$param_preproc;
11271 // start choice_1
11272 $r1 = $this->parselang_variant_preproc($silence, $boolParams & ~0x8, self::newRef("}-"), $param_th);
11273 if ($r1!==self::$FAILED) {
11274 goto choice_1;
11275 }
11276 $r1 = $this->parsebroken_lang_variant($silence, $param_preproc);
11277 choice_1:
11278 $this->cache[$bucket][$key] = new GrammarCacheEntry(
11279 $this->currPos,
11280 $r1,
11281 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
11282 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
11283 );
11284 return $r1;
11285 }
11286 private function parsewikilink_preproc($silence, $boolParams, &$param_preproc, &$param_th) {
11287 $key = json_encode([406, $boolParams & 0x3fff, $param_preproc, $param_th]);
11288 $bucket = $this->currPos;
11289 $cached = $this->cache[$bucket][$key] ?? null;
11290 if ($cached) {
11291 $this->currPos = $cached->nextPos;
11292 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
11293 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
11294 return $cached->result;
11295 }
11296 $saved_preproc=$param_preproc;
11297 $saved_th=$param_th;
11298 $p2 = $this->currPos;
11299 // start seq_1
11300 $p3 = $this->currPos;
11301 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) {
11302 $r4 = "[[";
11303 $this->currPos += 2;
11304 } else {
11305 if (!$silence) {$this->fail(41);}
11306 $r4 = self::$FAILED;
11307 $r1 = self::$FAILED;
11308 goto seq_1;
11309 }
11310 $p6 = $this->currPos;
11311 $r5 = '';
11312 // spos <- $r5
11313 if ($r5!==self::$FAILED) {
11314 $this->savedPos = $p6;
11315 $r5 = $this->a17();
11316 } else {
11317 $this->currPos = $p3;
11318 $r1 = self::$FAILED;
11319 goto seq_1;
11320 }
11321 $r7 = $this->parsewikilink_preprocessor_text($silence, $boolParams, $param_preproc, $param_th);
11322 if ($r7===self::$FAILED) {
11323 $r7 = null;
11324 }
11325 // target <- $r7
11326 $p9 = $this->currPos;
11327 $r8 = '';
11328 // tpos <- $r8
11329 if ($r8!==self::$FAILED) {
11330 $this->savedPos = $p9;
11331 $r8 = $this->a109($r5, $r7);
11332 } else {
11333 $this->currPos = $p3;
11334 $r1 = self::$FAILED;
11335 goto seq_1;
11336 }
11337 $r10 = $this->parsewikilink_content($silence, $boolParams, $param_preproc, $param_th);
11338 // lcs <- $r10
11339 if ($r10===self::$FAILED) {
11340 $this->currPos = $p3;
11341 $r1 = self::$FAILED;
11342 goto seq_1;
11343 }
11344 $r11 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th);
11345 if ($r11===self::$FAILED) {
11346 $this->currPos = $p3;
11347 $r1 = self::$FAILED;
11348 goto seq_1;
11349 }
11350 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "]]", $this->currPos, 2, false) === 0) {
11351 $r12 = "]]";
11352 $this->currPos += 2;
11353 } else {
11354 if (!$silence) {$this->fail(63);}
11355 $r12 = self::$FAILED;
11356 $this->currPos = $p3;
11357 $r1 = self::$FAILED;
11358 goto seq_1;
11359 }
11360 $r1 = true;
11361 seq_1:
11362 if ($r1!==self::$FAILED) {
11363 $this->savedPos = $p2;
11364 $r1 = $this->a110($r5, $r7, $r8, $r10);
11365 }
11366 // free $p3
11367 $this->cache[$bucket][$key] = new GrammarCacheEntry(
11368 $this->currPos,
11369 $r1,
11370 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
11371 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
11372 );
11373 return $r1;
11374 }
11375 private function parsebroken_wikilink($silence, $boolParams, &$param_preproc, &$param_th) {
11376 $key = json_encode([404, $boolParams & 0x3fff, $param_preproc, $param_th]);
11377 $bucket = $this->currPos;
11378 $cached = $this->cache[$bucket][$key] ?? null;
11379 if ($cached) {
11380 $this->currPos = $cached->nextPos;
11381 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
11382 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
11383 return $cached->result;
11384 }
11385 $saved_preproc=$param_preproc;
11386 $saved_th=$param_th;
11387 $p2 = $this->currPos;
11388 // start seq_1
11389 $p3 = $this->currPos;
11390 $p4 = $this->currPos;
11391 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) {
11392 $r5 = "[[";
11393 $this->currPos += 2;
11394 $r5 = false;
11395 $this->currPos = $p4;
11396 } else {
11397 $r5 = self::$FAILED;
11398 $r1 = self::$FAILED;
11399 goto seq_1;
11400 }
11401 // free $p4
11402 $this->savedPos = $this->currPos;
11403 $r6 = $this->a111($param_preproc);
11404 if ($r6) {
11405 $r6 = false;
11406 } else {
11407 $r6 = self::$FAILED;
11408 $this->currPos = $p3;
11409 $r1 = self::$FAILED;
11410 goto seq_1;
11411 }
11412 // start seq_2
11413 $p4 = $this->currPos;
11414 if (($this->input[$this->currPos] ?? null) === "[") {
11415 $this->currPos++;
11416 $r8 = "[";
11417 } else {
11418 if (!$silence) {$this->fail(19);}
11419 $r8 = self::$FAILED;
11420 $r7 = self::$FAILED;
11421 goto seq_2;
11422 }
11423 // start choice_1
11424 $r9 = $this->parseextlink($silence, $boolParams, $param_preproc, $param_th);
11425 if ($r9!==self::$FAILED) {
11426 goto choice_1;
11427 }
11428 if (($this->input[$this->currPos] ?? null) === "[") {
11429 $this->currPos++;
11430 $r9 = "[";
11431 } else {
11432 if (!$silence) {$this->fail(19);}
11433 $r9 = self::$FAILED;
11434 }
11435 choice_1:
11436 if ($r9===self::$FAILED) {
11437 $this->currPos = $p4;
11438 $r7 = self::$FAILED;
11439 goto seq_2;
11440 }
11441 $r7 = [$r8,$r9];
11442 seq_2:
11443 // a <- $r7
11444 if ($r7===self::$FAILED) {
11445 $this->currPos = $p3;
11446 $r1 = self::$FAILED;
11447 goto seq_1;
11448 }
11449 // free $p4
11450 $r1 = true;
11451 seq_1:
11452 if ($r1!==self::$FAILED) {
11453 $this->savedPos = $p2;
11454 $r1 = $this->a112($param_preproc, $r7);
11455 }
11456 // free $p3
11457 $this->cache[$bucket][$key] = new GrammarCacheEntry(
11458 $this->currPos,
11459 $r1,
11460 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
11461 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
11462 );
11463 return $r1;
11464 }
11465 private function parsetable_heading_tags($silence, $boolParams, &$param_preproc) {
11466 $key = json_encode([474, $boolParams & 0x3fff, $param_preproc]);
11467 $bucket = $this->currPos;
11468 $cached = $this->cache[$bucket][$key] ?? null;
11469 if ($cached) {
11470 $this->currPos = $cached->nextPos;
11471 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
11472 return $cached->result;
11473 }
11474 $saved_preproc=$param_preproc;
11475 $r1 = $this->parsetable_heading_tags_parameterized($silence, $boolParams, $param_preproc, self::newRef(true));
11476 $this->cache[$bucket][$key] = new GrammarCacheEntry(
11477 $this->currPos,
11478 $r1,
11479 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
11480 self::$UNDEFINED
11481 );
11482 return $r1;
11483 }
11484 private function parsetable_row_tag($silence, $boolParams, &$param_preproc, &$param_th) {
11485 $key = json_encode([472, $boolParams & 0x3fbf, $param_preproc, $param_th]);
11486 $bucket = $this->currPos;
11487 $cached = $this->cache[$bucket][$key] ?? null;
11488 if ($cached) {
11489 $this->currPos = $cached->nextPos;
11490 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
11491 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
11492 return $cached->result;
11493 }
11494 $saved_preproc=$param_preproc;
11495 $saved_th=$param_th;
11496 $p2 = $this->currPos;
11497 // start seq_1
11498 $p3 = $this->currPos;
11499 if (!(/*tableDataBlock*/($boolParams & 0x1) !== 0)) {
11500 $r4 = false;
11501 } else {
11502 $r4 = self::$FAILED;
11503 $r1 = self::$FAILED;
11504 goto seq_1;
11505 }
11506 $r5 = $this->parsepipe($silence);
11507 // p <- $r5
11508 if ($r5===self::$FAILED) {
11509 $this->currPos = $p3;
11510 $r1 = self::$FAILED;
11511 goto seq_1;
11512 }
11513 $p7 = $this->currPos;
11514 $r6 = self::$FAILED;
11515 for (;;) {
11516 if (($this->input[$this->currPos] ?? null) === "-") {
11517 $this->currPos++;
11518 $r8 = "-";
11519 $r6 = true;
11520 } else {
11521 if (!$silence) {$this->fail(55);}
11522 $r8 = self::$FAILED;
11523 break;
11524 }
11525 }
11526 // dashes <- $r6
11527 if ($r6!==self::$FAILED) {
11528 $r6 = substr($this->input, $p7, $this->currPos - $p7);
11529 } else {
11530 $r6 = self::$FAILED;
11531 $this->currPos = $p3;
11532 $r1 = self::$FAILED;
11533 goto seq_1;
11534 }
11535 // free $r8
11536 // free $p7
11537 // start choice_1
11538 $r8 = $this->parsetable_attributes($silence, $boolParams & ~0x40, $param_preproc, $param_th);
11539 if ($r8!==self::$FAILED) {
11540 goto choice_1;
11541 }
11542 $this->savedPos = $this->currPos;
11543 $r8 = $this->a129($r5, $r6);
11544 if ($r8) {
11545 $r8 = false;
11546 } else {
11547 $r8 = self::$FAILED;
11548 }
11549 choice_1:
11550 // a <- $r8
11551 if ($r8===self::$FAILED) {
11552 $this->currPos = $p3;
11553 $r1 = self::$FAILED;
11554 goto seq_1;
11555 }
11556 $p7 = $this->currPos;
11557 $r9 = '';
11558 // tagEndPos <- $r9
11559 if ($r9!==self::$FAILED) {
11560 $this->savedPos = $p7;
11561 $r9 = $this->a130($r5, $r6, $r8);
11562 } else {
11563 $this->currPos = $p3;
11564 $r1 = self::$FAILED;
11565 goto seq_1;
11566 }
11567 $r10 = [];
11568 for (;;) {
11569 $r11 = $this->parsespace($silence);
11570 if ($r11!==self::$FAILED) {
11571 $r10[] = $r11;
11572 } else {
11573 break;
11574 }
11575 }
11576 // s2 <- $r10
11577 // free $r11
11578 $r1 = true;
11579 seq_1:
11580 if ($r1!==self::$FAILED) {
11581 $this->savedPos = $p2;
11582 $r1 = $this->a131($r5, $r6, $r8, $r9, $r10);
11583 }
11584 // free $p3
11585 $this->cache[$bucket][$key] = new GrammarCacheEntry(
11586 $this->currPos,
11587 $r1,
11588 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
11589 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
11590 );
11591 return $r1;
11592 }
11593 private function parsetable_data_tags($silence, $boolParams, &$param_preproc, &$param_th) {
11594 $key = json_encode([482, $boolParams & 0x3fff, $param_preproc, $param_th]);
11595 $bucket = $this->currPos;
11596 $cached = $this->cache[$bucket][$key] ?? null;
11597 if ($cached) {
11598 $this->currPos = $cached->nextPos;
11599 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
11600 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
11601 return $cached->result;
11602 }
11603 $saved_preproc=$param_preproc;
11604 $saved_th=$param_th;
11605 $p2 = $this->currPos;
11606 // start seq_1
11607 $p3 = $this->currPos;
11608 if (!(/*tableDataBlock*/($boolParams & 0x1) !== 0)) {
11609 $r4 = false;
11610 } else {
11611 $r4 = self::$FAILED;
11612 $r1 = self::$FAILED;
11613 goto seq_1;
11614 }
11615 $r5 = $this->parsepipe($silence);
11616 // p <- $r5
11617 if ($r5===self::$FAILED) {
11618 $this->currPos = $p3;
11619 $r1 = self::$FAILED;
11620 goto seq_1;
11621 }
11622 $p6 = $this->currPos;
11623 $r7 = $this->input[$this->currPos] ?? '';
11624 if ($r7 === "+" || $r7 === "-") {
11625 $this->currPos++;
11626 } else {
11627 $r7 = self::$FAILED;
11628 }
11629 if ($r7 === self::$FAILED) {
11630 $r7 = false;
11631 } else {
11632 $r7 = self::$FAILED;
11633 $this->currPos = $p6;
11634 $this->currPos = $p3;
11635 $r1 = self::$FAILED;
11636 goto seq_1;
11637 }
11638 // free $p6
11639 $r8 = $this->parsetable_data_tag($silence, $boolParams, $param_preproc, $param_th);
11640 // td <- $r8
11641 if ($r8===self::$FAILED) {
11642 $this->currPos = $p3;
11643 $r1 = self::$FAILED;
11644 goto seq_1;
11645 }
11646 $r9 = $this->parsetds($silence, $boolParams, $param_preproc, $param_th);
11647 // tds <- $r9
11648 if ($r9===self::$FAILED) {
11649 $this->currPos = $p3;
11650 $r1 = self::$FAILED;
11651 goto seq_1;
11652 }
11653 $r1 = true;
11654 seq_1:
11655 if ($r1!==self::$FAILED) {
11656 $this->savedPos = $p2;
11657 $r1 = $this->a132($r5, $r8, $r9);
11658 }
11659 // free $p3
11660 $this->cache[$bucket][$key] = new GrammarCacheEntry(
11661 $this->currPos,
11662 $r1,
11663 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
11664 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
11665 );
11666 return $r1;
11667 }
11668 private function parsetable_caption_tag($silence, $boolParams, &$param_preproc, &$param_th) {
11669 $key = json_encode([470, $boolParams & 0x3fff, $param_preproc, $param_th]);
11670 $bucket = $this->currPos;
11671 $cached = $this->cache[$bucket][$key] ?? null;
11672 if ($cached) {
11673 $this->currPos = $cached->nextPos;
11674 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
11675 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
11676 return $cached->result;
11677 }
11678 $saved_preproc=$param_preproc;
11679 $saved_th=$param_th;
11680 $p2 = $this->currPos;
11681 // start seq_1
11682 $p3 = $this->currPos;
11683 if (!(/*tableDataBlock*/($boolParams & 0x1) !== 0)) {
11684 $r4 = false;
11685 } else {
11686 $r4 = self::$FAILED;
11687 $r1 = self::$FAILED;
11688 goto seq_1;
11689 }
11690 $r5 = $this->parsepipe($silence);
11691 // p <- $r5
11692 if ($r5===self::$FAILED) {
11693 $this->currPos = $p3;
11694 $r1 = self::$FAILED;
11695 goto seq_1;
11696 }
11697 if (($this->input[$this->currPos] ?? null) === "+") {
11698 $this->currPos++;
11699 $r6 = "+";
11700 } else {
11701 if (!$silence) {$this->fail(69);}
11702 $r6 = self::$FAILED;
11703 $this->currPos = $p3;
11704 $r1 = self::$FAILED;
11705 goto seq_1;
11706 }
11707 $r7 = $this->parserow_syntax_table_args($silence, $boolParams, $param_preproc, $param_th);
11708 if ($r7===self::$FAILED) {
11709 $r7 = null;
11710 }
11711 // args <- $r7
11712 $p9 = $this->currPos;
11713 $r8 = '';
11714 // tagEndPos <- $r8
11715 if ($r8!==self::$FAILED) {
11716 $this->savedPos = $p9;
11717 $r8 = $this->a133($r5, $r7);
11718 } else {
11719 $this->currPos = $p3;
11720 $r1 = self::$FAILED;
11721 goto seq_1;
11722 }
11723 $r10 = [];
11724 for (;;) {
11725 $r11 = $this->parsenested_block_in_table($silence, $boolParams, $param_preproc, $param_th);
11726 if ($r11!==self::$FAILED) {
11727 $r10[] = $r11;
11728 } else {
11729 break;
11730 }
11731 }
11732 // c <- $r10
11733 // free $r11
11734 $r1 = true;
11735 seq_1:
11736 if ($r1!==self::$FAILED) {
11737 $this->savedPos = $p2;
11738 $r1 = $this->a134($r5, $r7, $r8, $r10);
11739 }
11740 // free $p3
11741 $this->cache[$bucket][$key] = new GrammarCacheEntry(
11742 $this->currPos,
11743 $r1,
11744 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
11745 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
11746 );
11747 return $r1;
11748 }
11749 private function parsenewline($silence) {
11750 $key = 534;
11751 $bucket = $this->currPos;
11752 $cached = $this->cache[$bucket][$key] ?? null;
11753 if ($cached) {
11754 $this->currPos = $cached->nextPos;
11755
11756 return $cached->result;
11757 }
11758
11759 // start choice_1
11760 if (($this->input[$this->currPos] ?? null) === "\x0a") {
11761 $this->currPos++;
11762 $r1 = "\x0a";
11763 goto choice_1;
11764 } else {
11765 if (!$silence) {$this->fail(27);}
11766 $r1 = self::$FAILED;
11767 }
11768 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "\x0d\x0a", $this->currPos, 2, false) === 0) {
11769 $r1 = "\x0d\x0a";
11770 $this->currPos += 2;
11771 } else {
11772 if (!$silence) {$this->fail(28);}
11773 $r1 = self::$FAILED;
11774 }
11775 choice_1:
11776 $this->cache[$bucket][$key] = new GrammarCacheEntry(
11777 $this->currPos,
11778 $r1,
11779 self::$UNDEFINED,
11780 self::$UNDEFINED
11781 );
11782 return $r1;
11783 }
11784 private function discardsol($silence, $boolParams, &$param_preproc, &$param_th) {
11785 $key = json_encode([559, $boolParams & 0x3ebf, $param_preproc, $param_th]);
11786 $bucket = $this->currPos;
11787 $cached = $this->cache[$bucket][$key] ?? null;
11788 if ($cached) {
11789 $this->currPos = $cached->nextPos;
11790 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
11791 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
11792 return $cached->result;
11793 }
11794 $saved_preproc=$param_preproc;
11795 $saved_th=$param_th;
11796 // start seq_1
11797 $p1 = $this->currPos;
11798 // start choice_1
11799 $r3 = $this->discardempty_line_with_comments($silence);
11800 if ($r3!==self::$FAILED) {
11801 goto choice_1;
11802 }
11803 $r3 = $this->discardsol_prefix($silence);
11804 choice_1:
11805 if ($r3===self::$FAILED) {
11806 $r2 = self::$FAILED;
11807 goto seq_1;
11808 }
11809 for (;;) {
11810 $r5 = $this->discardsol_transparent($silence, $boolParams, $param_preproc, $param_th);
11811 if ($r5===self::$FAILED) {
11812 break;
11813 }
11814 }
11815 // free $r5
11816 $r4 = true;
11817 if ($r4===self::$FAILED) {
11818 $this->currPos = $p1;
11819 $r2 = self::$FAILED;
11820 goto seq_1;
11821 }
11822 // free $r4
11823 $r2 = true;
11824 seq_1:
11825 // free $r2,$p1
11826 $this->cache[$bucket][$key] = new GrammarCacheEntry(
11827 $this->currPos,
11828 $r2,
11829 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
11830 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
11831 );
11832 return $r2;
11833 }
11834 private function parsetemplate_param_value($silence, $boolParams, &$param_preproc, &$param_th) {
11835 $key = json_encode([366, $boolParams & 0x3e17, $param_preproc, $param_th]);
11836 $bucket = $this->currPos;
11837 $cached = $this->cache[$bucket][$key] ?? null;
11838 if ($cached) {
11839 $this->currPos = $cached->nextPos;
11840 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
11841 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
11842 return $cached->result;
11843 }
11844 $saved_preproc=$param_preproc;
11845 $saved_th=$param_th;
11846 $p2 = $this->currPos;
11847 $r3 = $this->parsetemplate_param_text($silence, $boolParams & ~0x20, $param_preproc, $param_th);
11848 // tpt <- $r3
11849 $r1 = $r3;
11850 if ($r1!==self::$FAILED) {
11851 $this->savedPos = $p2;
11852 $r1 = $this->a135($r3);
11853 }
11854 $this->cache[$bucket][$key] = new GrammarCacheEntry(
11855 $this->currPos,
11856 $r1,
11857 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
11858 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
11859 );
11860 return $r1;
11861 }
11862 private function discardnl_comment_space($silence) {
11863 $key = 543;
11864 $bucket = $this->currPos;
11865 $cached = $this->cache[$bucket][$key] ?? null;
11866 if ($cached) {
11867 $this->currPos = $cached->nextPos;
11868
11869 return $cached->result;
11870 }
11871
11872 // start choice_1
11873 $r1 = $this->discardnewlineToken($silence);
11874 if ($r1!==self::$FAILED) {
11875 goto choice_1;
11876 }
11877 $r1 = $this->discardspace($silence);
11878 if ($r1!==self::$FAILED) {
11879 goto choice_1;
11880 }
11881 $r1 = $this->discardcomment($silence);
11882 choice_1:
11883 $this->cache[$bucket][$key] = new GrammarCacheEntry(
11884 $this->currPos,
11885 $r1,
11886 self::$UNDEFINED,
11887 self::$UNDEFINED
11888 );
11889 return $r1;
11890 }
11891 private function parsenl_comment_space($silence) {
11892 $key = 542;
11893 $bucket = $this->currPos;
11894 $cached = $this->cache[$bucket][$key] ?? null;
11895 if ($cached) {
11896 $this->currPos = $cached->nextPos;
11897
11898 return $cached->result;
11899 }
11900
11901 // start choice_1
11902 $r1 = $this->parsenewlineToken($silence);
11903 if ($r1!==self::$FAILED) {
11904 goto choice_1;
11905 }
11906 $r1 = $this->parsespace($silence);
11907 if ($r1!==self::$FAILED) {
11908 goto choice_1;
11909 }
11910 $r1 = $this->parsecomment($silence);
11911 choice_1:
11912 $this->cache[$bucket][$key] = new GrammarCacheEntry(
11913 $this->currPos,
11914 $r1,
11915 self::$UNDEFINED,
11916 self::$UNDEFINED
11917 );
11918 return $r1;
11919 }
11920 private function parsetemplate_param($silence, $boolParams, &$param_preproc, &$param_th) {
11921 $key = json_encode([362, $boolParams & 0x3e17, $param_preproc, $param_th]);
11922 $bucket = $this->currPos;
11923 $cached = $this->cache[$bucket][$key] ?? null;
11924 if ($cached) {
11925 $this->currPos = $cached->nextPos;
11926 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
11927 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
11928 return $cached->result;
11929 }
11930 $saved_preproc=$param_preproc;
11931 $saved_th=$param_th;
11932 // start choice_1
11933 $p2 = $this->currPos;
11934 // start seq_1
11935 $p3 = $this->currPos;
11936 $r4 = $this->parsetemplate_param_name($silence, $boolParams, $param_preproc, $param_th);
11937 // name <- $r4
11938 if ($r4===self::$FAILED) {
11939 $r1 = self::$FAILED;
11940 goto seq_1;
11941 }
11942 $p6 = $this->currPos;
11943 // start seq_2
11944 $p7 = $this->currPos;
11945 $p9 = $this->currPos;
11946 $r8 = '';
11947 // kEndPos <- $r8
11948 if ($r8!==self::$FAILED) {
11949 $this->savedPos = $p9;
11950 $r8 = $this->a136($r4);
11951 } else {
11952 $r5 = self::$FAILED;
11953 goto seq_2;
11954 }
11955 if (($this->input[$this->currPos] ?? null) === "=") {
11956 $this->currPos++;
11957 $r10 = "=";
11958 } else {
11959 if (!$silence) {$this->fail(23);}
11960 $r10 = self::$FAILED;
11961 $this->currPos = $p7;
11962 $r5 = self::$FAILED;
11963 goto seq_2;
11964 }
11965 $p12 = $this->currPos;
11966 $r11 = '';
11967 // vStartPos <- $r11
11968 if ($r11!==self::$FAILED) {
11969 $this->savedPos = $p12;
11970 $r11 = $this->a137($r4, $r8);
11971 } else {
11972 $this->currPos = $p7;
11973 $r5 = self::$FAILED;
11974 goto seq_2;
11975 }
11976 $r13 = $this->parseoptionalSpaceToken($silence);
11977 // optSp <- $r13
11978 if ($r13===self::$FAILED) {
11979 $this->currPos = $p7;
11980 $r5 = self::$FAILED;
11981 goto seq_2;
11982 }
11983 $r14 = $this->parsetemplate_param_value($silence, $boolParams, $param_preproc, $param_th);
11984 if ($r14===self::$FAILED) {
11985 $r14 = null;
11986 }
11987 // tpv <- $r14
11988 $r5 = true;
11989 seq_2:
11990 if ($r5!==self::$FAILED) {
11991 $this->savedPos = $p6;
11992 $r5 = $this->a138($r4, $r8, $r11, $r13, $r14);
11993 } else {
11994 $r5 = null;
11995 }
11996 // free $p7
11997 // val <- $r5
11998 $r1 = true;
11999 seq_1:
12000 if ($r1!==self::$FAILED) {
12001 $this->savedPos = $p2;
12002 $r1 = $this->a139($r4, $r5);
12003 goto choice_1;
12004 }
12005 // free $p3
12006 $p3 = $this->currPos;
12007 $p7 = $this->currPos;
12008 $r1 = $this->input[$this->currPos] ?? '';
12009 if ($r1 === "|" || $r1 === "}") {
12010 $this->currPos++;
12011 $r1 = false;
12012 $this->currPos = $p7;
12013 $this->savedPos = $p3;
12014 $r1 = $this->a140();
12015 } else {
12016 $r1 = self::$FAILED;
12017 }
12018 // free $p7
12019 choice_1:
12020 $this->cache[$bucket][$key] = new GrammarCacheEntry(
12021 $this->currPos,
12022 $r1,
12023 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
12024 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
12025 );
12026 return $r1;
12027 }
12028 private function parsewikilink_preprocessor_text($silence, $boolParams, &$param_preproc, &$param_th) {
12029 $key = json_encode([504, $boolParams & 0x3fff, $param_preproc, $param_th]);
12030 $bucket = $this->currPos;
12031 $cached = $this->cache[$bucket][$key] ?? null;
12032 if ($cached) {
12033 $this->currPos = $cached->nextPos;
12034 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
12035 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
12036 return $cached->result;
12037 }
12038 $saved_preproc=$param_preproc;
12039 $saved_th=$param_th;
12040 $p2 = $this->currPos;
12041 $r3 = [];
12042 for (;;) {
12043 // start choice_1
12044 $p6 = $this->currPos;
12045 $r5 = self::$FAILED;
12046 for (;;) {
12047 if (strcspn($this->input, "<[{\x0a\x0d\x09|!]}{ &-", $this->currPos, 1) !== 0) {
12048 $r7 = self::consumeChar($this->input, $this->currPos);
12049 $r5 = true;
12050 } else {
12051 $r7 = self::$FAILED;
12052 if (!$silence) {$this->fail(70);}
12053 break;
12054 }
12055 }
12056 // t <- $r5
12057 if ($r5!==self::$FAILED) {
12058 $r5 = substr($this->input, $p6, $this->currPos - $p6);
12059 } else {
12060 $r5 = self::$FAILED;
12061 }
12062 // free $r7
12063 // free $p6
12064 $r4 = $r5;
12065 if ($r4!==self::$FAILED) {
12066 goto choice_1;
12067 }
12068 $p6 = $this->currPos;
12069 // start seq_1
12070 $p8 = $this->currPos;
12071 $p9 = $this->currPos;
12072 $r7 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
12073 if ($r7 === self::$FAILED) {
12074 $r7 = false;
12075 } else {
12076 $r7 = self::$FAILED;
12077 $this->currPos = $p9;
12078 $r4 = self::$FAILED;
12079 goto seq_1;
12080 }
12081 // free $p9
12082 // start choice_2
12083 $r10 = $this->parsedirective($silence, $boolParams, $param_preproc, $param_th);
12084 if ($r10!==self::$FAILED) {
12085 goto choice_2;
12086 }
12087 $p9 = $this->currPos;
12088 // start seq_2
12089 $p11 = $this->currPos;
12090 $p12 = $this->currPos;
12091 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "]]", $this->currPos, 2, false) === 0) {
12092 $r13 = "]]";
12093 $this->currPos += 2;
12094 } else {
12095 $r13 = self::$FAILED;
12096 }
12097 if ($r13 === self::$FAILED) {
12098 $r13 = false;
12099 } else {
12100 $r13 = self::$FAILED;
12101 $this->currPos = $p12;
12102 $r10 = self::$FAILED;
12103 goto seq_2;
12104 }
12105 // free $p12
12106 // start choice_3
12107 $r14 = $this->discardtext_char($silence);
12108 if ($r14!==self::$FAILED) {
12109 goto choice_3;
12110 }
12111 if (strspn($this->input, "!<-}]\x0a\x0d", $this->currPos, 1) !== 0) {
12112 $r14 = $this->input[$this->currPos++];
12113 } else {
12114 $r14 = self::$FAILED;
12115 if (!$silence) {$this->fail(71);}
12116 }
12117 choice_3:
12118 if ($r14===self::$FAILED) {
12119 $this->currPos = $p11;
12120 $r10 = self::$FAILED;
12121 goto seq_2;
12122 }
12123 $r10 = true;
12124 seq_2:
12125 if ($r10!==self::$FAILED) {
12126 $r10 = substr($this->input, $p9, $this->currPos - $p9);
12127 } else {
12128 $r10 = self::$FAILED;
12129 }
12130 // free $p11
12131 // free $p9
12132 choice_2:
12133 // wr <- $r10
12134 if ($r10===self::$FAILED) {
12135 $this->currPos = $p8;
12136 $r4 = self::$FAILED;
12137 goto seq_1;
12138 }
12139 $r4 = true;
12140 seq_1:
12141 if ($r4!==self::$FAILED) {
12142 $this->savedPos = $p6;
12143 $r4 = $this->a141($r5, $r10);
12144 }
12145 // free $p8
12146 choice_1:
12147 if ($r4!==self::$FAILED) {
12148 $r3[] = $r4;
12149 } else {
12150 break;
12151 }
12152 }
12153 if (count($r3) === 0) {
12154 $r3 = self::$FAILED;
12155 }
12156 // r <- $r3
12157 // free $r4
12158 $r1 = $r3;
12159 if ($r1!==self::$FAILED) {
12160 $this->savedPos = $p2;
12161 $r1 = $this->a142($r3);
12162 }
12163 $this->cache[$bucket][$key] = new GrammarCacheEntry(
12164 $this->currPos,
12165 $r1,
12166 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
12167 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
12168 );
12169 return $r1;
12170 }
12171 private function parsewikilink_content($silence, $boolParams, &$param_preproc, &$param_th) {
12172 $key = json_encode([400, $boolParams & 0x37df, $param_preproc, $param_th]);
12173 $bucket = $this->currPos;
12174 $cached = $this->cache[$bucket][$key] ?? null;
12175 if ($cached) {
12176 $this->currPos = $cached->nextPos;
12177 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
12178 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
12179 return $cached->result;
12180 }
12181 $saved_preproc=$param_preproc;
12182 $saved_th=$param_th;
12183 $r1 = [];
12184 for (;;) {
12185 $p3 = $this->currPos;
12186 // start seq_1
12187 $p4 = $this->currPos;
12188 $r5 = $this->discardpipe($silence);
12189 if ($r5===self::$FAILED) {
12190 $r2 = self::$FAILED;
12191 goto seq_1;
12192 }
12193 $p7 = $this->currPos;
12194 $r6 = '';
12195 // startPos <- $r6
12196 if ($r6!==self::$FAILED) {
12197 $this->savedPos = $p7;
12198 $r6 = $this->a17();
12199 } else {
12200 $this->currPos = $p4;
12201 $r2 = self::$FAILED;
12202 goto seq_1;
12203 }
12204 $r8 = $this->parselink_text($silence, $boolParams, $param_preproc, $param_th);
12205 if ($r8===self::$FAILED) {
12206 $r8 = null;
12207 }
12208 // lt <- $r8
12209 $r2 = true;
12210 seq_1:
12211 if ($r2!==self::$FAILED) {
12212 $this->savedPos = $p3;
12213 $r2 = $this->a143($r6, $r8);
12214 $r1[] = $r2;
12215 } else {
12216 break;
12217 }
12218 // free $p4
12219 }
12220 // free $r2
12221 $this->cache[$bucket][$key] = new GrammarCacheEntry(
12222 $this->currPos,
12223 $r1,
12224 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
12225 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
12226 );
12227 return $r1;
12228 }
12229 private function parsetag_name($silence) {
12230 $key = 424;
12231 $bucket = $this->currPos;
12232 $cached = $this->cache[$bucket][$key] ?? null;
12233 if ($cached) {
12234 $this->currPos = $cached->nextPos;
12235
12236 return $cached->result;
12237 }
12238
12239 $p1 = $this->currPos;
12240 $r2 = self::$FAILED;
12241 for (;;) {
12242 if (strcspn($this->input, "\x09\x0a\x0b />\x00", $this->currPos, 1) !== 0) {
12243 $r3 = self::consumeChar($this->input, $this->currPos);
12244 $r2 = true;
12245 } else {
12246 $r3 = self::$FAILED;
12247 if (!$silence) {$this->fail(72);}
12248 break;
12249 }
12250 }
12251 if ($r2!==self::$FAILED) {
12252 $r2 = substr($this->input, $p1, $this->currPos - $p1);
12253 } else {
12254 $r2 = self::$FAILED;
12255 }
12256 // free $r3
12257 // free $p1
12258 $this->cache[$bucket][$key] = new GrammarCacheEntry(
12259 $this->currPos,
12260 $r2,
12261 self::$UNDEFINED,
12262 self::$UNDEFINED
12263 );
12264 return $r2;
12265 }
12266 private function parseRFC($silence) {
12267 $key = 328;
12268 $bucket = $this->currPos;
12269 $cached = $this->cache[$bucket][$key] ?? null;
12270 if ($cached) {
12271 $this->currPos = $cached->nextPos;
12272
12273 return $cached->result;
12274 }
12275
12276 $p2 = $this->currPos;
12277 // start seq_1
12278 $p3 = $this->currPos;
12279 $this->savedPos = $this->currPos;
12280 $r4 = $this->a144();
12281 if ($r4) {
12282 $r4 = false;
12283 } else {
12284 $r4 = self::$FAILED;
12285 $r1 = self::$FAILED;
12286 goto seq_1;
12287 }
12288 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "RFC", $this->currPos, 3, false) === 0) {
12289 $r5 = "RFC";
12290 $this->currPos += 3;
12291 } else {
12292 if (!$silence) {$this->fail(73);}
12293 $r5 = self::$FAILED;
12294 $this->currPos = $p3;
12295 $r1 = self::$FAILED;
12296 goto seq_1;
12297 }
12298 $r1 = true;
12299 seq_1:
12300 if ($r1!==self::$FAILED) {
12301 $this->savedPos = $p2;
12302 $r1 = $this->a145();
12303 }
12304 // free $p3
12305 $this->cache[$bucket][$key] = new GrammarCacheEntry(
12306 $this->currPos,
12307 $r1,
12308 self::$UNDEFINED,
12309 self::$UNDEFINED
12310 );
12311 return $r1;
12312 }
12313 private function parsePMID($silence) {
12314 $key = 330;
12315 $bucket = $this->currPos;
12316 $cached = $this->cache[$bucket][$key] ?? null;
12317 if ($cached) {
12318 $this->currPos = $cached->nextPos;
12319
12320 return $cached->result;
12321 }
12322
12323 $p2 = $this->currPos;
12324 // start seq_1
12325 $p3 = $this->currPos;
12326 $this->savedPos = $this->currPos;
12327 $r4 = $this->a146();
12328 if ($r4) {
12329 $r4 = false;
12330 } else {
12331 $r4 = self::$FAILED;
12332 $r1 = self::$FAILED;
12333 goto seq_1;
12334 }
12335 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "PMID", $this->currPos, 4, false) === 0) {
12336 $r5 = "PMID";
12337 $this->currPos += 4;
12338 } else {
12339 if (!$silence) {$this->fail(74);}
12340 $r5 = self::$FAILED;
12341 $this->currPos = $p3;
12342 $r1 = self::$FAILED;
12343 goto seq_1;
12344 }
12345 $r1 = true;
12346 seq_1:
12347 if ($r1!==self::$FAILED) {
12348 $this->savedPos = $p2;
12349 $r1 = $this->a147();
12350 }
12351 // free $p3
12352 $this->cache[$bucket][$key] = new GrammarCacheEntry(
12353 $this->currPos,
12354 $r1,
12355 self::$UNDEFINED,
12356 self::$UNDEFINED
12357 );
12358 return $r1;
12359 }
12360 private function parsespace_or_nbsp($silence) {
12361 $key = 552;
12362 $bucket = $this->currPos;
12363 $cached = $this->cache[$bucket][$key] ?? null;
12364 if ($cached) {
12365 $this->currPos = $cached->nextPos;
12366
12367 return $cached->result;
12368 }
12369
12370 // start choice_1
12371 $r1 = $this->parsespace($silence);
12372 if ($r1!==self::$FAILED) {
12373 goto choice_1;
12374 }
12375 $r1 = $this->parseunispace($silence);
12376 if ($r1!==self::$FAILED) {
12377 goto choice_1;
12378 }
12379 $p2 = $this->currPos;
12380 // start seq_1
12381 $p3 = $this->currPos;
12382 $p4 = $this->currPos;
12383 if (($this->input[$this->currPos] ?? null) === "&") {
12384 $this->currPos++;
12385 $r5 = "&";
12386 $r5 = false;
12387 $this->currPos = $p4;
12388 } else {
12389 $r5 = self::$FAILED;
12390 $r1 = self::$FAILED;
12391 goto seq_1;
12392 }
12393 // free $p4
12394 $r6 = $this->parsehtmlentity($silence);
12395 // he <- $r6
12396 if ($r6===self::$FAILED) {
12397 $this->currPos = $p3;
12398 $r1 = self::$FAILED;
12399 goto seq_1;
12400 }
12401 $this->savedPos = $this->currPos;
12402 $r7 = $this->a148($r6);
12403 if ($r7) {
12404 $r7 = false;
12405 } else {
12406 $r7 = self::$FAILED;
12407 $this->currPos = $p3;
12408 $r1 = self::$FAILED;
12409 goto seq_1;
12410 }
12411 $r1 = true;
12412 seq_1:
12413 if ($r1!==self::$FAILED) {
12414 $this->savedPos = $p2;
12415 $r1 = $this->a64($r6);
12416 }
12417 // free $p3
12418 choice_1:
12419 $this->cache[$bucket][$key] = new GrammarCacheEntry(
12420 $this->currPos,
12421 $r1,
12422 self::$UNDEFINED,
12423 self::$UNDEFINED
12424 );
12425 return $r1;
12426 }
12427 private function discardend_of_word($silence) {
12428 $key = 549;
12429 $bucket = $this->currPos;
12430 $cached = $this->cache[$bucket][$key] ?? null;
12431 if ($cached) {
12432 $this->currPos = $cached->nextPos;
12433
12434 return $cached->result;
12435 }
12436
12437 // start choice_1
12438 $r1 = $this->discardeof($silence);
12439 if ($r1!==self::$FAILED) {
12440 goto choice_1;
12441 }
12442 $p2 = $this->currPos;
12443 $r1 = $this->input[$this->currPos] ?? '';
12444 if (preg_match("/^[A-Za-z0-9_]/", $r1)) {
12445 $this->currPos++;
12446 } else {
12447 $r1 = self::$FAILED;
12448 }
12449 if ($r1 === self::$FAILED) {
12450 $r1 = false;
12451 } else {
12452 $r1 = self::$FAILED;
12453 $this->currPos = $p2;
12454 }
12455 // free $p2
12456 choice_1:
12457 $this->cache[$bucket][$key] = new GrammarCacheEntry(
12458 $this->currPos,
12459 $r1,
12460 self::$UNDEFINED,
12461 self::$UNDEFINED
12462 );
12463 return $r1;
12464 }
12465 private function parsespace_or_nbsp_or_dash($silence) {
12466 $key = 554;
12467 $bucket = $this->currPos;
12468 $cached = $this->cache[$bucket][$key] ?? null;
12469 if ($cached) {
12470 $this->currPos = $cached->nextPos;
12471
12472 return $cached->result;
12473 }
12474
12475 // start choice_1
12476 $r1 = $this->parsespace_or_nbsp($silence);
12477 if ($r1!==self::$FAILED) {
12478 goto choice_1;
12479 }
12480 if (($this->input[$this->currPos] ?? null) === "-") {
12481 $this->currPos++;
12482 $r1 = "-";
12483 } else {
12484 if (!$silence) {$this->fail(55);}
12485 $r1 = self::$FAILED;
12486 }
12487 choice_1:
12488 $this->cache[$bucket][$key] = new GrammarCacheEntry(
12489 $this->currPos,
12490 $r1,
12491 self::$UNDEFINED,
12492 self::$UNDEFINED
12493 );
12494 return $r1;
12495 }
12496 private function discardtext_char($silence) {
12497 $key = 493;
12498 $bucket = $this->currPos;
12499 $cached = $this->cache[$bucket][$key] ?? null;
12500 if ($cached) {
12501 $this->currPos = $cached->nextPos;
12502
12503 return $cached->result;
12504 }
12505
12506 if (strcspn($this->input, "-'<[{\x0a\x0d:;]}|!=", $this->currPos, 1) !== 0) {
12507 $r1 = self::consumeChar($this->input, $this->currPos);
12508 } else {
12509 $r1 = self::$FAILED;
12510 if (!$silence) {$this->fail(54);}
12511 }
12512 $this->cache[$bucket][$key] = new GrammarCacheEntry(
12513 $this->currPos,
12514 $r1,
12515 self::$UNDEFINED,
12516 self::$UNDEFINED
12517 );
12518 return $r1;
12519 }
12520 private function parselang_variant_preproc($silence, $boolParams, &$param_preproc, &$param_th) {
12521 $key = json_encode([376, $boolParams & 0x3fff, $param_preproc, $param_th]);
12522 $bucket = $this->currPos;
12523 $cached = $this->cache[$bucket][$key] ?? null;
12524 if ($cached) {
12525 $this->currPos = $cached->nextPos;
12526 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
12527 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
12528 return $cached->result;
12529 }
12530 $saved_preproc=$param_preproc;
12531 $saved_th=$param_th;
12532 $p2 = $this->currPos;
12533 // start seq_1
12534 $p3 = $this->currPos;
12535 $p5 = $this->currPos;
12536 // lv0 <- $r4
12537 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) {
12538 $r4 = "-{";
12539 $this->currPos += 2;
12540 $this->savedPos = $p5;
12541 $r4 = $this->a149();
12542 } else {
12543 if (!$silence) {$this->fail(75);}
12544 $r4 = self::$FAILED;
12545 $r1 = self::$FAILED;
12546 goto seq_1;
12547 }
12548 // start choice_1
12549 $p7 = $this->currPos;
12550 // start seq_2
12551 $p8 = $this->currPos;
12552 $this->savedPos = $this->currPos;
12553 $r9 = $this->a150($r4);
12554 if ($r9) {
12555 $r9 = false;
12556 } else {
12557 $r9 = self::$FAILED;
12558 $r6 = self::$FAILED;
12559 goto seq_2;
12560 }
12561 $r10 = $this->parseopt_lang_variant_flags($silence, $boolParams, $param_preproc, $param_th);
12562 // ff <- $r10
12563 if ($r10===self::$FAILED) {
12564 $this->currPos = $p8;
12565 $r6 = self::$FAILED;
12566 goto seq_2;
12567 }
12568 $r6 = true;
12569 seq_2:
12570 if ($r6!==self::$FAILED) {
12571 $this->savedPos = $p7;
12572 $r6 = $this->a151($r4, $r10);
12573 goto choice_1;
12574 }
12575 // free $p8
12576 $p8 = $this->currPos;
12577 // start seq_3
12578 $p11 = $this->currPos;
12579 $this->savedPos = $this->currPos;
12580 $r12 = $this->a152($r4);
12581 if ($r12) {
12582 $r12 = false;
12583 } else {
12584 $r12 = self::$FAILED;
12585 $r6 = self::$FAILED;
12586 goto seq_3;
12587 }
12588 $r6 = true;
12589 seq_3:
12590 if ($r6!==self::$FAILED) {
12591 $this->savedPos = $p8;
12592 $r6 = $this->a153($r4);
12593 }
12594 // free $p11
12595 choice_1:
12596 // f <- $r6
12597 if ($r6===self::$FAILED) {
12598 $this->currPos = $p3;
12599 $r1 = self::$FAILED;
12600 goto seq_1;
12601 }
12602 // start choice_2
12603 $p11 = $this->currPos;
12604 // start seq_4
12605 $p14 = $this->currPos;
12606 $this->savedPos = $this->currPos;
12607 $r15 = $this->a154($r4, $r6);
12608 if ($r15) {
12609 $r15 = false;
12610 } else {
12611 $r15 = self::$FAILED;
12612 $r13 = self::$FAILED;
12613 goto seq_4;
12614 }
12615 $r16 = $this->parselang_variant_text($silence, $boolParams, $param_preproc, $param_th);
12616 // lv <- $r16
12617 if ($r16===self::$FAILED) {
12618 $this->currPos = $p14;
12619 $r13 = self::$FAILED;
12620 goto seq_4;
12621 }
12622 $r13 = true;
12623 seq_4:
12624 if ($r13!==self::$FAILED) {
12625 $this->savedPos = $p11;
12626 $r13 = $this->a155($r4, $r6, $r16);
12627 goto choice_2;
12628 }
12629 // free $p14
12630 $p14 = $this->currPos;
12631 // start seq_5
12632 $p17 = $this->currPos;
12633 $this->savedPos = $this->currPos;
12634 $r18 = $this->a156($r4, $r6);
12635 if ($r18) {
12636 $r18 = false;
12637 } else {
12638 $r18 = self::$FAILED;
12639 $r13 = self::$FAILED;
12640 goto seq_5;
12641 }
12642 $r19 = $this->parselang_variant_option_list($silence, $boolParams, $param_preproc, $param_th);
12643 // lv <- $r19
12644 if ($r19===self::$FAILED) {
12645 $this->currPos = $p17;
12646 $r13 = self::$FAILED;
12647 goto seq_5;
12648 }
12649 $r13 = true;
12650 seq_5:
12651 if ($r13!==self::$FAILED) {
12652 $this->savedPos = $p14;
12653 $r13 = $this->a157($r4, $r6, $r19);
12654 }
12655 // free $p17
12656 choice_2:
12657 // ts <- $r13
12658 if ($r13===self::$FAILED) {
12659 $this->currPos = $p3;
12660 $r1 = self::$FAILED;
12661 goto seq_1;
12662 }
12663 $r20 = $this->discardinline_breaks($silence, $boolParams, $param_preproc, $param_th);
12664 if ($r20===self::$FAILED) {
12665 $this->currPos = $p3;
12666 $r1 = self::$FAILED;
12667 goto seq_1;
12668 }
12669 $p17 = $this->currPos;
12670 // lv1 <- $r21
12671 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "}-", $this->currPos, 2, false) === 0) {
12672 $r21 = "}-";
12673 $this->currPos += 2;
12674 $this->savedPos = $p17;
12675 $r21 = $this->a158($r4, $r6, $r13);
12676 } else {
12677 if (!$silence) {$this->fail(76);}
12678 $r21 = self::$FAILED;
12679 $this->currPos = $p3;
12680 $r1 = self::$FAILED;
12681 goto seq_1;
12682 }
12683 $r1 = true;
12684 seq_1:
12685 if ($r1!==self::$FAILED) {
12686 $this->savedPos = $p2;
12687 $r1 = $this->a159($r4, $r6, $r13, $r21);
12688 }
12689 // free $p3
12690 $this->cache[$bucket][$key] = new GrammarCacheEntry(
12691 $this->currPos,
12692 $r1,
12693 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
12694 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
12695 );
12696 return $r1;
12697 }
12698 private function parsebroken_lang_variant($silence, &$param_preproc) {
12699 $key = json_encode([372, $param_preproc]);
12700 $bucket = $this->currPos;
12701 $cached = $this->cache[$bucket][$key] ?? null;
12702 if ($cached) {
12703 $this->currPos = $cached->nextPos;
12704 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
12705 return $cached->result;
12706 }
12707 $saved_preproc=$param_preproc;
12708 $p2 = $this->currPos;
12709 // start seq_1
12710 $p3 = $this->currPos;
12711 // r <- $r4
12712 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "-{", $this->currPos, 2, false) === 0) {
12713 $r4 = "-{";
12714 $this->currPos += 2;
12715 } else {
12716 if (!$silence) {$this->fail(75);}
12717 $r4 = self::$FAILED;
12718 $r1 = self::$FAILED;
12719 goto seq_1;
12720 }
12721 $r1 = true;
12722 seq_1:
12723 if ($r1!==self::$FAILED) {
12724 $this->savedPos = $p2;
12725 $r1 = $this->a160($r4, $param_preproc);
12726 }
12727 // free $p3
12728 $this->cache[$bucket][$key] = new GrammarCacheEntry(
12729 $this->currPos,
12730 $r1,
12731 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
12732 self::$UNDEFINED
12733 );
12734 return $r1;
12735 }
12736 private function parsetable_heading_tags_parameterized($silence, $boolParams, &$param_preproc, &$param_th) {
12737 $key = json_encode([476, $boolParams & 0x3fff, $param_preproc, $param_th]);
12738 $bucket = $this->currPos;
12739 $cached = $this->cache[$bucket][$key] ?? null;
12740 if ($cached) {
12741 $this->currPos = $cached->nextPos;
12742 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
12743 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
12744 return $cached->result;
12745 }
12746 $saved_preproc=$param_preproc;
12747 $saved_th=$param_th;
12748 $p2 = $this->currPos;
12749 // start seq_1
12750 $p3 = $this->currPos;
12751 if (($this->input[$this->currPos] ?? null) === "!") {
12752 $this->currPos++;
12753 $r4 = "!";
12754 } else {
12755 if (!$silence) {$this->fail(77);}
12756 $r4 = self::$FAILED;
12757 $r1 = self::$FAILED;
12758 goto seq_1;
12759 }
12760 $r5 = $this->parsetable_heading_tag($silence, $boolParams, $param_preproc, $param_th);
12761 // thTag <- $r5
12762 if ($r5===self::$FAILED) {
12763 $this->currPos = $p3;
12764 $r1 = self::$FAILED;
12765 goto seq_1;
12766 }
12767 $r6 = $this->parseths($silence, $boolParams, $param_preproc, $param_th);
12768 // thTags <- $r6
12769 if ($r6===self::$FAILED) {
12770 $this->currPos = $p3;
12771 $r1 = self::$FAILED;
12772 goto seq_1;
12773 }
12774 $r1 = true;
12775 seq_1:
12776 if ($r1!==self::$FAILED) {
12777 $this->savedPos = $p2;
12778 $r1 = $this->a161($r5, $r6);
12779 }
12780 // free $p3
12781 $this->cache[$bucket][$key] = new GrammarCacheEntry(
12782 $this->currPos,
12783 $r1,
12784 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
12785 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
12786 );
12787 return $r1;
12788 }
12789 private function parsetable_data_tag($silence, $boolParams, &$param_preproc, &$param_th) {
12790 $key = json_encode([484, $boolParams & 0x3fff, $param_preproc, $param_th]);
12791 $bucket = $this->currPos;
12792 $cached = $this->cache[$bucket][$key] ?? null;
12793 if ($cached) {
12794 $this->currPos = $cached->nextPos;
12795 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
12796 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
12797 return $cached->result;
12798 }
12799 $saved_preproc=$param_preproc;
12800 $saved_th=$param_th;
12801 $p2 = $this->currPos;
12802 // start seq_1
12803 $p3 = $this->currPos;
12804 $p4 = $this->currPos;
12805 if (($this->input[$this->currPos] ?? null) === "}") {
12806 $this->currPos++;
12807 $r5 = "}";
12808 } else {
12809 $r5 = self::$FAILED;
12810 }
12811 if ($r5 === self::$FAILED) {
12812 $r5 = false;
12813 } else {
12814 $r5 = self::$FAILED;
12815 $this->currPos = $p4;
12816 $r1 = self::$FAILED;
12817 goto seq_1;
12818 }
12819 // free $p4
12820 $r6 = $this->parserow_syntax_table_args($silence, $boolParams, $param_preproc, $param_th);
12821 if ($r6===self::$FAILED) {
12822 $r6 = null;
12823 }
12824 // arg <- $r6
12825 $p4 = $this->currPos;
12826 $r7 = '';
12827 // tagEndPos <- $r7
12828 if ($r7!==self::$FAILED) {
12829 $this->savedPos = $p4;
12830 $r7 = $this->a162($r6);
12831 } else {
12832 $this->currPos = $p3;
12833 $r1 = self::$FAILED;
12834 goto seq_1;
12835 }
12836 $r8 = [];
12837 for (;;) {
12838 $r9 = $this->parsenested_block_in_table($silence, $boolParams, $param_preproc, $param_th);
12839 if ($r9!==self::$FAILED) {
12840 $r8[] = $r9;
12841 } else {
12842 break;
12843 }
12844 }
12845 // td <- $r8
12846 // free $r9
12847 $r1 = true;
12848 seq_1:
12849 if ($r1!==self::$FAILED) {
12850 $this->savedPos = $p2;
12851 $r1 = $this->a163($r6, $r7, $r8);
12852 }
12853 // free $p3
12854 $this->cache[$bucket][$key] = new GrammarCacheEntry(
12855 $this->currPos,
12856 $r1,
12857 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
12858 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
12859 );
12860 return $r1;
12861 }
12862 private function parsetds($silence, $boolParams, &$param_preproc, &$param_th) {
12863 $key = json_encode([486, $boolParams & 0x3fff, $param_preproc, $param_th]);
12864 $bucket = $this->currPos;
12865 $cached = $this->cache[$bucket][$key] ?? null;
12866 if ($cached) {
12867 $this->currPos = $cached->nextPos;
12868 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
12869 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
12870 return $cached->result;
12871 }
12872 $saved_preproc=$param_preproc;
12873 $saved_th=$param_th;
12874 $r1 = [];
12875 for (;;) {
12876 $p3 = $this->currPos;
12877 // start seq_1
12878 $p4 = $this->currPos;
12879 $r5 = $this->parsepipe_pipe($silence);
12880 // pp <- $r5
12881 if ($r5===self::$FAILED) {
12882 $r2 = self::$FAILED;
12883 goto seq_1;
12884 }
12885 $r6 = $this->parsetable_data_tag($silence, $boolParams, $param_preproc, $param_th);
12886 // tdt <- $r6
12887 if ($r6===self::$FAILED) {
12888 $this->currPos = $p4;
12889 $r2 = self::$FAILED;
12890 goto seq_1;
12891 }
12892 $r2 = true;
12893 seq_1:
12894 if ($r2!==self::$FAILED) {
12895 $this->savedPos = $p3;
12896 $r2 = $this->a164($r5, $r6);
12897 $r1[] = $r2;
12898 } else {
12899 break;
12900 }
12901 // free $p4
12902 }
12903 // free $r2
12904 $this->cache[$bucket][$key] = new GrammarCacheEntry(
12905 $this->currPos,
12906 $r1,
12907 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
12908 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
12909 );
12910 return $r1;
12911 }
12912 private function parsenested_block_in_table($silence, $boolParams, &$param_preproc, &$param_th) {
12913 $key = json_encode([300, $boolParams & 0x3fff, $param_preproc, $param_th]);
12914 $bucket = $this->currPos;
12915 $cached = $this->cache[$bucket][$key] ?? null;
12916 if ($cached) {
12917 $this->currPos = $cached->nextPos;
12918 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
12919 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
12920 return $cached->result;
12921 }
12922 $saved_preproc=$param_preproc;
12923 $saved_th=$param_th;
12924 $p2 = $this->currPos;
12925 // start seq_1
12926 $p3 = $this->currPos;
12927 $p4 = $this->currPos;
12928 // start seq_2
12929 $p6 = $this->currPos;
12930 $r7 = $this->discardsol(true, $boolParams, $param_preproc, $param_th);
12931 if ($r7===self::$FAILED) {
12932 $r5 = self::$FAILED;
12933 goto seq_2;
12934 }
12935 // start seq_3
12936 $p9 = $this->currPos;
12937 for (;;) {
12938 $r11 = $this->discardspace(true);
12939 if ($r11===self::$FAILED) {
12940 break;
12941 }
12942 }
12943 // free $r11
12944 $r10 = true;
12945 if ($r10===self::$FAILED) {
12946 $r8 = self::$FAILED;
12947 goto seq_3;
12948 }
12949 // free $r10
12950 $r10 = $this->discardsol(true, $boolParams, $param_preproc, $param_th);
12951 if ($r10===self::$FAILED) {
12952 $this->currPos = $p9;
12953 $r8 = self::$FAILED;
12954 goto seq_3;
12955 }
12956 $r8 = true;
12957 seq_3:
12958 if ($r8===self::$FAILED) {
12959 $r8 = null;
12960 }
12961 // free $p9
12962 for (;;) {
12963 $r12 = $this->discardspace(true);
12964 if ($r12===self::$FAILED) {
12965 break;
12966 }
12967 }
12968 // free $r12
12969 $r11 = true;
12970 if ($r11===self::$FAILED) {
12971 $this->currPos = $p6;
12972 $r5 = self::$FAILED;
12973 goto seq_2;
12974 }
12975 // free $r11
12976 // start choice_1
12977 $r11 = $this->discardpipe(true);
12978 if ($r11!==self::$FAILED) {
12979 goto choice_1;
12980 }
12981 if (($this->input[$this->currPos] ?? null) === "!") {
12982 $this->currPos++;
12983 $r11 = "!";
12984 } else {
12985 $r11 = self::$FAILED;
12986 }
12987 choice_1:
12988 if ($r11===self::$FAILED) {
12989 $this->currPos = $p6;
12990 $r5 = self::$FAILED;
12991 goto seq_2;
12992 }
12993 $r5 = true;
12994 seq_2:
12995 // free $p6
12996 if ($r5 === self::$FAILED) {
12997 $r5 = false;
12998 } else {
12999 $r5 = self::$FAILED;
13000 $this->currPos = $p4;
13001 $r1 = self::$FAILED;
13002 goto seq_1;
13003 }
13004 // free $p4
13005 $r12 = $this->parsenested_block($silence, $boolParams | 0x1, $param_preproc, $param_th);
13006 // b <- $r12
13007 if ($r12===self::$FAILED) {
13008 $this->currPos = $p3;
13009 $r1 = self::$FAILED;
13010 goto seq_1;
13011 }
13012 $r1 = true;
13013 seq_1:
13014 if ($r1!==self::$FAILED) {
13015 $this->savedPos = $p2;
13016 $r1 = $this->a165($r12);
13017 }
13018 // free $p3
13019 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13020 $this->currPos,
13021 $r1,
13022 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
13023 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
13024 );
13025 return $r1;
13026 }
13027 private function discardempty_line_with_comments($silence) {
13028 $key = 563;
13029 $bucket = $this->currPos;
13030 $cached = $this->cache[$bucket][$key] ?? null;
13031 if ($cached) {
13032 $this->currPos = $cached->nextPos;
13033
13034 return $cached->result;
13035 }
13036
13037 $p2 = $this->currPos;
13038 // start seq_1
13039 $p3 = $this->currPos;
13040 $r4 = $this->parsesol_prefix($silence);
13041 // sp <- $r4
13042 if ($r4===self::$FAILED) {
13043 $r1 = self::$FAILED;
13044 goto seq_1;
13045 }
13046 $p6 = $this->currPos;
13047 $r5 = '';
13048 // p <- $r5
13049 if ($r5!==self::$FAILED) {
13050 $this->savedPos = $p6;
13051 $r5 = $this->a83($r4);
13052 } else {
13053 $this->currPos = $p3;
13054 $r1 = self::$FAILED;
13055 goto seq_1;
13056 }
13057 $r7 = [];
13058 for (;;) {
13059 // start seq_2
13060 $p9 = $this->currPos;
13061 $r10 = [];
13062 for (;;) {
13063 $r11 = $this->parsespace($silence);
13064 if ($r11!==self::$FAILED) {
13065 $r10[] = $r11;
13066 } else {
13067 break;
13068 }
13069 }
13070 // free $r11
13071 $r11 = $this->parsecomment($silence);
13072 if ($r11===self::$FAILED) {
13073 $this->currPos = $p9;
13074 $r8 = self::$FAILED;
13075 goto seq_2;
13076 }
13077 $r12 = [];
13078 for (;;) {
13079 // start choice_1
13080 $r13 = $this->parsespace($silence);
13081 if ($r13!==self::$FAILED) {
13082 goto choice_1;
13083 }
13084 $r13 = $this->parsecomment($silence);
13085 choice_1:
13086 if ($r13!==self::$FAILED) {
13087 $r12[] = $r13;
13088 } else {
13089 break;
13090 }
13091 }
13092 // free $r13
13093 $r13 = $this->parsenewline($silence);
13094 if ($r13===self::$FAILED) {
13095 $this->currPos = $p9;
13096 $r8 = self::$FAILED;
13097 goto seq_2;
13098 }
13099 $r8 = [$r10,$r11,$r12,$r13];
13100 seq_2:
13101 if ($r8!==self::$FAILED) {
13102 $r7[] = $r8;
13103 } else {
13104 break;
13105 }
13106 // free $p9
13107 }
13108 if (count($r7) === 0) {
13109 $r7 = self::$FAILED;
13110 }
13111 // c <- $r7
13112 if ($r7===self::$FAILED) {
13113 $this->currPos = $p3;
13114 $r1 = self::$FAILED;
13115 goto seq_1;
13116 }
13117 // free $r8
13118 $r1 = true;
13119 seq_1:
13120 if ($r1!==self::$FAILED) {
13121 $this->savedPos = $p2;
13122 $r1 = $this->a84($r4, $r5, $r7);
13123 }
13124 // free $p3
13125 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13126 $this->currPos,
13127 $r1,
13128 self::$UNDEFINED,
13129 self::$UNDEFINED
13130 );
13131 return $r1;
13132 }
13133 private function discardsol_prefix($silence) {
13134 $key = 561;
13135 $bucket = $this->currPos;
13136 $cached = $this->cache[$bucket][$key] ?? null;
13137 if ($cached) {
13138 $this->currPos = $cached->nextPos;
13139
13140 return $cached->result;
13141 }
13142
13143 // start choice_1
13144 $r1 = $this->discardnewlineToken($silence);
13145 if ($r1!==self::$FAILED) {
13146 goto choice_1;
13147 }
13148 $p2 = $this->currPos;
13149 $this->savedPos = $this->currPos;
13150 $r1 = $this->a85();
13151 if ($r1) {
13152 $r1 = false;
13153 $this->savedPos = $p2;
13154 $r1 = $this->a86();
13155 } else {
13156 $r1 = self::$FAILED;
13157 }
13158 choice_1:
13159 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13160 $this->currPos,
13161 $r1,
13162 self::$UNDEFINED,
13163 self::$UNDEFINED
13164 );
13165 return $r1;
13166 }
13167 private function discardsol_transparent($silence, $boolParams, &$param_preproc, &$param_th) {
13168 $key = json_encode([557, $boolParams & 0x3ebf, $param_preproc, $param_th]);
13169 $bucket = $this->currPos;
13170 $cached = $this->cache[$bucket][$key] ?? null;
13171 if ($cached) {
13172 $this->currPos = $cached->nextPos;
13173 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
13174 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
13175 return $cached->result;
13176 }
13177 $saved_preproc=$param_preproc;
13178 $saved_th=$param_th;
13179 // start choice_1
13180 $r1 = $this->discardcomment($silence);
13181 if ($r1!==self::$FAILED) {
13182 goto choice_1;
13183 }
13184 $r1 = $this->discardinclude_limits($silence, $boolParams | 0x2000, $param_preproc, $param_th);
13185 if ($r1!==self::$FAILED) {
13186 goto choice_1;
13187 }
13188 $r1 = $this->discardannotation_tag($silence, $boolParams, $param_preproc, $param_th);
13189 if ($r1!==self::$FAILED) {
13190 goto choice_1;
13191 }
13192 $r1 = $this->discardbehavior_switch($silence);
13193 choice_1:
13194 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13195 $this->currPos,
13196 $r1,
13197 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
13198 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
13199 );
13200 return $r1;
13201 }
13202 private function parsetemplate_param_text($silence, $boolParams, &$param_preproc, &$param_th) {
13203 $key = json_encode([368, $boolParams & 0x3e37, $param_preproc, $param_th]);
13204 $bucket = $this->currPos;
13205 $cached = $this->cache[$bucket][$key] ?? null;
13206 if ($cached) {
13207 $this->currPos = $cached->nextPos;
13208 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
13209 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
13210 return $cached->result;
13211 }
13212 $saved_preproc=$param_preproc;
13213 $saved_th=$param_th;
13214 $p2 = $this->currPos;
13215 $r3 = [];
13216 for (;;) {
13217 // start choice_1
13218 $r4 = $this->parsenested_block($silence, ($boolParams & ~0x148) | 0x80, $param_preproc, $param_th);
13219 if ($r4!==self::$FAILED) {
13220 goto choice_1;
13221 }
13222 $r4 = $this->parsenewlineToken($silence);
13223 choice_1:
13224 if ($r4!==self::$FAILED) {
13225 $r3[] = $r4;
13226 } else {
13227 break;
13228 }
13229 }
13230 if (count($r3) === 0) {
13231 $r3 = self::$FAILED;
13232 }
13233 // il <- $r3
13234 // free $r4
13235 $r1 = $r3;
13236 if ($r1!==self::$FAILED) {
13237 $this->savedPos = $p2;
13238 $r1 = $this->a166($r3);
13239 }
13240 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13241 $this->currPos,
13242 $r1,
13243 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
13244 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
13245 );
13246 return $r1;
13247 }
13248 private function discardnewlineToken($silence) {
13249 $key = 537;
13250 $bucket = $this->currPos;
13251 $cached = $this->cache[$bucket][$key] ?? null;
13252 if ($cached) {
13253 $this->currPos = $cached->nextPos;
13254
13255 return $cached->result;
13256 }
13257
13258 $p2 = $this->currPos;
13259 $r1 = $this->discardnewline($silence);
13260 if ($r1!==self::$FAILED) {
13261 $this->savedPos = $p2;
13262 $r1 = $this->a26();
13263 }
13264 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13265 $this->currPos,
13266 $r1,
13267 self::$UNDEFINED,
13268 self::$UNDEFINED
13269 );
13270 return $r1;
13271 }
13272 private function parsetemplate_param_name($silence, $boolParams, &$param_preproc, &$param_th) {
13273 $key = json_encode([364, $boolParams & 0x3e17, $param_preproc, $param_th]);
13274 $bucket = $this->currPos;
13275 $cached = $this->cache[$bucket][$key] ?? null;
13276 if ($cached) {
13277 $this->currPos = $cached->nextPos;
13278 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
13279 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
13280 return $cached->result;
13281 }
13282 $saved_preproc=$param_preproc;
13283 $saved_th=$param_th;
13284 // start choice_1
13285 $r1 = $this->parsetemplate_param_text($silence, $boolParams | 0x20, $param_preproc, $param_th);
13286 if ($r1!==self::$FAILED) {
13287 goto choice_1;
13288 }
13289 $p2 = $this->currPos;
13290 $p3 = $this->currPos;
13291 if (($this->input[$this->currPos] ?? null) === "=") {
13292 $this->currPos++;
13293 $r1 = "=";
13294 $r1 = false;
13295 $this->currPos = $p3;
13296 $this->savedPos = $p2;
13297 $r1 = $this->a167();
13298 } else {
13299 $r1 = self::$FAILED;
13300 }
13301 // free $p3
13302 choice_1:
13303 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13304 $this->currPos,
13305 $r1,
13306 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
13307 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
13308 );
13309 return $r1;
13310 }
13311 private function parselink_text($silence, $boolParams, &$param_preproc, &$param_th) {
13312 $key = json_encode([408, $boolParams & 0x37df, $param_preproc, $param_th]);
13313 $bucket = $this->currPos;
13314 $cached = $this->cache[$bucket][$key] ?? null;
13315 if ($cached) {
13316 $this->currPos = $cached->nextPos;
13317 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
13318 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
13319 return $cached->result;
13320 }
13321 $saved_preproc=$param_preproc;
13322 $saved_th=$param_th;
13323 $r1 = $this->parselink_text_parameterized($silence, ($boolParams & ~0x20) | 0x800, $param_preproc, $param_th);
13324 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13325 $this->currPos,
13326 $r1,
13327 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
13328 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
13329 );
13330 return $r1;
13331 }
13332 private function parseunispace($silence) {
13333 $key = 550;
13334 $bucket = $this->currPos;
13335 $cached = $this->cache[$bucket][$key] ?? null;
13336 if ($cached) {
13337 $this->currPos = $cached->nextPos;
13338
13339 return $cached->result;
13340 }
13341
13342 $r1 = self::charAt($this->input, $this->currPos);
13343 if (preg_match("/^[ \\x{a0}\\x{1680}\\x{2000}-\\x{200a}\\x{202f}\\x{205f}\\x{3000}]/u", $r1)) {
13344 $this->currPos += strlen($r1);
13345 } else {
13346 $r1 = self::$FAILED;
13347 if (!$silence) {$this->fail(25);}
13348 }
13349 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13350 $this->currPos,
13351 $r1,
13352 self::$UNDEFINED,
13353 self::$UNDEFINED
13354 );
13355 return $r1;
13356 }
13357 private function parseopt_lang_variant_flags($silence, $boolParams, &$param_preproc, &$param_th) {
13358 $key = json_encode([378, $boolParams & 0x3ebf, $param_preproc, $param_th]);
13359 $bucket = $this->currPos;
13360 $cached = $this->cache[$bucket][$key] ?? null;
13361 if ($cached) {
13362 $this->currPos = $cached->nextPos;
13363 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
13364 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
13365 return $cached->result;
13366 }
13367 $saved_preproc=$param_preproc;
13368 $saved_th=$param_th;
13369 $p2 = $this->currPos;
13370 $p4 = $this->currPos;
13371 // start seq_1
13372 $p5 = $this->currPos;
13373 $r6 = $this->parselang_variant_flags($silence, $boolParams, $param_preproc, $param_th);
13374 // ff <- $r6
13375 if ($r6===self::$FAILED) {
13376 $r3 = self::$FAILED;
13377 goto seq_1;
13378 }
13379 if (($this->input[$this->currPos] ?? null) === "|") {
13380 $this->currPos++;
13381 $r7 = "|";
13382 } else {
13383 if (!$silence) {$this->fail(13);}
13384 $r7 = self::$FAILED;
13385 $this->currPos = $p5;
13386 $r3 = self::$FAILED;
13387 goto seq_1;
13388 }
13389 $r3 = true;
13390 seq_1:
13391 if ($r3!==self::$FAILED) {
13392 $this->savedPos = $p4;
13393 $r3 = $this->a168($r6);
13394 } else {
13395 $r3 = null;
13396 }
13397 // free $p5
13398 // f <- $r3
13399 $r1 = $r3;
13400 if ($r1!==self::$FAILED) {
13401 $this->savedPos = $p2;
13402 $r1 = $this->a169($r3);
13403 }
13404 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13405 $this->currPos,
13406 $r1,
13407 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
13408 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
13409 );
13410 return $r1;
13411 }
13412 private function parselang_variant_text($silence, $boolParams, &$param_preproc, &$param_th) {
13413 $key = json_encode([394, $boolParams & 0x3fff, $param_preproc, $param_th]);
13414 $bucket = $this->currPos;
13415 $cached = $this->cache[$bucket][$key] ?? null;
13416 if ($cached) {
13417 $this->currPos = $cached->nextPos;
13418 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
13419 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
13420 return $cached->result;
13421 }
13422 $saved_preproc=$param_preproc;
13423 $saved_th=$param_th;
13424 $p2 = $this->currPos;
13425 $r3 = [];
13426 for (;;) {
13427 // start choice_1
13428 $r4 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th);
13429 if ($r4!==self::$FAILED) {
13430 goto choice_1;
13431 }
13432 if (($this->input[$this->currPos] ?? null) === "|") {
13433 $this->currPos++;
13434 $r4 = "|";
13435 } else {
13436 if (!$silence) {$this->fail(13);}
13437 $r4 = self::$FAILED;
13438 }
13439 choice_1:
13440 if ($r4!==self::$FAILED) {
13441 $r3[] = $r4;
13442 } else {
13443 break;
13444 }
13445 }
13446 // tokens <- $r3
13447 // free $r4
13448 $r1 = $r3;
13449 if ($r1!==self::$FAILED) {
13450 $this->savedPos = $p2;
13451 $r1 = $this->a170($r3);
13452 }
13453 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13454 $this->currPos,
13455 $r1,
13456 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
13457 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
13458 );
13459 return $r1;
13460 }
13461 private function parselang_variant_option_list($silence, $boolParams, &$param_preproc, &$param_th) {
13462 $key = json_encode([386, $boolParams & 0x3fff, $param_preproc, $param_th]);
13463 $bucket = $this->currPos;
13464 $cached = $this->cache[$bucket][$key] ?? null;
13465 if ($cached) {
13466 $this->currPos = $cached->nextPos;
13467 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
13468 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
13469 return $cached->result;
13470 }
13471 $saved_preproc=$param_preproc;
13472 $saved_th=$param_th;
13473 // start choice_1
13474 $p2 = $this->currPos;
13475 // start seq_1
13476 $p3 = $this->currPos;
13477 $r4 = $this->parselang_variant_option($silence, $boolParams, $param_preproc, $param_th);
13478 // o <- $r4
13479 if ($r4===self::$FAILED) {
13480 $r1 = self::$FAILED;
13481 goto seq_1;
13482 }
13483 $r5 = [];
13484 for (;;) {
13485 $p7 = $this->currPos;
13486 // start seq_2
13487 $p8 = $this->currPos;
13488 if (($this->input[$this->currPos] ?? null) === ";") {
13489 $this->currPos++;
13490 $r9 = ";";
13491 } else {
13492 if (!$silence) {$this->fail(26);}
13493 $r9 = self::$FAILED;
13494 $r6 = self::$FAILED;
13495 goto seq_2;
13496 }
13497 $r10 = $this->parselang_variant_option($silence, $boolParams, $param_preproc, $param_th);
13498 // oo <- $r10
13499 if ($r10===self::$FAILED) {
13500 $this->currPos = $p8;
13501 $r6 = self::$FAILED;
13502 goto seq_2;
13503 }
13504 $r6 = true;
13505 seq_2:
13506 if ($r6!==self::$FAILED) {
13507 $this->savedPos = $p7;
13508 $r6 = $this->a171($r4, $r10);
13509 $r5[] = $r6;
13510 } else {
13511 break;
13512 }
13513 // free $p8
13514 }
13515 // rest <- $r5
13516 // free $r6
13517 $r6 = [];
13518 for (;;) {
13519 // start seq_3
13520 $p8 = $this->currPos;
13521 if (($this->input[$this->currPos] ?? null) === ";") {
13522 $this->currPos++;
13523 $r12 = ";";
13524 } else {
13525 if (!$silence) {$this->fail(26);}
13526 $r12 = self::$FAILED;
13527 $r11 = self::$FAILED;
13528 goto seq_3;
13529 }
13530 $p13 = $this->currPos;
13531 $r14 = $this->discardbogus_lang_variant_option($silence, $boolParams, $param_preproc, $param_th);
13532 if ($r14!==self::$FAILED) {
13533 $r14 = substr($this->input, $p13, $this->currPos - $p13);
13534 } else {
13535 $r14 = self::$FAILED;
13536 $this->currPos = $p8;
13537 $r11 = self::$FAILED;
13538 goto seq_3;
13539 }
13540 // free $p13
13541 $r11 = [$r12,$r14];
13542 seq_3:
13543 if ($r11!==self::$FAILED) {
13544 $r6[] = $r11;
13545 } else {
13546 break;
13547 }
13548 // free $p8
13549 }
13550 // tr <- $r6
13551 // free $r11
13552 $r1 = true;
13553 seq_1:
13554 if ($r1!==self::$FAILED) {
13555 $this->savedPos = $p2;
13556 $r1 = $this->a172($r4, $r5, $r6);
13557 goto choice_1;
13558 }
13559 // free $p3
13560 $p3 = $this->currPos;
13561 $r11 = $this->parselang_variant_text($silence, $boolParams, $param_preproc, $param_th);
13562 // lvtext <- $r11
13563 $r1 = $r11;
13564 if ($r1!==self::$FAILED) {
13565 $this->savedPos = $p3;
13566 $r1 = $this->a173($r11);
13567 }
13568 choice_1:
13569 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13570 $this->currPos,
13571 $r1,
13572 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
13573 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
13574 );
13575 return $r1;
13576 }
13577 private function parsetable_heading_tag($silence, $boolParams, &$param_preproc, &$param_th) {
13578 $key = json_encode([478, $boolParams & 0x3fff, $param_preproc, $param_th]);
13579 $bucket = $this->currPos;
13580 $cached = $this->cache[$bucket][$key] ?? null;
13581 if ($cached) {
13582 $this->currPos = $cached->nextPos;
13583 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
13584 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
13585 return $cached->result;
13586 }
13587 $saved_preproc=$param_preproc;
13588 $saved_th=$param_th;
13589 $p2 = $this->currPos;
13590 // start seq_1
13591 $p3 = $this->currPos;
13592 $r4 = $this->parserow_syntax_table_args($silence, $boolParams, $param_preproc, $param_th);
13593 if ($r4===self::$FAILED) {
13594 $r4 = null;
13595 }
13596 // arg <- $r4
13597 $p6 = $this->currPos;
13598 $r5 = '';
13599 // tagEndPos <- $r5
13600 if ($r5!==self::$FAILED) {
13601 $this->savedPos = $p6;
13602 $r5 = $this->a162($r4);
13603 } else {
13604 $this->currPos = $p3;
13605 $r1 = self::$FAILED;
13606 goto seq_1;
13607 }
13608 $r7 = [];
13609 for (;;) {
13610 $p9 = $this->currPos;
13611 // start seq_2
13612 $p10 = $this->currPos;
13613 $r11 = $this->parsenested_block_in_table($silence, $boolParams, $param_preproc, $param_th);
13614 // d <- $r11
13615 if ($r11===self::$FAILED) {
13616 $this->currPos = $p10;
13617 $r8 = self::$FAILED;
13618 goto seq_2;
13619 }
13620 $r8 = true;
13621 seq_2:
13622 if ($r8!==self::$FAILED) {
13623 $this->savedPos = $p9;
13624 $r8 = $this->a174($r4, $r5, $param_th, $r11);
13625 $r7[] = $r8;
13626 } else {
13627 break;
13628 }
13629 // free $p10
13630 }
13631 // c <- $r7
13632 // free $r8
13633 $r1 = true;
13634 seq_1:
13635 if ($r1!==self::$FAILED) {
13636 $this->savedPos = $p2;
13637 $r1 = $this->a175($r4, $r5, $r7);
13638 }
13639 // free $p3
13640 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13641 $this->currPos,
13642 $r1,
13643 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
13644 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
13645 );
13646 return $r1;
13647 }
13648 private function parseths($silence, $boolParams, &$param_preproc, &$param_th) {
13649 $key = json_encode([480, $boolParams & 0x3fff, $param_preproc, $param_th]);
13650 $bucket = $this->currPos;
13651 $cached = $this->cache[$bucket][$key] ?? null;
13652 if ($cached) {
13653 $this->currPos = $cached->nextPos;
13654 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
13655 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
13656 return $cached->result;
13657 }
13658 $saved_preproc=$param_preproc;
13659 $saved_th=$param_th;
13660 $r1 = [];
13661 for (;;) {
13662 $p3 = $this->currPos;
13663 // start seq_1
13664 $p4 = $this->currPos;
13665 // start choice_1
13666 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) {
13667 $r5 = "!!";
13668 $this->currPos += 2;
13669 goto choice_1;
13670 } else {
13671 if (!$silence) {$this->fail(78);}
13672 $r5 = self::$FAILED;
13673 }
13674 $r5 = $this->parsepipe_pipe($silence);
13675 choice_1:
13676 // pp <- $r5
13677 if ($r5===self::$FAILED) {
13678 $r2 = self::$FAILED;
13679 goto seq_1;
13680 }
13681 $r6 = $this->parsetable_heading_tag($silence, $boolParams, $param_preproc, $param_th);
13682 // tht <- $r6
13683 if ($r6===self::$FAILED) {
13684 $this->currPos = $p4;
13685 $r2 = self::$FAILED;
13686 goto seq_1;
13687 }
13688 $r2 = true;
13689 seq_1:
13690 if ($r2!==self::$FAILED) {
13691 $this->savedPos = $p3;
13692 $r2 = $this->a176($r5, $r6);
13693 $r1[] = $r2;
13694 } else {
13695 break;
13696 }
13697 // free $p4
13698 }
13699 // free $r2
13700 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13701 $this->currPos,
13702 $r1,
13703 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
13704 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
13705 );
13706 return $r1;
13707 }
13708 private function parsepipe_pipe($silence) {
13709 $key = 524;
13710 $bucket = $this->currPos;
13711 $cached = $this->cache[$bucket][$key] ?? null;
13712 if ($cached) {
13713 $this->currPos = $cached->nextPos;
13714
13715 return $cached->result;
13716 }
13717
13718 // start choice_1
13719 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "||", $this->currPos, 2, false) === 0) {
13720 $r1 = "||";
13721 $this->currPos += 2;
13722 goto choice_1;
13723 } else {
13724 if (!$silence) {$this->fail(79);}
13725 $r1 = self::$FAILED;
13726 }
13727 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "{{!}}{{!}}", $this->currPos, 10, false) === 0) {
13728 $r1 = "{{!}}{{!}}";
13729 $this->currPos += 10;
13730 } else {
13731 if (!$silence) {$this->fail(80);}
13732 $r1 = self::$FAILED;
13733 }
13734 choice_1:
13735 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13736 $this->currPos,
13737 $r1,
13738 self::$UNDEFINED,
13739 self::$UNDEFINED
13740 );
13741 return $r1;
13742 }
13743 private function parsenested_block($silence, $boolParams, &$param_preproc, &$param_th) {
13744 $key = json_encode([298, $boolParams & 0x3fff, $param_preproc, $param_th]);
13745 $bucket = $this->currPos;
13746 $cached = $this->cache[$bucket][$key] ?? null;
13747 if ($cached) {
13748 $this->currPos = $cached->nextPos;
13749 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
13750 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
13751 return $cached->result;
13752 }
13753 $saved_preproc=$param_preproc;
13754 $saved_th=$param_th;
13755 $p2 = $this->currPos;
13756 // start seq_1
13757 $p3 = $this->currPos;
13758 $p4 = $this->currPos;
13759 $r5 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
13760 if ($r5 === self::$FAILED) {
13761 $r5 = false;
13762 } else {
13763 $r5 = self::$FAILED;
13764 $this->currPos = $p4;
13765 $r1 = self::$FAILED;
13766 goto seq_1;
13767 }
13768 // free $p4
13769 $r6 = $this->parseblock($silence, $boolParams, $param_th, $param_preproc);
13770 // b <- $r6
13771 if ($r6===self::$FAILED) {
13772 $this->currPos = $p3;
13773 $r1 = self::$FAILED;
13774 goto seq_1;
13775 }
13776 $r1 = true;
13777 seq_1:
13778 if ($r1!==self::$FAILED) {
13779 $this->savedPos = $p2;
13780 $r1 = $this->a15($r6);
13781 }
13782 // free $p3
13783 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13784 $this->currPos,
13785 $r1,
13786 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
13787 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
13788 );
13789 return $r1;
13790 }
13791 private function discardinclude_limits($silence, $boolParams, &$param_preproc, &$param_th) {
13792 $key = json_encode([501, $boolParams & 0x3ebd, $param_preproc, $param_th]);
13793 $bucket = $this->currPos;
13794 $cached = $this->cache[$bucket][$key] ?? null;
13795 if ($cached) {
13796 $this->currPos = $cached->nextPos;
13797 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
13798 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
13799 return $cached->result;
13800 }
13801 $saved_preproc=$param_preproc;
13802 $saved_th=$param_th;
13803 $p2 = $this->currPos;
13804 // start seq_1
13805 $p3 = $this->currPos;
13806 $p4 = $this->currPos;
13807 // start seq_2
13808 $p6 = $this->currPos;
13809 if (($this->input[$this->currPos] ?? null) === "<") {
13810 $this->currPos++;
13811 $r7 = "<";
13812 } else {
13813 $r7 = self::$FAILED;
13814 $r5 = self::$FAILED;
13815 goto seq_2;
13816 }
13817 if (($this->input[$this->currPos] ?? null) === "/") {
13818 $this->currPos++;
13819 $r8 = "/";
13820 } else {
13821 $r8 = self::$FAILED;
13822 $r8 = null;
13823 }
13824 // start choice_1
13825 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "includeonly", $this->currPos, 11, true) === 0) {
13826 $r9 = substr($this->input, $this->currPos, 11);
13827 $this->currPos += 11;
13828 goto choice_1;
13829 } else {
13830 $r9 = self::$FAILED;
13831 }
13832 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "noinclude", $this->currPos, 9, true) === 0) {
13833 $r9 = substr($this->input, $this->currPos, 9);
13834 $this->currPos += 9;
13835 goto choice_1;
13836 } else {
13837 $r9 = self::$FAILED;
13838 }
13839 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "onlyinclude", $this->currPos, 11, true) === 0) {
13840 $r9 = substr($this->input, $this->currPos, 11);
13841 $this->currPos += 11;
13842 } else {
13843 $r9 = self::$FAILED;
13844 }
13845 choice_1:
13846 if ($r9===self::$FAILED) {
13847 $this->currPos = $p6;
13848 $r5 = self::$FAILED;
13849 goto seq_2;
13850 }
13851 $r5 = true;
13852 seq_2:
13853 if ($r5!==self::$FAILED) {
13854 $r5 = false;
13855 $this->currPos = $p4;
13856 } else {
13857 $r1 = self::$FAILED;
13858 goto seq_1;
13859 }
13860 // free $p6
13861 // free $p4
13862 if (($this->input[$this->currPos] ?? null) === "<") {
13863 $this->currPos++;
13864 $r10 = "<";
13865 } else {
13866 if (!$silence) {$this->fail(44);}
13867 $r10 = self::$FAILED;
13868 $this->currPos = $p3;
13869 $r1 = self::$FAILED;
13870 goto seq_1;
13871 }
13872 $r11 = $this->parsexmlish_tag($silence, $boolParams | 0x2, $param_preproc, $param_th);
13873 // il <- $r11
13874 if ($r11===self::$FAILED) {
13875 $this->currPos = $p3;
13876 $r1 = self::$FAILED;
13877 goto seq_1;
13878 }
13879 $this->savedPos = $this->currPos;
13880 $r12 = $this->a88($r11, /*sol_il*/($boolParams & 0x2000) !== 0);
13881 if ($r12) {
13882 $r12 = false;
13883 } else {
13884 $r12 = self::$FAILED;
13885 $this->currPos = $p3;
13886 $r1 = self::$FAILED;
13887 goto seq_1;
13888 }
13889 $r1 = true;
13890 seq_1:
13891 if ($r1!==self::$FAILED) {
13892 $this->savedPos = $p2;
13893 $r1 = $this->a89($r11, /*sol_il*/($boolParams & 0x2000) !== 0);
13894 }
13895 // free $p3
13896 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13897 $this->currPos,
13898 $r1,
13899 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
13900 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
13901 );
13902 return $r1;
13903 }
13904 private function discardannotation_tag($silence, $boolParams, &$param_preproc, &$param_th) {
13905 $key = json_encode([417, $boolParams & 0x3ebf, $param_preproc, $param_th]);
13906 $bucket = $this->currPos;
13907 $cached = $this->cache[$bucket][$key] ?? null;
13908 if ($cached) {
13909 $this->currPos = $cached->nextPos;
13910 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
13911 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
13912 return $cached->result;
13913 }
13914 $saved_preproc=$param_preproc;
13915 $saved_th=$param_th;
13916 $p2 = $this->currPos;
13917 // start seq_1
13918 $p3 = $this->currPos;
13919 $r4 = $this->parseextension_annotation_tag($silence, $boolParams, $param_preproc, $param_th);
13920 // annToken <- $r4
13921 if ($r4===self::$FAILED) {
13922 $r1 = self::$FAILED;
13923 goto seq_1;
13924 }
13925 $this->savedPos = $this->currPos;
13926 $r5 = $this->a90($r4);
13927 if ($r5) {
13928 $r5 = false;
13929 } else {
13930 $r5 = self::$FAILED;
13931 $this->currPos = $p3;
13932 $r1 = self::$FAILED;
13933 goto seq_1;
13934 }
13935 $r1 = true;
13936 seq_1:
13937 if ($r1!==self::$FAILED) {
13938 $this->savedPos = $p2;
13939 $r1 = $this->a91($r4);
13940 }
13941 // free $p3
13942 $this->cache[$bucket][$key] = new GrammarCacheEntry(
13943 $this->currPos,
13944 $r1,
13945 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
13946 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
13947 );
13948 return $r1;
13949 }
13950 private function discardbehavior_switch($silence) {
13951 $key = 321;
13952 $bucket = $this->currPos;
13953 $cached = $this->cache[$bucket][$key] ?? null;
13954 if ($cached) {
13955 $this->currPos = $cached->nextPos;
13956
13957 return $cached->result;
13958 }
13959
13960 $p2 = $this->currPos;
13961 $p4 = $this->currPos;
13962 // start seq_1
13963 $p5 = $this->currPos;
13964 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) {
13965 $r6 = "__";
13966 $this->currPos += 2;
13967 } else {
13968 if (!$silence) {$this->fail(53);}
13969 $r6 = self::$FAILED;
13970 $r3 = self::$FAILED;
13971 goto seq_1;
13972 }
13973 $r7 = $this->discardbehavior_text($silence);
13974 if ($r7===self::$FAILED) {
13975 $this->currPos = $p5;
13976 $r3 = self::$FAILED;
13977 goto seq_1;
13978 }
13979 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "__", $this->currPos, 2, false) === 0) {
13980 $r8 = "__";
13981 $this->currPos += 2;
13982 } else {
13983 if (!$silence) {$this->fail(53);}
13984 $r8 = self::$FAILED;
13985 $this->currPos = $p5;
13986 $r3 = self::$FAILED;
13987 goto seq_1;
13988 }
13989 $r3 = true;
13990 seq_1:
13991 // bs <- $r3
13992 if ($r3!==self::$FAILED) {
13993 $r3 = substr($this->input, $p4, $this->currPos - $p4);
13994 } else {
13995 $r3 = self::$FAILED;
13996 }
13997 // free $p5
13998 // free $p4
13999 $r1 = $r3;
14000 if ($r1!==self::$FAILED) {
14001 $this->savedPos = $p2;
14002 $r1 = $this->a80($r3);
14003 }
14004 $this->cache[$bucket][$key] = new GrammarCacheEntry(
14005 $this->currPos,
14006 $r1,
14007 self::$UNDEFINED,
14008 self::$UNDEFINED
14009 );
14010 return $r1;
14011 }
14012 private function parselink_text_parameterized($silence, $boolParams, &$param_preproc, &$param_th) {
14013 $key = json_encode([410, $boolParams & 0x3fff, $param_preproc, $param_th]);
14014 $bucket = $this->currPos;
14015 $cached = $this->cache[$bucket][$key] ?? null;
14016 if ($cached) {
14017 $this->currPos = $cached->nextPos;
14018 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
14019 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
14020 return $cached->result;
14021 }
14022 $saved_preproc=$param_preproc;
14023 $saved_th=$param_th;
14024 $p2 = $this->currPos;
14025 $r3 = [];
14026 for (;;) {
14027 // start choice_1
14028 // start seq_1
14029 $p5 = $this->currPos;
14030 $r6 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th);
14031 if ($r6===self::$FAILED) {
14032 $r4 = self::$FAILED;
14033 goto seq_1;
14034 }
14035 // start choice_2
14036 $r7 = $this->parseheading($silence, $boolParams, $param_preproc, $param_th);
14037 if ($r7!==self::$FAILED) {
14038 goto choice_2;
14039 }
14040 $r7 = $this->parsehr($silence, $boolParams, $param_preproc, $param_th);
14041 if ($r7!==self::$FAILED) {
14042 goto choice_2;
14043 }
14044 $r7 = $this->parsefull_table_in_link_caption($silence, $boolParams, $param_preproc, $param_th);
14045 choice_2:
14046 if ($r7===self::$FAILED) {
14047 $this->currPos = $p5;
14048 $r4 = self::$FAILED;
14049 goto seq_1;
14050 }
14051 $r4 = [$r6,$r7];
14052 seq_1:
14053 if ($r4!==self::$FAILED) {
14054 goto choice_1;
14055 }
14056 // free $p5
14057 $r4 = $this->parseurltext($silence, $boolParams, $param_preproc, $param_th);
14058 if ($r4!==self::$FAILED) {
14059 goto choice_1;
14060 }
14061 $p5 = $this->currPos;
14062 // start seq_2
14063 $p8 = $this->currPos;
14064 $p9 = $this->currPos;
14065 $r10 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
14066 if ($r10 === self::$FAILED) {
14067 $r10 = false;
14068 } else {
14069 $r10 = self::$FAILED;
14070 $this->currPos = $p9;
14071 $r4 = self::$FAILED;
14072 goto seq_2;
14073 }
14074 // free $p9
14075 // start choice_3
14076 $r11 = $this->parseinline_element($silence, $boolParams, $param_preproc, $param_th);
14077 if ($r11!==self::$FAILED) {
14078 goto choice_3;
14079 }
14080 // start seq_3
14081 $p9 = $this->currPos;
14082 if (($this->input[$this->currPos] ?? null) === "[") {
14083 $this->currPos++;
14084 $r12 = "[";
14085 } else {
14086 if (!$silence) {$this->fail(19);}
14087 $r12 = self::$FAILED;
14088 $r11 = self::$FAILED;
14089 goto seq_3;
14090 }
14091 $r13 = [];
14092 for (;;) {
14093 $r14 = $this->parsetext_char($silence);
14094 if ($r14!==self::$FAILED) {
14095 $r13[] = $r14;
14096 } else {
14097 break;
14098 }
14099 }
14100 if (count($r13) === 0) {
14101 $r13 = self::$FAILED;
14102 }
14103 if ($r13===self::$FAILED) {
14104 $this->currPos = $p9;
14105 $r11 = self::$FAILED;
14106 goto seq_3;
14107 }
14108 // free $r14
14109 if (($this->input[$this->currPos] ?? null) === "]") {
14110 $this->currPos++;
14111 $r14 = "]";
14112 } else {
14113 if (!$silence) {$this->fail(21);}
14114 $r14 = self::$FAILED;
14115 $this->currPos = $p9;
14116 $r11 = self::$FAILED;
14117 goto seq_3;
14118 }
14119 $p15 = $this->currPos;
14120 $p17 = $this->currPos;
14121 // start choice_4
14122 $p18 = $this->currPos;
14123 if (($this->input[$this->currPos] ?? null) === "]") {
14124 $this->currPos++;
14125 $r16 = "]";
14126 } else {
14127 $r16 = self::$FAILED;
14128 }
14129 if ($r16 === self::$FAILED) {
14130 $r16 = false;
14131 goto choice_4;
14132 } else {
14133 $r16 = self::$FAILED;
14134 $this->currPos = $p18;
14135 }
14136 // free $p18
14137 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "]]", $this->currPos, 2, false) === 0) {
14138 $r16 = "]]";
14139 $this->currPos += 2;
14140 } else {
14141 $r16 = self::$FAILED;
14142 }
14143 choice_4:
14144 if ($r16!==self::$FAILED) {
14145 $r16 = false;
14146 $this->currPos = $p17;
14147 $r16 = substr($this->input, $p15, $this->currPos - $p15);
14148 } else {
14149 $r16 = self::$FAILED;
14150 $this->currPos = $p9;
14151 $r11 = self::$FAILED;
14152 goto seq_3;
14153 }
14154 // free $p17
14155 // free $p15
14156 $r11 = [$r12,$r13,$r14,$r16];
14157 seq_3:
14158 if ($r11!==self::$FAILED) {
14159 goto choice_3;
14160 }
14161 // free $p9
14162 if ($this->currPos < $this->inputLength) {
14163 $r11 = self::consumeChar($this->input, $this->currPos);;
14164 } else {
14165 $r11 = self::$FAILED;
14166 if (!$silence) {$this->fail(7);}
14167 }
14168 choice_3:
14169 // r <- $r11
14170 if ($r11===self::$FAILED) {
14171 $this->currPos = $p8;
14172 $r4 = self::$FAILED;
14173 goto seq_2;
14174 }
14175 $r4 = true;
14176 seq_2:
14177 if ($r4!==self::$FAILED) {
14178 $this->savedPos = $p5;
14179 $r4 = $this->a24($r11);
14180 }
14181 // free $p8
14182 choice_1:
14183 if ($r4!==self::$FAILED) {
14184 $r3[] = $r4;
14185 } else {
14186 break;
14187 }
14188 }
14189 if (count($r3) === 0) {
14190 $r3 = self::$FAILED;
14191 }
14192 // c <- $r3
14193 // free $r4
14194 $r1 = $r3;
14195 if ($r1!==self::$FAILED) {
14196 $this->savedPos = $p2;
14197 $r1 = $this->a43($r3);
14198 }
14199 $this->cache[$bucket][$key] = new GrammarCacheEntry(
14200 $this->currPos,
14201 $r1,
14202 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
14203 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
14204 );
14205 return $r1;
14206 }
14207 private function parselang_variant_flags($silence, $boolParams, &$param_preproc, &$param_th) {
14208 $key = json_encode([380, $boolParams & 0x3ebf, $param_preproc, $param_th]);
14209 $bucket = $this->currPos;
14210 $cached = $this->cache[$bucket][$key] ?? null;
14211 if ($cached) {
14212 $this->currPos = $cached->nextPos;
14213 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
14214 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
14215 return $cached->result;
14216 }
14217 $saved_preproc=$param_preproc;
14218 $saved_th=$param_th;
14219 // start choice_1
14220 $p2 = $this->currPos;
14221 // start seq_1
14222 $p3 = $this->currPos;
14223 $p5 = $this->currPos;
14224 for (;;) {
14225 $r6 = $this->discardspace_or_newline($silence);
14226 if ($r6===self::$FAILED) {
14227 break;
14228 }
14229 }
14230 // free $r6
14231 $r4 = true;
14232 // sp1 <- $r4
14233 if ($r4!==self::$FAILED) {
14234 $r4 = substr($this->input, $p5, $this->currPos - $p5);
14235 } else {
14236 $r4 = self::$FAILED;
14237 $r1 = self::$FAILED;
14238 goto seq_1;
14239 }
14240 // free $p5
14241 $r6 = $this->parselang_variant_flag($silence, $boolParams, $param_preproc, $param_th);
14242 // f <- $r6
14243 if ($r6===self::$FAILED) {
14244 $this->currPos = $p3;
14245 $r1 = self::$FAILED;
14246 goto seq_1;
14247 }
14248 $p5 = $this->currPos;
14249 for (;;) {
14250 $r8 = $this->discardspace_or_newline($silence);
14251 if ($r8===self::$FAILED) {
14252 break;
14253 }
14254 }
14255 // free $r8
14256 $r7 = true;
14257 // sp2 <- $r7
14258 if ($r7!==self::$FAILED) {
14259 $r7 = substr($this->input, $p5, $this->currPos - $p5);
14260 } else {
14261 $r7 = self::$FAILED;
14262 $this->currPos = $p3;
14263 $r1 = self::$FAILED;
14264 goto seq_1;
14265 }
14266 // free $p5
14267 // start seq_2
14268 $p5 = $this->currPos;
14269 if (($this->input[$this->currPos] ?? null) === ";") {
14270 $this->currPos++;
14271 $r9 = ";";
14272 } else {
14273 if (!$silence) {$this->fail(26);}
14274 $r9 = self::$FAILED;
14275 $r8 = self::$FAILED;
14276 goto seq_2;
14277 }
14278 $r10 = $this->parselang_variant_flags($silence, $boolParams, $param_preproc, $param_th);
14279 if ($r10===self::$FAILED) {
14280 $r10 = null;
14281 }
14282 $r8 = [$r9,$r10];
14283 seq_2:
14284 if ($r8===self::$FAILED) {
14285 $r8 = null;
14286 }
14287 // free $p5
14288 // more <- $r8
14289 $r1 = true;
14290 seq_1:
14291 if ($r1!==self::$FAILED) {
14292 $this->savedPos = $p2;
14293 $r1 = $this->a177($r4, $r6, $r7, $r8);
14294 goto choice_1;
14295 }
14296 // free $p3
14297 $p3 = $this->currPos;
14298 $p5 = $this->currPos;
14299 for (;;) {
14300 $r12 = $this->discardspace_or_newline($silence);
14301 if ($r12===self::$FAILED) {
14302 break;
14303 }
14304 }
14305 // free $r12
14306 $r11 = true;
14307 // sp <- $r11
14308 if ($r11!==self::$FAILED) {
14309 $r11 = substr($this->input, $p5, $this->currPos - $p5);
14310 } else {
14311 $r11 = self::$FAILED;
14312 }
14313 // free $p5
14314 $r1 = $r11;
14315 if ($r1!==self::$FAILED) {
14316 $this->savedPos = $p3;
14317 $r1 = $this->a178($r11);
14318 }
14319 choice_1:
14320 $this->cache[$bucket][$key] = new GrammarCacheEntry(
14321 $this->currPos,
14322 $r1,
14323 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
14324 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
14325 );
14326 return $r1;
14327 }
14328 private function parselang_variant_option($silence, $boolParams, &$param_preproc, &$param_th) {
14329 $key = json_encode([390, $boolParams & 0x3fff, $param_preproc, $param_th]);
14330 $bucket = $this->currPos;
14331 $cached = $this->cache[$bucket][$key] ?? null;
14332 if ($cached) {
14333 $this->currPos = $cached->nextPos;
14334 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
14335 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
14336 return $cached->result;
14337 }
14338 $saved_preproc=$param_preproc;
14339 $saved_th=$param_th;
14340 // start choice_1
14341 $p2 = $this->currPos;
14342 // start seq_1
14343 $p3 = $this->currPos;
14344 $p5 = $this->currPos;
14345 for (;;) {
14346 $r6 = $this->discardspace_or_newline($silence);
14347 if ($r6===self::$FAILED) {
14348 break;
14349 }
14350 }
14351 // free $r6
14352 $r4 = true;
14353 // sp1 <- $r4
14354 if ($r4!==self::$FAILED) {
14355 $r4 = substr($this->input, $p5, $this->currPos - $p5);
14356 } else {
14357 $r4 = self::$FAILED;
14358 $r1 = self::$FAILED;
14359 goto seq_1;
14360 }
14361 // free $p5
14362 $r6 = $this->parselang_variant_name($silence, $boolParams, $param_preproc, $param_th);
14363 // lang <- $r6
14364 if ($r6===self::$FAILED) {
14365 $this->currPos = $p3;
14366 $r1 = self::$FAILED;
14367 goto seq_1;
14368 }
14369 $p5 = $this->currPos;
14370 for (;;) {
14371 $r8 = $this->discardspace_or_newline($silence);
14372 if ($r8===self::$FAILED) {
14373 break;
14374 }
14375 }
14376 // free $r8
14377 $r7 = true;
14378 // sp2 <- $r7
14379 if ($r7!==self::$FAILED) {
14380 $r7 = substr($this->input, $p5, $this->currPos - $p5);
14381 } else {
14382 $r7 = self::$FAILED;
14383 $this->currPos = $p3;
14384 $r1 = self::$FAILED;
14385 goto seq_1;
14386 }
14387 // free $p5
14388 if (($this->input[$this->currPos] ?? null) === ":") {
14389 $this->currPos++;
14390 $r8 = ":";
14391 } else {
14392 if (!$silence) {$this->fail(18);}
14393 $r8 = self::$FAILED;
14394 $this->currPos = $p3;
14395 $r1 = self::$FAILED;
14396 goto seq_1;
14397 }
14398 $p5 = $this->currPos;
14399 for (;;) {
14400 $r10 = $this->discardspace_or_newline($silence);
14401 if ($r10===self::$FAILED) {
14402 break;
14403 }
14404 }
14405 // free $r10
14406 $r9 = true;
14407 // sp3 <- $r9
14408 if ($r9!==self::$FAILED) {
14409 $r9 = substr($this->input, $p5, $this->currPos - $p5);
14410 } else {
14411 $r9 = self::$FAILED;
14412 $this->currPos = $p3;
14413 $r1 = self::$FAILED;
14414 goto seq_1;
14415 }
14416 // free $p5
14417 // start choice_2
14418 $r10 = $this->parselang_variant_nowiki($silence, $boolParams, $param_preproc, $param_th);
14419 if ($r10!==self::$FAILED) {
14420 goto choice_2;
14421 }
14422 $r10 = $this->parselang_variant_text_no_semi($silence, $boolParams, $param_preproc, $param_th);
14423 choice_2:
14424 // lvtext <- $r10
14425 if ($r10===self::$FAILED) {
14426 $this->currPos = $p3;
14427 $r1 = self::$FAILED;
14428 goto seq_1;
14429 }
14430 $r1 = true;
14431 seq_1:
14432 if ($r1!==self::$FAILED) {
14433 $this->savedPos = $p2;
14434 $r1 = $this->a179($r4, $r6, $r7, $r9, $r10);
14435 goto choice_1;
14436 }
14437 // free $p3
14438 $p3 = $this->currPos;
14439 // start seq_2
14440 $p5 = $this->currPos;
14441 $p12 = $this->currPos;
14442 for (;;) {
14443 $r13 = $this->discardspace_or_newline($silence);
14444 if ($r13===self::$FAILED) {
14445 break;
14446 }
14447 }
14448 // free $r13
14449 $r11 = true;
14450 // sp1 <- $r11
14451 if ($r11!==self::$FAILED) {
14452 $r11 = substr($this->input, $p12, $this->currPos - $p12);
14453 } else {
14454 $r11 = self::$FAILED;
14455 $r1 = self::$FAILED;
14456 goto seq_2;
14457 }
14458 // free $p12
14459 // start choice_3
14460 $r13 = $this->parselang_variant_nowiki($silence, $boolParams, $param_preproc, $param_th);
14461 if ($r13!==self::$FAILED) {
14462 goto choice_3;
14463 }
14464 $r13 = $this->parselang_variant_text_no_semi_or_arrow($silence, $boolParams, $param_preproc, $param_th);
14465 choice_3:
14466 // from <- $r13
14467 if ($r13===self::$FAILED) {
14468 $this->currPos = $p5;
14469 $r1 = self::$FAILED;
14470 goto seq_2;
14471 }
14472 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "=>", $this->currPos, 2, false) === 0) {
14473 $r14 = "=>";
14474 $this->currPos += 2;
14475 } else {
14476 if (!$silence) {$this->fail(81);}
14477 $r14 = self::$FAILED;
14478 $this->currPos = $p5;
14479 $r1 = self::$FAILED;
14480 goto seq_2;
14481 }
14482 $p12 = $this->currPos;
14483 for (;;) {
14484 $r16 = $this->discardspace_or_newline($silence);
14485 if ($r16===self::$FAILED) {
14486 break;
14487 }
14488 }
14489 // free $r16
14490 $r15 = true;
14491 // sp2 <- $r15
14492 if ($r15!==self::$FAILED) {
14493 $r15 = substr($this->input, $p12, $this->currPos - $p12);
14494 } else {
14495 $r15 = self::$FAILED;
14496 $this->currPos = $p5;
14497 $r1 = self::$FAILED;
14498 goto seq_2;
14499 }
14500 // free $p12
14501 $r16 = $this->parselang_variant_name($silence, $boolParams, $param_preproc, $param_th);
14502 // lang <- $r16
14503 if ($r16===self::$FAILED) {
14504 $this->currPos = $p5;
14505 $r1 = self::$FAILED;
14506 goto seq_2;
14507 }
14508 $p12 = $this->currPos;
14509 for (;;) {
14510 $r18 = $this->discardspace_or_newline($silence);
14511 if ($r18===self::$FAILED) {
14512 break;
14513 }
14514 }
14515 // free $r18
14516 $r17 = true;
14517 // sp3 <- $r17
14518 if ($r17!==self::$FAILED) {
14519 $r17 = substr($this->input, $p12, $this->currPos - $p12);
14520 } else {
14521 $r17 = self::$FAILED;
14522 $this->currPos = $p5;
14523 $r1 = self::$FAILED;
14524 goto seq_2;
14525 }
14526 // free $p12
14527 if (($this->input[$this->currPos] ?? null) === ":") {
14528 $this->currPos++;
14529 $r18 = ":";
14530 } else {
14531 if (!$silence) {$this->fail(18);}
14532 $r18 = self::$FAILED;
14533 $this->currPos = $p5;
14534 $r1 = self::$FAILED;
14535 goto seq_2;
14536 }
14537 $p12 = $this->currPos;
14538 for (;;) {
14539 $r20 = $this->discardspace_or_newline($silence);
14540 if ($r20===self::$FAILED) {
14541 break;
14542 }
14543 }
14544 // free $r20
14545 $r19 = true;
14546 // sp4 <- $r19
14547 if ($r19!==self::$FAILED) {
14548 $r19 = substr($this->input, $p12, $this->currPos - $p12);
14549 } else {
14550 $r19 = self::$FAILED;
14551 $this->currPos = $p5;
14552 $r1 = self::$FAILED;
14553 goto seq_2;
14554 }
14555 // free $p12
14556 // start choice_4
14557 $r20 = $this->parselang_variant_nowiki($silence, $boolParams, $param_preproc, $param_th);
14558 if ($r20!==self::$FAILED) {
14559 goto choice_4;
14560 }
14561 $r20 = $this->parselang_variant_text_no_semi($silence, $boolParams, $param_preproc, $param_th);
14562 choice_4:
14563 // to <- $r20
14564 if ($r20===self::$FAILED) {
14565 $this->currPos = $p5;
14566 $r1 = self::$FAILED;
14567 goto seq_2;
14568 }
14569 $r1 = true;
14570 seq_2:
14571 if ($r1!==self::$FAILED) {
14572 $this->savedPos = $p3;
14573 $r1 = $this->a180($r11, $r13, $r15, $r16, $r17, $r19, $r20);
14574 }
14575 // free $p5
14576 choice_1:
14577 $this->cache[$bucket][$key] = new GrammarCacheEntry(
14578 $this->currPos,
14579 $r1,
14580 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
14581 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
14582 );
14583 return $r1;
14584 }
14585 private function discardbogus_lang_variant_option($silence, $boolParams, &$param_preproc, &$param_th) {
14586 $key = json_encode([389, $boolParams & 0x3fff, $param_preproc, $param_th]);
14587 $bucket = $this->currPos;
14588 $cached = $this->cache[$bucket][$key] ?? null;
14589 if ($cached) {
14590 $this->currPos = $cached->nextPos;
14591 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
14592 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
14593 return $cached->result;
14594 }
14595 $saved_preproc=$param_preproc;
14596 $saved_th=$param_th;
14597 $r1 = $this->discardlang_variant_text($silence, $boolParams, $param_preproc, $param_th);
14598 if ($r1===self::$FAILED) {
14599 $r1 = null;
14600 }
14601 $this->cache[$bucket][$key] = new GrammarCacheEntry(
14602 $this->currPos,
14603 $r1,
14604 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
14605 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
14606 );
14607 return $r1;
14608 }
14609 private function parsefull_table_in_link_caption($silence, $boolParams, &$param_preproc, &$param_th) {
14610 $key = json_encode([460, $boolParams & 0x3ffe, $param_preproc, $param_th]);
14611 $bucket = $this->currPos;
14612 $cached = $this->cache[$bucket][$key] ?? null;
14613 if ($cached) {
14614 $this->currPos = $cached->nextPos;
14615 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
14616 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
14617 return $cached->result;
14618 }
14619 $saved_preproc=$param_preproc;
14620 $saved_th=$param_th;
14621 $p2 = $this->currPos;
14622 // start seq_1
14623 $p3 = $this->currPos;
14624 $p4 = $this->currPos;
14625 $r5 = $this->discardinline_breaks(true, $boolParams, $param_preproc, $param_th);
14626 if ($r5 === self::$FAILED) {
14627 $r5 = false;
14628 } else {
14629 $r5 = self::$FAILED;
14630 $this->currPos = $p4;
14631 $r1 = self::$FAILED;
14632 goto seq_1;
14633 }
14634 // free $p4
14635 $r6 = $this->parsefull_table_in_link_caption_parameterized($silence, ($boolParams & ~0x801) | 0x40, $param_preproc, $param_th);
14636 // r <- $r6
14637 if ($r6===self::$FAILED) {
14638 $this->currPos = $p3;
14639 $r1 = self::$FAILED;
14640 goto seq_1;
14641 }
14642 $r1 = true;
14643 seq_1:
14644 if ($r1!==self::$FAILED) {
14645 $this->savedPos = $p2;
14646 $r1 = $this->a181($r6);
14647 }
14648 // free $p3
14649 $this->cache[$bucket][$key] = new GrammarCacheEntry(
14650 $this->currPos,
14651 $r1,
14652 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
14653 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
14654 );
14655 return $r1;
14656 }
14657 private function parselang_variant_flag($silence, $boolParams, &$param_preproc, &$param_th) {
14658 $key = json_encode([382, $boolParams & 0x3ebf, $param_preproc, $param_th]);
14659 $bucket = $this->currPos;
14660 $cached = $this->cache[$bucket][$key] ?? null;
14661 if ($cached) {
14662 $this->currPos = $cached->nextPos;
14663 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
14664 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
14665 return $cached->result;
14666 }
14667 $saved_preproc=$param_preproc;
14668 $saved_th=$param_th;
14669 // start choice_1
14670 $p2 = $this->currPos;
14671 $r3 = $this->input[$this->currPos] ?? '';
14672 // f <- $r3
14673 if (preg_match("/^[\\-+A-Z]/", $r3)) {
14674 $this->currPos++;
14675 } else {
14676 $r3 = self::$FAILED;
14677 if (!$silence) {$this->fail(82);}
14678 }
14679 $r1 = $r3;
14680 if ($r1!==self::$FAILED) {
14681 $this->savedPos = $p2;
14682 $r1 = $this->a182($r3);
14683 goto choice_1;
14684 }
14685 $p4 = $this->currPos;
14686 $r5 = $this->parselang_variant_name($silence, $boolParams, $param_preproc, $param_th);
14687 // v <- $r5
14688 $r1 = $r5;
14689 if ($r1!==self::$FAILED) {
14690 $this->savedPos = $p4;
14691 $r1 = $this->a183($r5);
14692 goto choice_1;
14693 }
14694 $p6 = $this->currPos;
14695 $p8 = $this->currPos;
14696 $r7 = self::$FAILED;
14697 for (;;) {
14698 // start seq_1
14699 $p10 = $this->currPos;
14700 $p11 = $this->currPos;
14701 $r12 = $this->discardspace_or_newline(true);
14702 if ($r12 === self::$FAILED) {
14703 $r12 = false;
14704 } else {
14705 $r12 = self::$FAILED;
14706 $this->currPos = $p11;
14707 $r9 = self::$FAILED;
14708 goto seq_1;
14709 }
14710 // free $p11
14711 $p11 = $this->currPos;
14712 $r13 = $this->discardnowiki(true, $boolParams, $param_preproc, $param_th);
14713 if ($r13 === self::$FAILED) {
14714 $r13 = false;
14715 } else {
14716 $r13 = self::$FAILED;
14717 $this->currPos = $p11;
14718 $this->currPos = $p10;
14719 $r9 = self::$FAILED;
14720 goto seq_1;
14721 }
14722 // free $p11
14723 if (strcspn($this->input, "{}|;", $this->currPos, 1) !== 0) {
14724 $r14 = self::consumeChar($this->input, $this->currPos);
14725 } else {
14726 $r14 = self::$FAILED;
14727 if (!$silence) {$this->fail(83);}
14728 $this->currPos = $p10;
14729 $r9 = self::$FAILED;
14730 goto seq_1;
14731 }
14732 $r9 = true;
14733 seq_1:
14734 if ($r9!==self::$FAILED) {
14735 $r7 = true;
14736 } else {
14737 break;
14738 }
14739 // free $p10
14740 }
14741 // b <- $r7
14742 if ($r7!==self::$FAILED) {
14743 $r7 = substr($this->input, $p8, $this->currPos - $p8);
14744 } else {
14745 $r7 = self::$FAILED;
14746 }
14747 // free $r9
14748 // free $p8
14749 $r1 = $r7;
14750 if ($r1!==self::$FAILED) {
14751 $this->savedPos = $p6;
14752 $r1 = $this->a184($r7);
14753 }
14754 choice_1:
14755 $this->cache[$bucket][$key] = new GrammarCacheEntry(
14756 $this->currPos,
14757 $r1,
14758 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
14759 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
14760 );
14761 return $r1;
14762 }
14763 private function parselang_variant_name($silence, $boolParams, &$param_preproc, &$param_th) {
14764 $key = json_encode([384, $boolParams & 0x3ebf, $param_preproc, $param_th]);
14765 $bucket = $this->currPos;
14766 $cached = $this->cache[$bucket][$key] ?? null;
14767 if ($cached) {
14768 $this->currPos = $cached->nextPos;
14769 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
14770 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
14771 return $cached->result;
14772 }
14773 $saved_preproc=$param_preproc;
14774 $saved_th=$param_th;
14775 // start choice_1
14776 $p2 = $this->currPos;
14777 // start seq_1
14778 $p3 = $this->currPos;
14779 $r4 = $this->input[$this->currPos] ?? '';
14780 if (preg_match("/^[a-z]/", $r4)) {
14781 $this->currPos++;
14782 } else {
14783 $r4 = self::$FAILED;
14784 if (!$silence) {$this->fail(84);}
14785 $r1 = self::$FAILED;
14786 goto seq_1;
14787 }
14788 $r5 = self::$FAILED;
14789 for (;;) {
14790 $r6 = $this->input[$this->currPos] ?? '';
14791 if (preg_match("/^[\\-a-zA-Z]/", $r6)) {
14792 $this->currPos++;
14793 $r5 = true;
14794 } else {
14795 $r6 = self::$FAILED;
14796 if (!$silence) {$this->fail(85);}
14797 break;
14798 }
14799 }
14800 if ($r5===self::$FAILED) {
14801 $this->currPos = $p3;
14802 $r1 = self::$FAILED;
14803 goto seq_1;
14804 }
14805 // free $r6
14806 $r1 = true;
14807 seq_1:
14808 if ($r1!==self::$FAILED) {
14809 $r1 = substr($this->input, $p2, $this->currPos - $p2);
14810 goto choice_1;
14811 } else {
14812 $r1 = self::$FAILED;
14813 }
14814 // free $p3
14815 // free $p2
14816 $r1 = $this->parsenowiki_text($silence, $boolParams, $param_preproc, $param_th);
14817 choice_1:
14818 $this->cache[$bucket][$key] = new GrammarCacheEntry(
14819 $this->currPos,
14820 $r1,
14821 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
14822 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
14823 );
14824 return $r1;
14825 }
14826 private function parselang_variant_nowiki($silence, $boolParams, &$param_preproc, &$param_th) {
14827 $key = json_encode([392, $boolParams & 0x3ebf, $param_preproc, $param_th]);
14828 $bucket = $this->currPos;
14829 $cached = $this->cache[$bucket][$key] ?? null;
14830 if ($cached) {
14831 $this->currPos = $cached->nextPos;
14832 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
14833 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
14834 return $cached->result;
14835 }
14836 $saved_preproc=$param_preproc;
14837 $saved_th=$param_th;
14838 $p2 = $this->currPos;
14839 // start seq_1
14840 $p3 = $this->currPos;
14841 $r4 = $this->parsenowiki_text($silence, $boolParams, $param_preproc, $param_th);
14842 // n <- $r4
14843 if ($r4===self::$FAILED) {
14844 $r1 = self::$FAILED;
14845 goto seq_1;
14846 }
14847 $p6 = $this->currPos;
14848 for (;;) {
14849 $r7 = $this->discardspace_or_newline($silence);
14850 if ($r7===self::$FAILED) {
14851 break;
14852 }
14853 }
14854 // free $r7
14855 $r5 = true;
14856 // sp <- $r5
14857 if ($r5!==self::$FAILED) {
14858 $r5 = substr($this->input, $p6, $this->currPos - $p6);
14859 } else {
14860 $r5 = self::$FAILED;
14861 $this->currPos = $p3;
14862 $r1 = self::$FAILED;
14863 goto seq_1;
14864 }
14865 // free $p6
14866 $r1 = true;
14867 seq_1:
14868 if ($r1!==self::$FAILED) {
14869 $this->savedPos = $p2;
14870 $r1 = $this->a185($r4, $r5);
14871 }
14872 // free $p3
14873 $this->cache[$bucket][$key] = new GrammarCacheEntry(
14874 $this->currPos,
14875 $r1,
14876 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
14877 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
14878 );
14879 return $r1;
14880 }
14881 private function parselang_variant_text_no_semi($silence, $boolParams, &$param_preproc, &$param_th) {
14882 $key = json_encode([396, $boolParams & 0x3dff, $param_preproc, $param_th]);
14883 $bucket = $this->currPos;
14884 $cached = $this->cache[$bucket][$key] ?? null;
14885 if ($cached) {
14886 $this->currPos = $cached->nextPos;
14887 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
14888 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
14889 return $cached->result;
14890 }
14891 $saved_preproc=$param_preproc;
14892 $saved_th=$param_th;
14893 $r1 = $this->parselang_variant_text($silence, $boolParams | 0x200, $param_preproc, $param_th);
14894 $this->cache[$bucket][$key] = new GrammarCacheEntry(
14895 $this->currPos,
14896 $r1,
14897 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
14898 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
14899 );
14900 return $r1;
14901 }
14902 private function parselang_variant_text_no_semi_or_arrow($silence, $boolParams, &$param_preproc, &$param_th) {
14903 $key = json_encode([398, $boolParams & 0x39ff, $param_preproc, $param_th]);
14904 $bucket = $this->currPos;
14905 $cached = $this->cache[$bucket][$key] ?? null;
14906 if ($cached) {
14907 $this->currPos = $cached->nextPos;
14908 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
14909 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
14910 return $cached->result;
14911 }
14912 $saved_preproc=$param_preproc;
14913 $saved_th=$param_th;
14914 $r1 = $this->parselang_variant_text_no_semi($silence, $boolParams | 0x400, $param_preproc, $param_th);
14915 $this->cache[$bucket][$key] = new GrammarCacheEntry(
14916 $this->currPos,
14917 $r1,
14918 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
14919 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
14920 );
14921 return $r1;
14922 }
14923 private function discardlang_variant_text($silence, $boolParams, &$param_preproc, &$param_th) {
14924 $key = json_encode([395, $boolParams & 0x3fff, $param_preproc, $param_th]);
14925 $bucket = $this->currPos;
14926 $cached = $this->cache[$bucket][$key] ?? null;
14927 if ($cached) {
14928 $this->currPos = $cached->nextPos;
14929 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
14930 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
14931 return $cached->result;
14932 }
14933 $saved_preproc=$param_preproc;
14934 $saved_th=$param_th;
14935 $p2 = $this->currPos;
14936 $r3 = [];
14937 for (;;) {
14938 // start choice_1
14939 $r4 = $this->parseinlineline($silence, $boolParams, $param_preproc, $param_th);
14940 if ($r4!==self::$FAILED) {
14941 goto choice_1;
14942 }
14943 if (($this->input[$this->currPos] ?? null) === "|") {
14944 $this->currPos++;
14945 $r4 = "|";
14946 } else {
14947 if (!$silence) {$this->fail(13);}
14948 $r4 = self::$FAILED;
14949 }
14950 choice_1:
14951 if ($r4!==self::$FAILED) {
14952 $r3[] = $r4;
14953 } else {
14954 break;
14955 }
14956 }
14957 // tokens <- $r3
14958 // free $r4
14959 $r1 = $r3;
14960 if ($r1!==self::$FAILED) {
14961 $this->savedPos = $p2;
14962 $r1 = $this->a170($r3);
14963 }
14964 $this->cache[$bucket][$key] = new GrammarCacheEntry(
14965 $this->currPos,
14966 $r1,
14967 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
14968 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
14969 );
14970 return $r1;
14971 }
14972 private function parsefull_table_in_link_caption_parameterized($silence, $boolParams, &$param_preproc, &$param_th) {
14973 $key = json_encode([462, $boolParams & 0x3fff, $param_preproc, $param_th]);
14974 $bucket = $this->currPos;
14975 $cached = $this->cache[$bucket][$key] ?? null;
14976 if ($cached) {
14977 $this->currPos = $cached->nextPos;
14978 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
14979 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
14980 return $cached->result;
14981 }
14982 $saved_preproc=$param_preproc;
14983 $saved_th=$param_th;
14984 // start seq_1
14985 $p1 = $this->currPos;
14986 $r3 = $this->parsetable_start_tag($silence, $boolParams, $param_preproc, $param_th);
14987 if ($r3===self::$FAILED) {
14988 $r2 = self::$FAILED;
14989 goto seq_1;
14990 }
14991 $r4 = [];
14992 for (;;) {
14993 // start seq_2
14994 $p6 = $this->currPos;
14995 $r7 = [];
14996 for (;;) {
14997 // start seq_3
14998 $p9 = $this->currPos;
14999 $r10 = [];
15000 for (;;) {
15001 $r11 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th);
15002 if ($r11!==self::$FAILED) {
15003 $r10[] = $r11;
15004 } else {
15005 break;
15006 }
15007 }
15008 if (count($r10) === 0) {
15009 $r10 = self::$FAILED;
15010 }
15011 if ($r10===self::$FAILED) {
15012 $r8 = self::$FAILED;
15013 goto seq_3;
15014 }
15015 // free $r11
15016 // start choice_1
15017 $r11 = $this->parsetable_content_line($silence, $boolParams, $param_preproc, $param_th);
15018 if ($r11!==self::$FAILED) {
15019 goto choice_1;
15020 }
15021 $r11 = $this->parsetplarg_or_template($silence, $boolParams, $param_th, $param_preproc);
15022 choice_1:
15023 if ($r11===self::$FAILED) {
15024 $this->currPos = $p9;
15025 $r8 = self::$FAILED;
15026 goto seq_3;
15027 }
15028 $r8 = [$r10,$r11];
15029 seq_3:
15030 if ($r8!==self::$FAILED) {
15031 $r7[] = $r8;
15032 } else {
15033 break;
15034 }
15035 // free $p9
15036 }
15037 // free $r8
15038 $r8 = [];
15039 for (;;) {
15040 $r12 = $this->parsesol($silence, $boolParams, $param_preproc, $param_th);
15041 if ($r12!==self::$FAILED) {
15042 $r8[] = $r12;
15043 } else {
15044 break;
15045 }
15046 }
15047 if (count($r8) === 0) {
15048 $r8 = self::$FAILED;
15049 }
15050 if ($r8===self::$FAILED) {
15051 $this->currPos = $p6;
15052 $r5 = self::$FAILED;
15053 goto seq_2;
15054 }
15055 // free $r12
15056 $r12 = $this->parsetable_end_tag($silence);
15057 if ($r12===self::$FAILED) {
15058 $this->currPos = $p6;
15059 $r5 = self::$FAILED;
15060 goto seq_2;
15061 }
15062 $r5 = [$r7,$r8,$r12];
15063 seq_2:
15064 if ($r5!==self::$FAILED) {
15065 $r4[] = $r5;
15066 } else {
15067 break;
15068 }
15069 // free $p6
15070 }
15071 if (count($r4) === 0) {
15072 $r4 = self::$FAILED;
15073 }
15074 if ($r4===self::$FAILED) {
15075 $this->currPos = $p1;
15076 $r2 = self::$FAILED;
15077 goto seq_1;
15078 }
15079 // free $r5
15080 $r2 = [$r3,$r4];
15081 seq_1:
15082 // free $r2,$p1
15083 $this->cache[$bucket][$key] = new GrammarCacheEntry(
15084 $this->currPos,
15085 $r2,
15086 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
15087 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
15088 );
15089 return $r2;
15090 }
15091 private function discardnowiki($silence, $boolParams, &$param_preproc, &$param_th) {
15092 $key = json_encode([421, $boolParams & 0x3ebf, $param_preproc, $param_th]);
15093 $bucket = $this->currPos;
15094 $cached = $this->cache[$bucket][$key] ?? null;
15095 if ($cached) {
15096 $this->currPos = $cached->nextPos;
15097 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
15098 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
15099 return $cached->result;
15100 }
15101 $saved_preproc=$param_preproc;
15102 $saved_th=$param_th;
15103 $p2 = $this->currPos;
15104 // start seq_1
15105 $p3 = $this->currPos;
15106 $p4 = $this->currPos;
15107 // start seq_2
15108 $p6 = $this->currPos;
15109 if (($this->input[$this->currPos] ?? null) === "<") {
15110 $this->currPos++;
15111 $r7 = "<";
15112 } else {
15113 $r7 = self::$FAILED;
15114 $r5 = self::$FAILED;
15115 goto seq_2;
15116 }
15117 if (($this->input[$this->currPos] ?? null) === "/") {
15118 $this->currPos++;
15119 $r8 = "/";
15120 } else {
15121 $r8 = self::$FAILED;
15122 $r8 = null;
15123 }
15124 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "nowiki", $this->currPos, 6, true) === 0) {
15125 $r9 = substr($this->input, $this->currPos, 6);
15126 $this->currPos += 6;
15127 } else {
15128 $r9 = self::$FAILED;
15129 $this->currPos = $p6;
15130 $r5 = self::$FAILED;
15131 goto seq_2;
15132 }
15133 $r5 = true;
15134 seq_2:
15135 if ($r5!==self::$FAILED) {
15136 $r5 = false;
15137 $this->currPos = $p4;
15138 } else {
15139 $r1 = self::$FAILED;
15140 goto seq_1;
15141 }
15142 // free $p6
15143 // free $p4
15144 $r10 = $this->parseextension_annotation_tag($silence, $boolParams, $param_preproc, $param_th);
15145 // extToken <- $r10
15146 if ($r10===self::$FAILED) {
15147 $this->currPos = $p3;
15148 $r1 = self::$FAILED;
15149 goto seq_1;
15150 }
15151 $r1 = true;
15152 seq_1:
15153 if ($r1!==self::$FAILED) {
15154 $this->savedPos = $p2;
15155 $r1 = $this->a186($r10);
15156 }
15157 // free $p3
15158 $this->cache[$bucket][$key] = new GrammarCacheEntry(
15159 $this->currPos,
15160 $r1,
15161 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
15162 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
15163 );
15164 return $r1;
15165 }
15166 private function parsenowiki_text($silence, $boolParams, &$param_preproc, &$param_th) {
15167 $key = json_encode([422, $boolParams & 0x3ebf, $param_preproc, $param_th]);
15168 $bucket = $this->currPos;
15169 $cached = $this->cache[$bucket][$key] ?? null;
15170 if ($cached) {
15171 $this->currPos = $cached->nextPos;
15172 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
15173 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
15174 return $cached->result;
15175 }
15176 $saved_preproc=$param_preproc;
15177 $saved_th=$param_th;
15178 $p2 = $this->currPos;
15179 $r3 = $this->parsenowiki($silence, $boolParams, $param_preproc, $param_th);
15180 // extToken <- $r3
15181 $r1 = $r3;
15182 if ($r1!==self::$FAILED) {
15183 $this->savedPos = $p2;
15184 $r1 = $this->a187($r3);
15185 }
15186 $this->cache[$bucket][$key] = new GrammarCacheEntry(
15187 $this->currPos,
15188 $r1,
15189 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
15190 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
15191 );
15192 return $r1;
15193 }
15194 private function parsenowiki($silence, $boolParams, &$param_preproc, &$param_th) {
15195 $key = json_encode([420, $boolParams & 0x3ebf, $param_preproc, $param_th]);
15196 $bucket = $this->currPos;
15197 $cached = $this->cache[$bucket][$key] ?? null;
15198 if ($cached) {
15199 $this->currPos = $cached->nextPos;
15200 if ($cached->preproc !== self::$UNDEFINED) { $param_preproc = $cached->preproc; }
15201 if ($cached->th !== self::$UNDEFINED) { $param_th = $cached->th; }
15202 return $cached->result;
15203 }
15204 $saved_preproc=$param_preproc;
15205 $saved_th=$param_th;
15206 $p2 = $this->currPos;
15207 // start seq_1
15208 $p3 = $this->currPos;
15209 $p4 = $this->currPos;
15210 // start seq_2
15211 $p6 = $this->currPos;
15212 if (($this->input[$this->currPos] ?? null) === "<") {
15213 $this->currPos++;
15214 $r7 = "<";
15215 } else {
15216 $r7 = self::$FAILED;
15217 $r5 = self::$FAILED;
15218 goto seq_2;
15219 }
15220 if (($this->input[$this->currPos] ?? null) === "/") {
15221 $this->currPos++;
15222 $r8 = "/";
15223 } else {
15224 $r8 = self::$FAILED;
15225 $r8 = null;
15226 }
15227 if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "nowiki", $this->currPos, 6, true) === 0) {
15228 $r9 = substr($this->input, $this->currPos, 6);
15229 $this->currPos += 6;
15230 } else {
15231 $r9 = self::$FAILED;
15232 $this->currPos = $p6;
15233 $r5 = self::$FAILED;
15234 goto seq_2;
15235 }
15236 $r5 = true;
15237 seq_2:
15238 if ($r5!==self::$FAILED) {
15239 $r5 = false;
15240 $this->currPos = $p4;
15241 } else {
15242 $r1 = self::$FAILED;
15243 goto seq_1;
15244 }
15245 // free $p6
15246 // free $p4
15247 $r10 = $this->parseextension_annotation_tag($silence, $boolParams, $param_preproc, $param_th);
15248 // extToken <- $r10
15249 if ($r10===self::$FAILED) {
15250 $this->currPos = $p3;
15251 $r1 = self::$FAILED;
15252 goto seq_1;
15253 }
15254 $r1 = true;
15255 seq_1:
15256 if ($r1!==self::$FAILED) {
15257 $this->savedPos = $p2;
15258 $r1 = $this->a186($r10);
15259 }
15260 // free $p3
15261 $this->cache[$bucket][$key] = new GrammarCacheEntry(
15262 $this->currPos,
15263 $r1,
15264 $saved_preproc !== $param_preproc ? $param_preproc : self::$UNDEFINED,
15265 $saved_th !== $param_th ? $param_th : self::$UNDEFINED
15266 );
15267 return $r1;
15268 }
15269
15270 public function parse( $input, $options = [] ) {
15271 $this->initInternal( $input, $options );
15272 $startRule = $options['startRule'] ?? '(DEFAULT)';
15273 $result = null;
15274
15275 if ( !empty( $options['stream'] ) ) {
15276 switch ( $startRule ) {
15277 case '(DEFAULT)':
15278 case "start_async":
15279 return $this->streamstart_async(false, self::newRef(null));
15280 break;
15281 default:
15282 throw new \Wikimedia\WikiPEG\InternalError( "Can't stream rule $startRule." );
15283 }
15284 } else {
15285 switch ( $startRule ) {
15286 case '(DEFAULT)':
15287 case "start":
15288 $result = $this->parsestart(false, self::newRef(null));
15289 break;
15290
15291 case "table_start_tag":
15292 $result = $this->parsetable_start_tag(false, 0, self::newRef(null), self::newRef(null));
15293 break;
15294
15295 case "url":
15296 $result = $this->parseurl(false, self::newRef(null));
15297 break;
15298
15299 case "row_syntax_table_args":
15300 $result = $this->parserow_syntax_table_args(false, 0, self::newRef(null), self::newRef(null));
15301 break;
15302
15303 case "table_attributes":
15304 $result = $this->parsetable_attributes(false, 0, self::newRef(null), self::newRef(null));
15305 break;
15306
15307 case "generic_newline_attributes":
15308 $result = $this->parsegeneric_newline_attributes(false, 0, self::newRef(null), self::newRef(null));
15309 break;
15310
15311 case "tplarg_or_template_or_bust":
15312 $result = $this->parsetplarg_or_template_or_bust(false, self::newRef(null));
15313 break;
15314
15315 case "extlink":
15316 $result = $this->parseextlink(false, 0, self::newRef(null), self::newRef(null));
15317 break;
15318
15319 case "list_item":
15320 $result = $this->parselist_item(false, 0, self::newRef(null), self::newRef(null));
15321 break;
15322 default:
15323 throw new \Wikimedia\WikiPEG\InternalError( "Can't start parsing from rule $startRule." );
15324 }
15325 }
15326
15327 if ( $result !== self::$FAILED && $this->currPos === $this->inputLength ) {
15328 return $result;
15329 } else {
15330 if ( $result !== self::$FAILED && $this->currPos < $this->inputLength ) {
15331 $this->fail( 0 );
15332 }
15333 throw $this->buildParseException();
15334 }
15335 }
15336 }