Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 2339 |
|
0.00% |
0 / 79 |
CRAP | |
0.00% |
0 / 1 |
| Grammar | |
0.00% |
0 / 2339 |
|
0.00% |
0 / 79 |
408960 | |
0.00% |
0 / 1 |
| load | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
12 | |||
| addLines | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| a0 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a1 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a2 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a3 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a4 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a5 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a6 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a7 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
20 | |||
| a8 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a9 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
12 | |||
| a10 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| a11 | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
72 | |||
| a12 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a13 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a14 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a15 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a16 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a17 | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
20 | |||
| a18 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| a19 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
12 | |||
| a20 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
12 | |||
| a21 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a22 | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
12 | |||
| a23 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a24 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a25 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a26 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a27 | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
| a28 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| a29 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| parsetestfile | |
0.00% |
0 / 82 |
|
0.00% |
0 / 1 |
552 | |||
| parsecomment_or_blank_line | |
0.00% |
0 / 47 |
|
0.00% |
0 / 1 |
156 | |||
| parseformat | |
0.00% |
0 / 58 |
|
0.00% |
0 / 1 |
306 | |||
| parsetestfile_options | |
0.00% |
0 / 44 |
|
0.00% |
0 / 1 |
110 | |||
| parselined_chunk | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
12 | |||
| parsecomment | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
30 | |||
| parseeol | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
20 | |||
| parseLINE_NUM | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| discardrest_of_line | |
0.00% |
0 / 21 |
|
0.00% |
0 / 1 |
20 | |||
| parseoption_section | |
0.00% |
0 / 68 |
|
0.00% |
0 / 1 |
420 | |||
| discardend_section | |
0.00% |
0 / 42 |
|
0.00% |
0 / 1 |
110 | |||
| parsechunk | |
0.00% |
0 / 87 |
|
0.00% |
0 / 1 |
506 | |||
| parserest_of_line | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
30 | |||
| discardeol | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
12 | |||
| parseoption_list | |
0.00% |
0 / 67 |
|
0.00% |
0 / 1 |
380 | |||
| parsearticle | |
0.00% |
0 / 81 |
|
0.00% |
0 / 1 |
380 | |||
| parsetest | |
0.00% |
0 / 92 |
|
0.00% |
0 / 1 |
552 | |||
| parsehooks | |
0.00% |
0 / 58 |
|
0.00% |
0 / 1 |
210 | |||
| parsefunctionhooks | |
0.00% |
0 / 58 |
|
0.00% |
0 / 1 |
210 | |||
| parseline | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
30 | |||
| parsean_option | |
0.00% |
0 / 33 |
|
0.00% |
0 / 1 |
72 | |||
| discardstart_article | |
0.00% |
0 / 42 |
|
0.00% |
0 / 1 |
110 | |||
| discardstart_text | |
0.00% |
0 / 42 |
|
0.00% |
0 / 1 |
110 | |||
| parsetext | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
12 | |||
| discardend_article | |
0.00% |
0 / 42 |
|
0.00% |
0 / 1 |
110 | |||
| discardstart_test | |
0.00% |
0 / 42 |
|
0.00% |
0 / 1 |
110 | |||
| parsesection | |
0.00% |
0 / 81 |
|
0.00% |
0 / 1 |
506 | |||
| parseconfig_section | |
0.00% |
0 / 68 |
|
0.00% |
0 / 1 |
420 | |||
| discardstart_hooks | |
0.00% |
0 / 47 |
|
0.00% |
0 / 1 |
132 | |||
| discardend_hooks | |
0.00% |
0 / 42 |
|
0.00% |
0 / 1 |
110 | |||
| discardstart_functionhooks | |
0.00% |
0 / 47 |
|
0.00% |
0 / 1 |
132 | |||
| discardend_functionhooks | |
0.00% |
0 / 47 |
|
0.00% |
0 / 1 |
132 | |||
| parseoption_value | |
0.00% |
0 / 45 |
|
0.00% |
0 / 1 |
156 | |||
| parseconfig_list | |
0.00% |
0 / 61 |
|
0.00% |
0 / 1 |
272 | |||
| parseoption_value_list | |
0.00% |
0 / 64 |
|
0.00% |
0 / 1 |
306 | |||
| parsea_config_line | |
0.00% |
0 / 35 |
|
0.00% |
0 / 1 |
72 | |||
| parsean_option_value | |
0.00% |
0 / 61 |
|
0.00% |
0 / 1 |
240 | |||
| parseconfig_value | |
0.00% |
0 / 40 |
|
0.00% |
0 / 1 |
132 | |||
| parselink_target_value | |
0.00% |
0 / 26 |
|
0.00% |
0 / 1 |
72 | |||
| parsequoted_value | |
0.00% |
0 / 52 |
|
0.00% |
0 / 1 |
272 | |||
| parsejson_value | |
0.00% |
0 / 77 |
|
0.00% |
0 / 1 |
462 | |||
| parsevalid_json_value | |
0.00% |
0 / 70 |
|
0.00% |
0 / 1 |
306 | |||
| discardquoted_value | |
0.00% |
0 / 47 |
|
0.00% |
0 / 1 |
132 | |||
| discardarray_value | |
0.00% |
0 / 71 |
|
0.00% |
0 / 1 |
240 | |||
| discardjson_value | |
0.00% |
0 / 71 |
|
0.00% |
0 / 1 |
240 | |||
| parsearray_value | |
0.00% |
0 / 77 |
|
0.00% |
0 / 1 |
462 | |||
| parse | |
0.00% |
0 / 15 |
|
0.00% |
0 / 1 |
110 | |||
| 1 | <?php |
| 2 | /* |
| 3 | * Generated by WikiPEG |
| 4 | */ |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | /* File-scope initializer */ |
| 11 | declare( strict_types = 1 ); |
| 12 | namespace Wikimedia\Parsoid\ParserTests; |
| 13 | |
| 14 | use Wikimedia\Parsoid\Utils\PHPUtils; |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | class Grammar extends \Wikimedia\WikiPEG\PEGParserBase { |
| 20 | // initializer |
| 21 | |
| 22 | /** @var string */ |
| 23 | private $filename = ''; |
| 24 | /** @var int */ |
| 25 | private $lineNum = 1; |
| 26 | |
| 27 | /** |
| 28 | * @param string $filename |
| 29 | * @return array |
| 30 | */ |
| 31 | public static function load( string $filename ) { |
| 32 | $g = new Grammar(); |
| 33 | $g->filename = $filename; |
| 34 | $contents = file_get_contents( $filename ) ?: ''; |
| 35 | if ( !str_ends_with( $contents, "\n" ) ) { |
| 36 | # ensure that the file is terminated with a newline |
| 37 | # to match `end_section` rule (and other uses of `eol`) |
| 38 | $contents .= "\n"; |
| 39 | } |
| 40 | return $g->parse( $contents ); |
| 41 | } |
| 42 | |
| 43 | private function addLines( int $lineStart, array $item ) { |
| 44 | $item['filename'] = $this->filename; |
| 45 | $item['lineNumStart'] = $lineStart; |
| 46 | $item['lineNumEnd'] = $this->lineNum; |
| 47 | return $item; |
| 48 | } |
| 49 | |
| 50 | |
| 51 | // cache init |
| 52 | |
| 53 | |
| 54 | // expectations |
| 55 | protected $expectations = [ |
| 56 | 0 => ["type" => "end", "description" => "end of input"], |
| 57 | 1 => ["type" => "other", "description" => "comment_or_blank_line"], |
| 58 | 2 => ["type" => "other", "description" => "format"], |
| 59 | 3 => ["type" => "other", "description" => "testfile_options"], |
| 60 | 4 => ["type" => "other", "description" => "comment"], |
| 61 | 5 => ["type" => "class", "value" => "[ \\t]", "description" => "[ \\t]"], |
| 62 | 6 => ["type" => "other", "description" => "eol"], |
| 63 | 7 => ["type" => "literal", "value" => "!!", "description" => "\"!!\""], |
| 64 | 8 => ["type" => "literal", "value" => "version", "description" => "\"version\""], |
| 65 | 9 => ["type" => "class", "value" => "[0-9]", "description" => "[0-9]"], |
| 66 | 10 => ["type" => "other", "description" => "option_section"], |
| 67 | 11 => ["type" => "other", "description" => "end_section"], |
| 68 | 12 => ["type" => "literal", "value" => "#", "description" => "\"#\""], |
| 69 | 13 => ["type" => "literal", "value" => "\x0a", "description" => "\"\\n\""], |
| 70 | 14 => ["type" => "literal", "value" => "options", "description" => "\"options\""], |
| 71 | 15 => ["type" => "other", "description" => "option_list"], |
| 72 | 16 => ["type" => "other", "description" => "article"], |
| 73 | 17 => ["type" => "other", "description" => "test"], |
| 74 | 18 => ["type" => "other", "description" => "hooks"], |
| 75 | 19 => ["type" => "other", "description" => "functionhooks"], |
| 76 | 20 => ["type" => "class", "value" => "[^\\n]", "description" => "[^\\n]"], |
| 77 | 21 => ["type" => "other", "description" => "an_option"], |
| 78 | 22 => ["type" => "other", "description" => "start_article"], |
| 79 | 23 => ["type" => "other", "description" => "start_text"], |
| 80 | 24 => ["type" => "other", "description" => "end_article"], |
| 81 | 25 => ["type" => "other", "description" => "start_test"], |
| 82 | 26 => ["type" => "other", "description" => "section"], |
| 83 | 27 => ["type" => "other", "description" => "config_section"], |
| 84 | 28 => ["type" => "other", "description" => "start_hooks"], |
| 85 | 29 => ["type" => "other", "description" => "end_hooks"], |
| 86 | 30 => ["type" => "other", "description" => "start_functionhooks"], |
| 87 | 31 => ["type" => "other", "description" => "end_functionhooks"], |
| 88 | 32 => ["type" => "class", "value" => "[^ \\t\\n=!]", "description" => "[^ \\t\\n=!]"], |
| 89 | 33 => ["type" => "other", "description" => "option_value"], |
| 90 | 34 => ["type" => "class", "value" => "[^ \\t\\r\\n]", "description" => "[^ \\t\\r\\n]"], |
| 91 | 35 => ["type" => "literal", "value" => "config", "description" => "\"config\""], |
| 92 | 36 => ["type" => "other", "description" => "config_list"], |
| 93 | 37 => ["type" => "literal", "value" => "=", "description" => "\"=\""], |
| 94 | 38 => ["type" => "other", "description" => "option_value_list"], |
| 95 | 39 => ["type" => "other", "description" => "a_config_line"], |
| 96 | 40 => ["type" => "other", "description" => "an_option_value"], |
| 97 | 41 => ["type" => "literal", "value" => ",", "description" => "\",\""], |
| 98 | 42 => ["type" => "other", "description" => "config_value"], |
| 99 | 43 => ["type" => "other", "description" => "link_target_value"], |
| 100 | 44 => ["type" => "other", "description" => "quoted_value"], |
| 101 | 45 => ["type" => "class", "value" => "[^ \\t\\n\\\"\\'\\[\\]=,!\\{]", "description" => "[^ \\t\\n\\\"\\'\\[\\]=,!\\{]"], |
| 102 | 46 => ["type" => "other", "description" => "json_value"], |
| 103 | 47 => ["type" => "other", "description" => "valid_json_value"], |
| 104 | 48 => ["type" => "literal", "value" => "[[", "description" => "\"[[\""], |
| 105 | 49 => ["type" => "class", "value" => "[^\\]\\n]", "description" => "[^\\]\\n]"], |
| 106 | 50 => ["type" => "literal", "value" => "]]", "description" => "\"]]\""], |
| 107 | 51 => ["type" => "class", "value" => "[\\\"]", "description" => "[\\\"]"], |
| 108 | 52 => ["type" => "class", "value" => "[^\\\\\\\"\\n]", "description" => "[^\\\\\\\"\\n]"], |
| 109 | 53 => ["type" => "literal", "value" => "\\", "description" => "\"\\\\\""], |
| 110 | 54 => ["type" => "literal", "value" => "{", "description" => "\"{\""], |
| 111 | 55 => ["type" => "class", "value" => "[^\\\"\\{\\}\\n]", "description" => "[^\\\"\\{\\}\\n]"], |
| 112 | 56 => ["type" => "literal", "value" => "}", "description" => "\"}\""], |
| 113 | 57 => ["type" => "other", "description" => "array_value"], |
| 114 | 58 => ["type" => "literal", "value" => "[", "description" => "\"[\""], |
| 115 | 59 => ["type" => "class", "value" => "[^\\\"\\[\\]\\n]", "description" => "[^\\\"\\[\\]\\n]"], |
| 116 | 60 => ["type" => "literal", "value" => "]", "description" => "\"]\""], |
| 117 | ]; |
| 118 | |
| 119 | // actions |
| 120 | private function a0($nl) { |
| 121 | return [ 'type' => 'line', 'text' => $nl ]; |
| 122 | } |
| 123 | private function a1($l, $v) { |
| 124 | |
| 125 | return $this->addLines( $l, [ 'type' => 'version', 'text' => $v ] ); |
| 126 | |
| 127 | } |
| 128 | private function a2($l, $sec) { |
| 129 | |
| 130 | return $this->addLines( $l, $sec ); |
| 131 | |
| 132 | } |
| 133 | private function a3($l, $c) { |
| 134 | |
| 135 | return $this->addLines($l, $c); |
| 136 | |
| 137 | } |
| 138 | private function a4($text) { |
| 139 | return [ 'type' => 'comment', 'text' => $text ]; |
| 140 | } |
| 141 | private function a5($nl) { |
| 142 | $this->lineNum++; return $nl; |
| 143 | } |
| 144 | private function a6() { |
| 145 | return $this->lineNum; |
| 146 | } |
| 147 | private function a7($opts) { |
| 148 | |
| 149 | $o = []; |
| 150 | if ( $opts && count($opts) > 0 ) { |
| 151 | foreach ( $opts as $opt ) { |
| 152 | $o[$opt['k']] = $opt['v']; |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | return [ 'type' => 'section', 'name' => 'options', 'text' => $o ]; |
| 157 | |
| 158 | } |
| 159 | private function a8($l) { |
| 160 | return [ 'type' => 'line', 'text' => $l ]; |
| 161 | } |
| 162 | private function a9($o, $rest) { |
| 163 | |
| 164 | $result = [ $o ]; |
| 165 | if ( $rest && count( $rest ) > 0 ) { |
| 166 | $result = array_merge( $result, $rest ); |
| 167 | } |
| 168 | return $result; |
| 169 | |
| 170 | } |
| 171 | private function a10($title, $text) { |
| 172 | |
| 173 | return [ |
| 174 | 'type' => 'article', |
| 175 | 'title' => $title, |
| 176 | 'text' => $text |
| 177 | ]; |
| 178 | |
| 179 | } |
| 180 | private function a11($testName, $sections) { |
| 181 | |
| 182 | $test = [ |
| 183 | 'type' => 'test', |
| 184 | 'testName' => $testName |
| 185 | ]; |
| 186 | |
| 187 | foreach ( $sections as $section ) { |
| 188 | $test[$section['name']] = $section['text']; |
| 189 | } |
| 190 | // pegjs parser handles item options as follows: |
| 191 | // item option value of item.options.parsoid |
| 192 | // <none> undefined |
| 193 | // parsoid "" |
| 194 | // parsoid=wt2html "wt2html" |
| 195 | // parsoid=wt2html,wt2wt ["wt2html","wt2wt"] |
| 196 | // parsoid={"modes":["wt2wt"]} {modes:['wt2wt']} |
| 197 | |
| 198 | // treat 'parsoid=xxx,yyy' in options section as shorthand for |
| 199 | // 'parsoid={modes:["xxx","yyy"]}' |
| 200 | if ( isset($test['options']['parsoid'] ) ) { |
| 201 | if ($test['options']['parsoid'] === '') { |
| 202 | $test['options']['parsoid'] = []; |
| 203 | } |
| 204 | if ( is_string( $test['options']['parsoid'] ) ) { |
| 205 | $test['options']['parsoid'] = [ $test['options']['parsoid'] ]; |
| 206 | } |
| 207 | if ( is_array( $test['options']['parsoid'] ) && |
| 208 | isset( $test['options']['parsoid'][0] ) && |
| 209 | !isset( $test['options']['parsoid']['modes'] ) |
| 210 | ) { |
| 211 | $test['options']['parsoid'] = [ 'modes' => $test['options']['parsoid'] ]; |
| 212 | } |
| 213 | } |
| 214 | return $test; |
| 215 | |
| 216 | } |
| 217 | private function a12($text) { |
| 218 | |
| 219 | return [ 'type' => 'hooks', 'text' => $text ]; |
| 220 | |
| 221 | } |
| 222 | private function a13($text) { |
| 223 | |
| 224 | return [ 'type' => 'functionhooks', 'text' => $text ]; |
| 225 | |
| 226 | } |
| 227 | private function a14($k, $v) { |
| 228 | |
| 229 | return [ 'k' => strtolower( $k ), 'v' => $v ?? '' ]; |
| 230 | |
| 231 | } |
| 232 | private function a15($lines) { |
| 233 | |
| 234 | return implode("\n", $lines); |
| 235 | |
| 236 | } |
| 237 | private function a16($name, $text) { |
| 238 | |
| 239 | return [ 'name' => $name, 'text' => $text ]; |
| 240 | |
| 241 | } |
| 242 | private function a17($items) { |
| 243 | |
| 244 | $c = []; |
| 245 | if ( $items && count($items) > 0 ) { |
| 246 | foreach ( $items as $item ) { |
| 247 | $c[$item['k']] = $item['v']; |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | return [ 'type' => 'section', 'name' => 'config', 'text' => $c ]; |
| 252 | |
| 253 | } |
| 254 | private function a18($ovl) { |
| 255 | |
| 256 | return count( $ovl ) === 1 ? $ovl[0] : $ovl; |
| 257 | |
| 258 | } |
| 259 | private function a19($c, $rest) { |
| 260 | |
| 261 | $result = [ $c ]; |
| 262 | if ( $rest && count( $rest ) > 0 ) { |
| 263 | $result = array_merge( $result, $rest ); |
| 264 | } |
| 265 | return $result; |
| 266 | |
| 267 | } |
| 268 | private function a20($v, $rest) { |
| 269 | |
| 270 | $result = [ $v ]; |
| 271 | if ( $rest && count( $rest ) > 0 ) { |
| 272 | $result = array_merge( $result, $rest ); |
| 273 | } |
| 274 | return $result; |
| 275 | |
| 276 | } |
| 277 | private function a21($k, $v) { |
| 278 | |
| 279 | return [ 'k' => $k, 'v' => $v ]; |
| 280 | |
| 281 | } |
| 282 | private function a22($v) { |
| 283 | |
| 284 | if ( $v[0] === '"' || $v[0] === '{' ) { // } is needed to make pegjs happy |
| 285 | return PHPUtils::jsonDecode( $v ); |
| 286 | } |
| 287 | return $v; |
| 288 | |
| 289 | } |
| 290 | private function a23($v) { |
| 291 | |
| 292 | // Perhaps we should canonicalize the title? |
| 293 | // Protect with JSON.stringify just in case the link target starts with |
| 294 | // double-quote or open-brace. |
| 295 | return PHPUtils::jsonEncode( $v ); |
| 296 | |
| 297 | } |
| 298 | private function a24($c) { |
| 299 | return "\\" . $c; |
| 300 | } |
| 301 | private function a25($v) { |
| 302 | |
| 303 | return '"' . implode( $v ) . '"'; |
| 304 | |
| 305 | } |
| 306 | private function a26($v) { |
| 307 | |
| 308 | return "{" . implode( $v ) . "}"; |
| 309 | |
| 310 | } |
| 311 | private function a27($v) { |
| 312 | |
| 313 | // validate this as acceptable JSON |
| 314 | // (this ensures that wikipeg throws a syntax error if |
| 315 | // the JSON is invalid) |
| 316 | try { |
| 317 | json_decode($v, true, 100, JSON_THROW_ON_ERROR); |
| 318 | return true; |
| 319 | } catch (\JsonException) { |
| 320 | return false; |
| 321 | } |
| 322 | |
| 323 | } |
| 324 | private function a28($v) { |
| 325 | |
| 326 | // The value is valid JSON; return the decoded value. |
| 327 | return json_decode($v, true); |
| 328 | |
| 329 | } |
| 330 | private function a29($v) { |
| 331 | |
| 332 | return "[" . implode( $v ) . "]"; |
| 333 | |
| 334 | } |
| 335 | |
| 336 | // generated |
| 337 | private function parsetestfile($silence) { |
| 338 | // start seq_1 |
| 339 | $p2 = $this->currPos; |
| 340 | $r3 = []; |
| 341 | for (;;) { |
| 342 | // start seq_2 |
| 343 | $p5 = $this->currPos; |
| 344 | if (strspn($this->input, "\x09\x0a #", $this->currPos, 1) !== 0) { |
| 345 | $r6 = true; |
| 346 | $r6 = false; |
| 347 | $this->currPos = $p5; |
| 348 | } else { |
| 349 | $r6 = self::$FAILED; |
| 350 | if (!$silence) { $this->fail(1); } |
| 351 | $r4 = self::$FAILED; |
| 352 | goto seq_2; |
| 353 | } |
| 354 | $r4 = $this->parsecomment_or_blank_line($silence); |
| 355 | if ($r4===self::$FAILED) { |
| 356 | $this->currPos = $p5; |
| 357 | $r4 = self::$FAILED; |
| 358 | goto seq_2; |
| 359 | } |
| 360 | seq_2: |
| 361 | if ($r4!==self::$FAILED) { |
| 362 | $r3[] = $r4; |
| 363 | } else { |
| 364 | break; |
| 365 | } |
| 366 | // free $p5 |
| 367 | } |
| 368 | // free $r4 |
| 369 | // free $r6 |
| 370 | // start seq_3 |
| 371 | $p5 = $this->currPos; |
| 372 | $r4 = $this->input[$this->currPos] ?? ''; |
| 373 | if ($r4 === "!") { |
| 374 | $r4 = false; |
| 375 | $this->currPos = $p5; |
| 376 | } else { |
| 377 | $r4 = self::$FAILED; |
| 378 | if (!$silence) { $this->fail(2); } |
| 379 | $r6 = self::$FAILED; |
| 380 | goto seq_3; |
| 381 | } |
| 382 | $r6 = $this->parseformat($silence); |
| 383 | if ($r6===self::$FAILED) { |
| 384 | $this->currPos = $p5; |
| 385 | $r6 = self::$FAILED; |
| 386 | goto seq_3; |
| 387 | } |
| 388 | seq_3: |
| 389 | if ($r6===self::$FAILED) { |
| 390 | $r6 = null; |
| 391 | } |
| 392 | // free $p5 |
| 393 | $r7 = []; |
| 394 | for (;;) { |
| 395 | // start seq_4 |
| 396 | $p5 = $this->currPos; |
| 397 | if (strspn($this->input, "\x09\x0a #", $this->currPos, 1) !== 0) { |
| 398 | $r9 = true; |
| 399 | $r9 = false; |
| 400 | $this->currPos = $p5; |
| 401 | } else { |
| 402 | $r9 = self::$FAILED; |
| 403 | if (!$silence) { $this->fail(1); } |
| 404 | $r8 = self::$FAILED; |
| 405 | goto seq_4; |
| 406 | } |
| 407 | $r8 = $this->parsecomment_or_blank_line($silence); |
| 408 | if ($r8===self::$FAILED) { |
| 409 | $this->currPos = $p5; |
| 410 | $r8 = self::$FAILED; |
| 411 | goto seq_4; |
| 412 | } |
| 413 | seq_4: |
| 414 | if ($r8!==self::$FAILED) { |
| 415 | $r7[] = $r8; |
| 416 | } else { |
| 417 | break; |
| 418 | } |
| 419 | // free $p5 |
| 420 | } |
| 421 | // free $r8 |
| 422 | // free $r9 |
| 423 | // start seq_5 |
| 424 | $p5 = $this->currPos; |
| 425 | $r8 = $this->input[$this->currPos] ?? ''; |
| 426 | if ($r8 === "!") { |
| 427 | $r8 = false; |
| 428 | $this->currPos = $p5; |
| 429 | } else { |
| 430 | $r8 = self::$FAILED; |
| 431 | if (!$silence) { $this->fail(3); } |
| 432 | $r9 = self::$FAILED; |
| 433 | goto seq_5; |
| 434 | } |
| 435 | $r9 = $this->parsetestfile_options($silence); |
| 436 | if ($r9===self::$FAILED) { |
| 437 | $this->currPos = $p5; |
| 438 | $r9 = self::$FAILED; |
| 439 | goto seq_5; |
| 440 | } |
| 441 | seq_5: |
| 442 | if ($r9===self::$FAILED) { |
| 443 | $r9 = null; |
| 444 | } |
| 445 | // free $p5 |
| 446 | $r10 = []; |
| 447 | for (;;) { |
| 448 | $r11 = $this->parselined_chunk($silence); |
| 449 | if ($r11!==self::$FAILED) { |
| 450 | $r10[] = $r11; |
| 451 | } else { |
| 452 | break; |
| 453 | } |
| 454 | } |
| 455 | if (count($r10) === 0) { |
| 456 | $r10 = self::$FAILED; |
| 457 | } |
| 458 | if ($r10===self::$FAILED) { |
| 459 | $this->currPos = $p2; |
| 460 | $r1 = self::$FAILED; |
| 461 | goto seq_1; |
| 462 | } |
| 463 | // free $r11 |
| 464 | $r1 = [$r3,$r6,$r7,$r9,$r10]; |
| 465 | seq_1: |
| 466 | // free $r3,$r6,$r4,$r7,$r9,$r8,$r10 |
| 467 | // free $p2 |
| 468 | return $r1; |
| 469 | } |
| 470 | private function parsecomment_or_blank_line($silence) { |
| 471 | // start choice_1 |
| 472 | // start seq_1 |
| 473 | $p2 = $this->currPos; |
| 474 | $r3 = $this->input[$this->currPos] ?? ''; |
| 475 | if ($r3 === "#") { |
| 476 | $r3 = false; |
| 477 | $this->currPos = $p2; |
| 478 | } else { |
| 479 | $r3 = self::$FAILED; |
| 480 | if (!$silence) { $this->fail(4); } |
| 481 | $r1 = self::$FAILED; |
| 482 | goto seq_1; |
| 483 | } |
| 484 | $r1 = $this->parsecomment($silence); |
| 485 | if ($r1===self::$FAILED) { |
| 486 | $this->currPos = $p2; |
| 487 | $r1 = self::$FAILED; |
| 488 | goto seq_1; |
| 489 | } |
| 490 | seq_1: |
| 491 | if ($r1!==self::$FAILED) { |
| 492 | goto choice_1; |
| 493 | } |
| 494 | // free $p2 |
| 495 | $p2 = $this->currPos; |
| 496 | // start seq_2 |
| 497 | $p4 = $this->currPos; |
| 498 | $r5 = strspn($this->input, "\x09 ", $this->currPos); |
| 499 | if ($r5 > 0) { |
| 500 | $this->currPos += $r5; |
| 501 | } else { |
| 502 | $r5 = self::$FAILED; |
| 503 | if (!$silence) { $this->fail(5); } |
| 504 | $r5 = null; |
| 505 | } |
| 506 | // start seq_3 |
| 507 | $p7 = $this->currPos; |
| 508 | $r8 = $this->input[$this->currPos] ?? ''; |
| 509 | if ($r8 === "\x0a") { |
| 510 | $r8 = false; |
| 511 | $this->currPos = $p7; |
| 512 | } else { |
| 513 | $r8 = self::$FAILED; |
| 514 | if (!$silence) { $this->fail(6); } |
| 515 | $r6 = self::$FAILED; |
| 516 | goto seq_3; |
| 517 | } |
| 518 | $r6 = $this->parseeol($silence); |
| 519 | if ($r6===self::$FAILED) { |
| 520 | $this->currPos = $p7; |
| 521 | $r6 = self::$FAILED; |
| 522 | goto seq_3; |
| 523 | } |
| 524 | seq_3: |
| 525 | // nl <- $r6 |
| 526 | if ($r6===self::$FAILED) { |
| 527 | $this->currPos = $p4; |
| 528 | $r1 = self::$FAILED; |
| 529 | goto seq_2; |
| 530 | } |
| 531 | // free $p7 |
| 532 | $r1 = true; |
| 533 | seq_2: |
| 534 | if ($r1!==self::$FAILED) { |
| 535 | $this->savedPos = $p2; |
| 536 | $r1 = $this->a0($r6); |
| 537 | } |
| 538 | // free $r5,$r8 |
| 539 | // free $p4 |
| 540 | // free $p2 |
| 541 | choice_1: |
| 542 | return $r1; |
| 543 | } |
| 544 | private function parseformat($silence) { |
| 545 | $p2 = $this->currPos; |
| 546 | // start seq_1 |
| 547 | $p3 = $this->currPos; |
| 548 | $r4 = $this->parseLINE_NUM($silence); |
| 549 | // l <- $r4 |
| 550 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 551 | $r5 = true; |
| 552 | $this->currPos += 2; |
| 553 | } else { |
| 554 | if (!$silence) { $this->fail(7); } |
| 555 | $r5 = self::$FAILED; |
| 556 | $this->currPos = $p3; |
| 557 | $r1 = self::$FAILED; |
| 558 | goto seq_1; |
| 559 | } |
| 560 | $r6 = strspn($this->input, "\x09 ", $this->currPos); |
| 561 | if ($r6 > 0) { |
| 562 | $this->currPos += $r6; |
| 563 | } else { |
| 564 | $r6 = self::$FAILED; |
| 565 | if (!$silence) { $this->fail(5); } |
| 566 | $r6 = null; |
| 567 | } |
| 568 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "version", $this->currPos, 7, true) === 0) { |
| 569 | $r7 = true; |
| 570 | $this->currPos += 7; |
| 571 | } else { |
| 572 | if (!$silence) { $this->fail(8); } |
| 573 | $r7 = self::$FAILED; |
| 574 | $this->currPos = $p3; |
| 575 | $r1 = self::$FAILED; |
| 576 | goto seq_1; |
| 577 | } |
| 578 | $r8 = self::$FAILED; |
| 579 | for (;;) { |
| 580 | $r9 = strspn($this->input, "\x09 ", $this->currPos); |
| 581 | if ($r9 > 0) { |
| 582 | $this->currPos += $r9; |
| 583 | $r8 = true; |
| 584 | } else { |
| 585 | $r9 = self::$FAILED; |
| 586 | if (!$silence) { $this->fail(5); } |
| 587 | break; |
| 588 | } |
| 589 | } |
| 590 | if ($r8===self::$FAILED) { |
| 591 | $this->currPos = $p3; |
| 592 | $r1 = self::$FAILED; |
| 593 | goto seq_1; |
| 594 | } |
| 595 | // free $r9 |
| 596 | $p10 = $this->currPos; |
| 597 | $r9 = strspn($this->input, "0123456789", $this->currPos); |
| 598 | // v <- $r9 |
| 599 | if ($r9 > 0) { |
| 600 | $this->currPos += $r9; |
| 601 | $r9 = substr($this->input, $p10, $this->currPos - $p10); |
| 602 | } else { |
| 603 | $r9 = self::$FAILED; |
| 604 | if (!$silence) { $this->fail(9); } |
| 605 | $r9 = self::$FAILED; |
| 606 | $this->currPos = $p3; |
| 607 | $r1 = self::$FAILED; |
| 608 | goto seq_1; |
| 609 | } |
| 610 | // free $p10 |
| 611 | $r11 = $this->discardrest_of_line(); |
| 612 | if ($r11===self::$FAILED) { |
| 613 | $this->currPos = $p3; |
| 614 | $r1 = self::$FAILED; |
| 615 | goto seq_1; |
| 616 | } |
| 617 | $r1 = true; |
| 618 | seq_1: |
| 619 | if ($r1!==self::$FAILED) { |
| 620 | $this->savedPos = $p2; |
| 621 | $r1 = $this->a1($r4, $r9); |
| 622 | } |
| 623 | // free $r5,$r6,$r7,$r8,$r11 |
| 624 | // free $p3 |
| 625 | // free $p2 |
| 626 | return $r1; |
| 627 | } |
| 628 | private function parsetestfile_options($silence) { |
| 629 | $p2 = $this->currPos; |
| 630 | // start seq_1 |
| 631 | $p3 = $this->currPos; |
| 632 | $r4 = $this->parseLINE_NUM($silence); |
| 633 | // l <- $r4 |
| 634 | // start seq_2 |
| 635 | $p6 = $this->currPos; |
| 636 | $r7 = $this->input[$this->currPos] ?? ''; |
| 637 | if ($r7 === "!") { |
| 638 | $r7 = false; |
| 639 | $this->currPos = $p6; |
| 640 | } else { |
| 641 | $r7 = self::$FAILED; |
| 642 | if (!$silence) { $this->fail(10); } |
| 643 | $r5 = self::$FAILED; |
| 644 | goto seq_2; |
| 645 | } |
| 646 | $r5 = $this->parseoption_section($silence); |
| 647 | if ($r5===self::$FAILED) { |
| 648 | $this->currPos = $p6; |
| 649 | $r5 = self::$FAILED; |
| 650 | goto seq_2; |
| 651 | } |
| 652 | seq_2: |
| 653 | // sec <- $r5 |
| 654 | if ($r5===self::$FAILED) { |
| 655 | $this->currPos = $p3; |
| 656 | $r1 = self::$FAILED; |
| 657 | goto seq_1; |
| 658 | } |
| 659 | // free $p6 |
| 660 | // start seq_3 |
| 661 | $p6 = $this->currPos; |
| 662 | $r9 = $this->input[$this->currPos] ?? ''; |
| 663 | if ($r9 === "!") { |
| 664 | $r9 = false; |
| 665 | $this->currPos = $p6; |
| 666 | } else { |
| 667 | $r9 = self::$FAILED; |
| 668 | if (!$silence) { $this->fail(11); } |
| 669 | $r8 = self::$FAILED; |
| 670 | goto seq_3; |
| 671 | } |
| 672 | $r8 = $this->discardend_section(); |
| 673 | if ($r8===self::$FAILED) { |
| 674 | $this->currPos = $p6; |
| 675 | $r8 = self::$FAILED; |
| 676 | goto seq_3; |
| 677 | } |
| 678 | seq_3: |
| 679 | if ($r8===self::$FAILED) { |
| 680 | $this->currPos = $p3; |
| 681 | $r1 = self::$FAILED; |
| 682 | goto seq_1; |
| 683 | } |
| 684 | // free $p6 |
| 685 | $r1 = true; |
| 686 | seq_1: |
| 687 | if ($r1!==self::$FAILED) { |
| 688 | $this->savedPos = $p2; |
| 689 | $r1 = $this->a2($r4, $r5); |
| 690 | } |
| 691 | // free $r7,$r8,$r9 |
| 692 | // free $p3 |
| 693 | // free $p2 |
| 694 | return $r1; |
| 695 | } |
| 696 | private function parselined_chunk($silence) { |
| 697 | $p2 = $this->currPos; |
| 698 | // start seq_1 |
| 699 | $p3 = $this->currPos; |
| 700 | $r4 = $this->parseLINE_NUM($silence); |
| 701 | // l <- $r4 |
| 702 | $r5 = $this->parsechunk($silence); |
| 703 | // c <- $r5 |
| 704 | if ($r5===self::$FAILED) { |
| 705 | $this->currPos = $p3; |
| 706 | $r1 = self::$FAILED; |
| 707 | goto seq_1; |
| 708 | } |
| 709 | $r1 = true; |
| 710 | seq_1: |
| 711 | if ($r1!==self::$FAILED) { |
| 712 | $this->savedPos = $p2; |
| 713 | $r1 = $this->a3($r4, $r5); |
| 714 | } |
| 715 | // free $p3 |
| 716 | // free $p2 |
| 717 | return $r1; |
| 718 | } |
| 719 | private function parsecomment($silence) { |
| 720 | $p2 = $this->currPos; |
| 721 | // start seq_1 |
| 722 | $p3 = $this->currPos; |
| 723 | if (($this->input[$this->currPos] ?? null) === "#") { |
| 724 | $r4 = true; |
| 725 | $this->currPos++; |
| 726 | } else { |
| 727 | if (!$silence) { $this->fail(12); } |
| 728 | $r4 = self::$FAILED; |
| 729 | $r1 = self::$FAILED; |
| 730 | goto seq_1; |
| 731 | } |
| 732 | $r5 = $this->parserest_of_line($silence); |
| 733 | // text <- $r5 |
| 734 | if ($r5===self::$FAILED) { |
| 735 | $this->currPos = $p3; |
| 736 | $r1 = self::$FAILED; |
| 737 | goto seq_1; |
| 738 | } |
| 739 | $r1 = true; |
| 740 | seq_1: |
| 741 | if ($r1!==self::$FAILED) { |
| 742 | $this->savedPos = $p2; |
| 743 | $r1 = $this->a4($r5); |
| 744 | } |
| 745 | // free $r4 |
| 746 | // free $p3 |
| 747 | // free $p2 |
| 748 | return $r1; |
| 749 | } |
| 750 | private function parseeol($silence) { |
| 751 | $p2 = $this->currPos; |
| 752 | // nl <- $r3 |
| 753 | if (($this->input[$this->currPos] ?? null) === "\x0a") { |
| 754 | $r3 = "\x0a"; |
| 755 | $this->currPos++; |
| 756 | } else { |
| 757 | if (!$silence) { $this->fail(13); } |
| 758 | $r3 = self::$FAILED; |
| 759 | } |
| 760 | $r1 = $r3; |
| 761 | if ($r1!==self::$FAILED) { |
| 762 | $this->savedPos = $p2; |
| 763 | $r1 = $this->a5($r3); |
| 764 | } |
| 765 | // free $p2 |
| 766 | return $r1; |
| 767 | } |
| 768 | private function parseLINE_NUM($silence) { |
| 769 | $p2 = $this->currPos; |
| 770 | $r1 = true; |
| 771 | $this->savedPos = $p2; |
| 772 | $r1 = $this->a6(); |
| 773 | // free $p2 |
| 774 | return $r1; |
| 775 | } |
| 776 | private function discardrest_of_line() { |
| 777 | // start seq_1 |
| 778 | $p2 = $this->currPos; |
| 779 | $r1 = strcspn($this->input, "\x0a", $this->currPos); |
| 780 | $this->currPos += $r1; |
| 781 | // start seq_2 |
| 782 | $p4 = $this->currPos; |
| 783 | $r5 = $this->input[$this->currPos] ?? ''; |
| 784 | if ($r5 === "\x0a") { |
| 785 | $r5 = false; |
| 786 | $this->currPos = $p4; |
| 787 | } else { |
| 788 | $r5 = self::$FAILED; |
| 789 | $r3 = self::$FAILED; |
| 790 | goto seq_2; |
| 791 | } |
| 792 | $r3 = $this->discardeol(); |
| 793 | if ($r3===self::$FAILED) { |
| 794 | $this->currPos = $p4; |
| 795 | $r3 = self::$FAILED; |
| 796 | goto seq_2; |
| 797 | } |
| 798 | seq_2: |
| 799 | if ($r3===self::$FAILED) { |
| 800 | $this->currPos = $p2; |
| 801 | $r1 = self::$FAILED; |
| 802 | goto seq_1; |
| 803 | } |
| 804 | // free $p4 |
| 805 | seq_1: |
| 806 | // free $p2 |
| 807 | return $r1; |
| 808 | } |
| 809 | private function parseoption_section($silence) { |
| 810 | $p2 = $this->currPos; |
| 811 | // start seq_1 |
| 812 | $p3 = $this->currPos; |
| 813 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 814 | $r4 = true; |
| 815 | $this->currPos += 2; |
| 816 | } else { |
| 817 | if (!$silence) { $this->fail(7); } |
| 818 | $r4 = self::$FAILED; |
| 819 | $r1 = self::$FAILED; |
| 820 | goto seq_1; |
| 821 | } |
| 822 | $r5 = strspn($this->input, "\x09 ", $this->currPos); |
| 823 | if ($r5 > 0) { |
| 824 | $this->currPos += $r5; |
| 825 | } else { |
| 826 | $r5 = self::$FAILED; |
| 827 | if (!$silence) { $this->fail(5); } |
| 828 | $r5 = null; |
| 829 | } |
| 830 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "options", $this->currPos, 7, false) === 0) { |
| 831 | $r6 = true; |
| 832 | $this->currPos += 7; |
| 833 | } else { |
| 834 | if (!$silence) { $this->fail(14); } |
| 835 | $r6 = self::$FAILED; |
| 836 | $this->currPos = $p3; |
| 837 | $r1 = self::$FAILED; |
| 838 | goto seq_1; |
| 839 | } |
| 840 | $r7 = strspn($this->input, "\x09 ", $this->currPos); |
| 841 | if ($r7 > 0) { |
| 842 | $this->currPos += $r7; |
| 843 | } else { |
| 844 | $r7 = self::$FAILED; |
| 845 | if (!$silence) { $this->fail(5); } |
| 846 | $r7 = null; |
| 847 | } |
| 848 | // start seq_2 |
| 849 | $p9 = $this->currPos; |
| 850 | $r10 = $this->input[$this->currPos] ?? ''; |
| 851 | if ($r10 === "\x0a") { |
| 852 | $r10 = false; |
| 853 | $this->currPos = $p9; |
| 854 | } else { |
| 855 | $r10 = self::$FAILED; |
| 856 | if (!$silence) { $this->fail(6); } |
| 857 | $r8 = self::$FAILED; |
| 858 | goto seq_2; |
| 859 | } |
| 860 | $r8 = $this->discardeol(); |
| 861 | if ($r8===self::$FAILED) { |
| 862 | $this->currPos = $p9; |
| 863 | $r8 = self::$FAILED; |
| 864 | goto seq_2; |
| 865 | } |
| 866 | seq_2: |
| 867 | if ($r8===self::$FAILED) { |
| 868 | $this->currPos = $p3; |
| 869 | $r1 = self::$FAILED; |
| 870 | goto seq_1; |
| 871 | } |
| 872 | // free $p9 |
| 873 | // start seq_3 |
| 874 | $p9 = $this->currPos; |
| 875 | if (strcspn($this->input, "\x09\x0a !=", $this->currPos, 1) !== 0) { |
| 876 | $r12 = true; |
| 877 | $r12 = false; |
| 878 | $this->currPos = $p9; |
| 879 | } else { |
| 880 | $r12 = self::$FAILED; |
| 881 | if (!$silence) { $this->fail(15); } |
| 882 | $r11 = self::$FAILED; |
| 883 | goto seq_3; |
| 884 | } |
| 885 | $r11 = $this->parseoption_list($silence); |
| 886 | if ($r11===self::$FAILED) { |
| 887 | $this->currPos = $p9; |
| 888 | $r11 = self::$FAILED; |
| 889 | goto seq_3; |
| 890 | } |
| 891 | seq_3: |
| 892 | if ($r11===self::$FAILED) { |
| 893 | $r11 = null; |
| 894 | } |
| 895 | // free $p9 |
| 896 | // opts <- $r11 |
| 897 | $r1 = true; |
| 898 | seq_1: |
| 899 | if ($r1!==self::$FAILED) { |
| 900 | $this->savedPos = $p2; |
| 901 | $r1 = $this->a7($r11); |
| 902 | } |
| 903 | // free $r4,$r5,$r6,$r7,$r8,$r10,$r12 |
| 904 | // free $p3 |
| 905 | // free $p2 |
| 906 | return $r1; |
| 907 | } |
| 908 | private function discardend_section() { |
| 909 | // start seq_1 |
| 910 | $p2 = $this->currPos; |
| 911 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 912 | $r3 = true; |
| 913 | $this->currPos += 2; |
| 914 | } else { |
| 915 | $r3 = self::$FAILED; |
| 916 | $r1 = self::$FAILED; |
| 917 | goto seq_1; |
| 918 | } |
| 919 | $r4 = strspn($this->input, "\x09 ", $this->currPos); |
| 920 | if ($r4 > 0) { |
| 921 | $this->currPos += $r4; |
| 922 | } else { |
| 923 | $r4 = self::$FAILED; |
| 924 | $r4 = null; |
| 925 | } |
| 926 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "end", $this->currPos, 3, false) === 0) { |
| 927 | $r1 = true; |
| 928 | $this->currPos += 3; |
| 929 | } else { |
| 930 | $r1 = self::$FAILED; |
| 931 | $this->currPos = $p2; |
| 932 | $r1 = self::$FAILED; |
| 933 | goto seq_1; |
| 934 | } |
| 935 | $r5 = strspn($this->input, "\x09 ", $this->currPos); |
| 936 | if ($r5 > 0) { |
| 937 | $this->currPos += $r5; |
| 938 | } else { |
| 939 | $r5 = self::$FAILED; |
| 940 | $r5 = null; |
| 941 | } |
| 942 | // start seq_2 |
| 943 | $p7 = $this->currPos; |
| 944 | $r8 = $this->input[$this->currPos] ?? ''; |
| 945 | if ($r8 === "\x0a") { |
| 946 | $r8 = false; |
| 947 | $this->currPos = $p7; |
| 948 | } else { |
| 949 | $r8 = self::$FAILED; |
| 950 | $r6 = self::$FAILED; |
| 951 | goto seq_2; |
| 952 | } |
| 953 | $r6 = $this->discardeol(); |
| 954 | if ($r6===self::$FAILED) { |
| 955 | $this->currPos = $p7; |
| 956 | $r6 = self::$FAILED; |
| 957 | goto seq_2; |
| 958 | } |
| 959 | seq_2: |
| 960 | if ($r6===self::$FAILED) { |
| 961 | $this->currPos = $p2; |
| 962 | $r1 = self::$FAILED; |
| 963 | goto seq_1; |
| 964 | } |
| 965 | // free $p7 |
| 966 | seq_1: |
| 967 | // free $p2 |
| 968 | return $r1; |
| 969 | } |
| 970 | private function parsechunk($silence) { |
| 971 | // start choice_1 |
| 972 | // start seq_1 |
| 973 | $p2 = $this->currPos; |
| 974 | if (strspn($this->input, "\x09\x0a #", $this->currPos, 1) !== 0) { |
| 975 | $r3 = true; |
| 976 | $r3 = false; |
| 977 | $this->currPos = $p2; |
| 978 | } else { |
| 979 | $r3 = self::$FAILED; |
| 980 | if (!$silence) { $this->fail(1); } |
| 981 | $r1 = self::$FAILED; |
| 982 | goto seq_1; |
| 983 | } |
| 984 | $r1 = $this->parsecomment_or_blank_line($silence); |
| 985 | if ($r1===self::$FAILED) { |
| 986 | $this->currPos = $p2; |
| 987 | $r1 = self::$FAILED; |
| 988 | goto seq_1; |
| 989 | } |
| 990 | seq_1: |
| 991 | if ($r1!==self::$FAILED) { |
| 992 | goto choice_1; |
| 993 | } |
| 994 | // free $p2 |
| 995 | // start seq_2 |
| 996 | $p2 = $this->currPos; |
| 997 | $r4 = $this->input[$this->currPos] ?? ''; |
| 998 | if ($r4 === "!") { |
| 999 | $r4 = false; |
| 1000 | $this->currPos = $p2; |
| 1001 | } else { |
| 1002 | $r4 = self::$FAILED; |
| 1003 | if (!$silence) { $this->fail(16); } |
| 1004 | $r1 = self::$FAILED; |
| 1005 | goto seq_2; |
| 1006 | } |
| 1007 | $r1 = $this->parsearticle($silence); |
| 1008 | if ($r1===self::$FAILED) { |
| 1009 | $this->currPos = $p2; |
| 1010 | $r1 = self::$FAILED; |
| 1011 | goto seq_2; |
| 1012 | } |
| 1013 | seq_2: |
| 1014 | if ($r1!==self::$FAILED) { |
| 1015 | goto choice_1; |
| 1016 | } |
| 1017 | // free $p2 |
| 1018 | // start seq_3 |
| 1019 | $p2 = $this->currPos; |
| 1020 | $r5 = $this->input[$this->currPos] ?? ''; |
| 1021 | if ($r5 === "!") { |
| 1022 | $r5 = false; |
| 1023 | $this->currPos = $p2; |
| 1024 | } else { |
| 1025 | $r5 = self::$FAILED; |
| 1026 | if (!$silence) { $this->fail(17); } |
| 1027 | $r1 = self::$FAILED; |
| 1028 | goto seq_3; |
| 1029 | } |
| 1030 | $r1 = $this->parsetest($silence); |
| 1031 | if ($r1===self::$FAILED) { |
| 1032 | $this->currPos = $p2; |
| 1033 | $r1 = self::$FAILED; |
| 1034 | goto seq_3; |
| 1035 | } |
| 1036 | seq_3: |
| 1037 | if ($r1!==self::$FAILED) { |
| 1038 | goto choice_1; |
| 1039 | } |
| 1040 | // free $p2 |
| 1041 | // start seq_4 |
| 1042 | $p2 = $this->currPos; |
| 1043 | $r6 = $this->input[$this->currPos] ?? ''; |
| 1044 | if ($r6 === "!") { |
| 1045 | $r6 = false; |
| 1046 | $this->currPos = $p2; |
| 1047 | } else { |
| 1048 | $r6 = self::$FAILED; |
| 1049 | if (!$silence) { $this->fail(18); } |
| 1050 | $r1 = self::$FAILED; |
| 1051 | goto seq_4; |
| 1052 | } |
| 1053 | $r1 = $this->parsehooks($silence); |
| 1054 | if ($r1===self::$FAILED) { |
| 1055 | $this->currPos = $p2; |
| 1056 | $r1 = self::$FAILED; |
| 1057 | goto seq_4; |
| 1058 | } |
| 1059 | seq_4: |
| 1060 | if ($r1!==self::$FAILED) { |
| 1061 | goto choice_1; |
| 1062 | } |
| 1063 | // free $p2 |
| 1064 | // start seq_5 |
| 1065 | $p2 = $this->currPos; |
| 1066 | $r7 = $this->input[$this->currPos] ?? ''; |
| 1067 | if ($r7 === "!") { |
| 1068 | $r7 = false; |
| 1069 | $this->currPos = $p2; |
| 1070 | } else { |
| 1071 | $r7 = self::$FAILED; |
| 1072 | if (!$silence) { $this->fail(19); } |
| 1073 | $r1 = self::$FAILED; |
| 1074 | goto seq_5; |
| 1075 | } |
| 1076 | $r1 = $this->parsefunctionhooks($silence); |
| 1077 | if ($r1===self::$FAILED) { |
| 1078 | $this->currPos = $p2; |
| 1079 | $r1 = self::$FAILED; |
| 1080 | goto seq_5; |
| 1081 | } |
| 1082 | seq_5: |
| 1083 | if ($r1!==self::$FAILED) { |
| 1084 | goto choice_1; |
| 1085 | } |
| 1086 | // free $p2 |
| 1087 | $p2 = $this->currPos; |
| 1088 | $r8 = $this->parseline($silence); |
| 1089 | // l <- $r8 |
| 1090 | $r1 = $r8; |
| 1091 | if ($r1!==self::$FAILED) { |
| 1092 | $this->savedPos = $p2; |
| 1093 | $r1 = $this->a8($r8); |
| 1094 | } |
| 1095 | // free $p2 |
| 1096 | choice_1: |
| 1097 | return $r1; |
| 1098 | } |
| 1099 | private function parserest_of_line($silence) { |
| 1100 | // start seq_1 |
| 1101 | $p2 = $this->currPos; |
| 1102 | $p3 = $this->currPos; |
| 1103 | $r1 = strcspn($this->input, "\x0a", $this->currPos); |
| 1104 | $this->currPos += $r1; |
| 1105 | $r1 = substr($this->input, $p3, $this->currPos - $p3); |
| 1106 | // free $p3 |
| 1107 | // start seq_2 |
| 1108 | $p3 = $this->currPos; |
| 1109 | $r5 = $this->input[$this->currPos] ?? ''; |
| 1110 | if ($r5 === "\x0a") { |
| 1111 | $r5 = false; |
| 1112 | $this->currPos = $p3; |
| 1113 | } else { |
| 1114 | $r5 = self::$FAILED; |
| 1115 | if (!$silence) { $this->fail(6); } |
| 1116 | $r4 = self::$FAILED; |
| 1117 | goto seq_2; |
| 1118 | } |
| 1119 | $r4 = $this->discardeol(); |
| 1120 | if ($r4===self::$FAILED) { |
| 1121 | $this->currPos = $p3; |
| 1122 | $r4 = self::$FAILED; |
| 1123 | goto seq_2; |
| 1124 | } |
| 1125 | seq_2: |
| 1126 | if ($r4===self::$FAILED) { |
| 1127 | $this->currPos = $p2; |
| 1128 | $r1 = self::$FAILED; |
| 1129 | goto seq_1; |
| 1130 | } |
| 1131 | // free $p3 |
| 1132 | seq_1: |
| 1133 | // free $p2 |
| 1134 | return $r1; |
| 1135 | } |
| 1136 | private function discardeol() { |
| 1137 | $p2 = $this->currPos; |
| 1138 | // nl <- $r3 |
| 1139 | if (($this->input[$this->currPos] ?? null) === "\x0a") { |
| 1140 | $r3 = "\x0a"; |
| 1141 | $this->currPos++; |
| 1142 | } else { |
| 1143 | $r3 = self::$FAILED; |
| 1144 | } |
| 1145 | $r1 = $r3; |
| 1146 | if ($r1!==self::$FAILED) { |
| 1147 | $this->savedPos = $p2; |
| 1148 | $r1 = $this->a5($r3); |
| 1149 | } |
| 1150 | // free $p2 |
| 1151 | return $r1; |
| 1152 | } |
| 1153 | private function parseoption_list($silence) { |
| 1154 | $p2 = $this->currPos; |
| 1155 | // start seq_1 |
| 1156 | $p3 = $this->currPos; |
| 1157 | // start seq_2 |
| 1158 | if (strcspn($this->input, "\x09\x0a !=", $this->currPos, 1) !== 0) { |
| 1159 | $r5 = true; |
| 1160 | $r5 = false; |
| 1161 | $this->currPos = $p3; |
| 1162 | } else { |
| 1163 | $r5 = self::$FAILED; |
| 1164 | if (!$silence) { $this->fail(21); } |
| 1165 | $r4 = self::$FAILED; |
| 1166 | goto seq_2; |
| 1167 | } |
| 1168 | $r4 = $this->parsean_option($silence); |
| 1169 | if ($r4===self::$FAILED) { |
| 1170 | $this->currPos = $p3; |
| 1171 | $r4 = self::$FAILED; |
| 1172 | goto seq_2; |
| 1173 | } |
| 1174 | seq_2: |
| 1175 | // o <- $r4 |
| 1176 | if ($r4===self::$FAILED) { |
| 1177 | $r1 = self::$FAILED; |
| 1178 | goto seq_1; |
| 1179 | } |
| 1180 | $r6 = self::$FAILED; |
| 1181 | for (;;) { |
| 1182 | // start choice_1 |
| 1183 | $r7 = $this->input[$this->currPos] ?? ''; |
| 1184 | if ($r7 === "\x09" || $r7 === " ") { |
| 1185 | $this->currPos++; |
| 1186 | goto choice_1; |
| 1187 | } else { |
| 1188 | $r7 = self::$FAILED; |
| 1189 | if (!$silence) { $this->fail(5); } |
| 1190 | } |
| 1191 | // start seq_3 |
| 1192 | $p8 = $this->currPos; |
| 1193 | $r9 = $this->input[$this->currPos] ?? ''; |
| 1194 | if ($r9 === "\x0a") { |
| 1195 | $r9 = false; |
| 1196 | $this->currPos = $p8; |
| 1197 | } else { |
| 1198 | $r9 = self::$FAILED; |
| 1199 | if (!$silence) { $this->fail(6); } |
| 1200 | $r7 = self::$FAILED; |
| 1201 | goto seq_3; |
| 1202 | } |
| 1203 | $r7 = $this->discardeol(); |
| 1204 | if ($r7===self::$FAILED) { |
| 1205 | $this->currPos = $p8; |
| 1206 | $r7 = self::$FAILED; |
| 1207 | goto seq_3; |
| 1208 | } |
| 1209 | seq_3: |
| 1210 | // free $p8 |
| 1211 | choice_1: |
| 1212 | if ($r7!==self::$FAILED) { |
| 1213 | $r6 = true; |
| 1214 | } else { |
| 1215 | break; |
| 1216 | } |
| 1217 | } |
| 1218 | if ($r6===self::$FAILED) { |
| 1219 | $this->currPos = $p3; |
| 1220 | $r1 = self::$FAILED; |
| 1221 | goto seq_1; |
| 1222 | } |
| 1223 | // free $r7 |
| 1224 | // start seq_4 |
| 1225 | $p8 = $this->currPos; |
| 1226 | if (strcspn($this->input, "\x09\x0a !=", $this->currPos, 1) !== 0) { |
| 1227 | $r10 = true; |
| 1228 | $r10 = false; |
| 1229 | $this->currPos = $p8; |
| 1230 | } else { |
| 1231 | $r10 = self::$FAILED; |
| 1232 | if (!$silence) { $this->fail(15); } |
| 1233 | $r7 = self::$FAILED; |
| 1234 | goto seq_4; |
| 1235 | } |
| 1236 | $r7 = $this->parseoption_list($silence); |
| 1237 | if ($r7===self::$FAILED) { |
| 1238 | $this->currPos = $p8; |
| 1239 | $r7 = self::$FAILED; |
| 1240 | goto seq_4; |
| 1241 | } |
| 1242 | seq_4: |
| 1243 | if ($r7===self::$FAILED) { |
| 1244 | $r7 = null; |
| 1245 | } |
| 1246 | // free $p8 |
| 1247 | // rest <- $r7 |
| 1248 | $r1 = true; |
| 1249 | seq_1: |
| 1250 | if ($r1!==self::$FAILED) { |
| 1251 | $this->savedPos = $p2; |
| 1252 | $r1 = $this->a9($r4, $r7); |
| 1253 | } |
| 1254 | // free $r5,$r6,$r10 |
| 1255 | // free $p3 |
| 1256 | // free $p2 |
| 1257 | return $r1; |
| 1258 | } |
| 1259 | private function parsearticle($silence) { |
| 1260 | $p2 = $this->currPos; |
| 1261 | // start seq_1 |
| 1262 | $p3 = $this->currPos; |
| 1263 | // start seq_2 |
| 1264 | $r5 = $this->input[$this->currPos] ?? ''; |
| 1265 | if ($r5 === "!") { |
| 1266 | $r5 = false; |
| 1267 | $this->currPos = $p3; |
| 1268 | } else { |
| 1269 | $r5 = self::$FAILED; |
| 1270 | if (!$silence) { $this->fail(22); } |
| 1271 | $r4 = self::$FAILED; |
| 1272 | goto seq_2; |
| 1273 | } |
| 1274 | $r4 = $this->discardstart_article(); |
| 1275 | if ($r4===self::$FAILED) { |
| 1276 | $this->currPos = $p3; |
| 1277 | $r4 = self::$FAILED; |
| 1278 | goto seq_2; |
| 1279 | } |
| 1280 | seq_2: |
| 1281 | if ($r4===self::$FAILED) { |
| 1282 | $r1 = self::$FAILED; |
| 1283 | goto seq_1; |
| 1284 | } |
| 1285 | $r6 = $this->parseline($silence); |
| 1286 | // title <- $r6 |
| 1287 | if ($r6===self::$FAILED) { |
| 1288 | $this->currPos = $p3; |
| 1289 | $r1 = self::$FAILED; |
| 1290 | goto seq_1; |
| 1291 | } |
| 1292 | // start seq_3 |
| 1293 | $p8 = $this->currPos; |
| 1294 | $r9 = $this->input[$this->currPos] ?? ''; |
| 1295 | if ($r9 === "!") { |
| 1296 | $r9 = false; |
| 1297 | $this->currPos = $p8; |
| 1298 | } else { |
| 1299 | $r9 = self::$FAILED; |
| 1300 | if (!$silence) { $this->fail(23); } |
| 1301 | $r7 = self::$FAILED; |
| 1302 | goto seq_3; |
| 1303 | } |
| 1304 | $r7 = $this->discardstart_text(); |
| 1305 | if ($r7===self::$FAILED) { |
| 1306 | $this->currPos = $p8; |
| 1307 | $r7 = self::$FAILED; |
| 1308 | goto seq_3; |
| 1309 | } |
| 1310 | seq_3: |
| 1311 | if ($r7===self::$FAILED) { |
| 1312 | $this->currPos = $p3; |
| 1313 | $r1 = self::$FAILED; |
| 1314 | goto seq_1; |
| 1315 | } |
| 1316 | // free $p8 |
| 1317 | $r10 = $this->parsetext($silence); |
| 1318 | // text <- $r10 |
| 1319 | // start choice_1 |
| 1320 | // start seq_4 |
| 1321 | $p8 = $this->currPos; |
| 1322 | $r12 = $this->input[$this->currPos] ?? ''; |
| 1323 | if ($r12 === "!") { |
| 1324 | $r12 = false; |
| 1325 | $this->currPos = $p8; |
| 1326 | } else { |
| 1327 | $r12 = self::$FAILED; |
| 1328 | if (!$silence) { $this->fail(24); } |
| 1329 | $r11 = self::$FAILED; |
| 1330 | goto seq_4; |
| 1331 | } |
| 1332 | $r11 = $this->discardend_article(); |
| 1333 | if ($r11===self::$FAILED) { |
| 1334 | $this->currPos = $p8; |
| 1335 | $r11 = self::$FAILED; |
| 1336 | goto seq_4; |
| 1337 | } |
| 1338 | seq_4: |
| 1339 | if ($r11!==self::$FAILED) { |
| 1340 | goto choice_1; |
| 1341 | } |
| 1342 | // free $p8 |
| 1343 | // start seq_5 |
| 1344 | $p8 = $this->currPos; |
| 1345 | $r13 = $this->input[$this->currPos] ?? ''; |
| 1346 | if ($r13 === "!") { |
| 1347 | $r13 = false; |
| 1348 | $this->currPos = $p8; |
| 1349 | } else { |
| 1350 | $r13 = self::$FAILED; |
| 1351 | if (!$silence) { $this->fail(11); } |
| 1352 | $r11 = self::$FAILED; |
| 1353 | goto seq_5; |
| 1354 | } |
| 1355 | $r11 = $this->discardend_section(); |
| 1356 | if ($r11===self::$FAILED) { |
| 1357 | $this->currPos = $p8; |
| 1358 | $r11 = self::$FAILED; |
| 1359 | goto seq_5; |
| 1360 | } |
| 1361 | seq_5: |
| 1362 | // free $p8 |
| 1363 | choice_1: |
| 1364 | if ($r11===self::$FAILED) { |
| 1365 | $this->currPos = $p3; |
| 1366 | $r1 = self::$FAILED; |
| 1367 | goto seq_1; |
| 1368 | } |
| 1369 | $r1 = true; |
| 1370 | seq_1: |
| 1371 | if ($r1!==self::$FAILED) { |
| 1372 | $this->savedPos = $p2; |
| 1373 | $r1 = $this->a10($r6, $r10); |
| 1374 | } |
| 1375 | // free $r4,$r5,$r7,$r9,$r11,$r12,$r13 |
| 1376 | // free $p3 |
| 1377 | // free $p2 |
| 1378 | return $r1; |
| 1379 | } |
| 1380 | private function parsetest($silence) { |
| 1381 | $p2 = $this->currPos; |
| 1382 | // start seq_1 |
| 1383 | $p3 = $this->currPos; |
| 1384 | // start seq_2 |
| 1385 | $r5 = $this->input[$this->currPos] ?? ''; |
| 1386 | if ($r5 === "!") { |
| 1387 | $r5 = false; |
| 1388 | $this->currPos = $p3; |
| 1389 | } else { |
| 1390 | $r5 = self::$FAILED; |
| 1391 | if (!$silence) { $this->fail(25); } |
| 1392 | $r4 = self::$FAILED; |
| 1393 | goto seq_2; |
| 1394 | } |
| 1395 | $r4 = $this->discardstart_test(); |
| 1396 | if ($r4===self::$FAILED) { |
| 1397 | $this->currPos = $p3; |
| 1398 | $r4 = self::$FAILED; |
| 1399 | goto seq_2; |
| 1400 | } |
| 1401 | seq_2: |
| 1402 | if ($r4===self::$FAILED) { |
| 1403 | $r1 = self::$FAILED; |
| 1404 | goto seq_1; |
| 1405 | } |
| 1406 | $r6 = $this->parsetext($silence); |
| 1407 | // testName <- $r6 |
| 1408 | $r7 = []; |
| 1409 | for (;;) { |
| 1410 | // start choice_1 |
| 1411 | // start seq_3 |
| 1412 | $p9 = $this->currPos; |
| 1413 | $r10 = $this->input[$this->currPos] ?? ''; |
| 1414 | if ($r10 === "!") { |
| 1415 | $r10 = false; |
| 1416 | $this->currPos = $p9; |
| 1417 | } else { |
| 1418 | $r10 = self::$FAILED; |
| 1419 | if (!$silence) { $this->fail(26); } |
| 1420 | $r8 = self::$FAILED; |
| 1421 | goto seq_3; |
| 1422 | } |
| 1423 | $r8 = $this->parsesection($silence); |
| 1424 | if ($r8===self::$FAILED) { |
| 1425 | $this->currPos = $p9; |
| 1426 | $r8 = self::$FAILED; |
| 1427 | goto seq_3; |
| 1428 | } |
| 1429 | seq_3: |
| 1430 | if ($r8!==self::$FAILED) { |
| 1431 | goto choice_1; |
| 1432 | } |
| 1433 | // free $p9 |
| 1434 | // start seq_4 |
| 1435 | $p9 = $this->currPos; |
| 1436 | $r11 = $this->input[$this->currPos] ?? ''; |
| 1437 | if ($r11 === "!") { |
| 1438 | $r11 = false; |
| 1439 | $this->currPos = $p9; |
| 1440 | } else { |
| 1441 | $r11 = self::$FAILED; |
| 1442 | if (!$silence) { $this->fail(27); } |
| 1443 | $r8 = self::$FAILED; |
| 1444 | goto seq_4; |
| 1445 | } |
| 1446 | $r8 = $this->parseconfig_section($silence); |
| 1447 | if ($r8===self::$FAILED) { |
| 1448 | $this->currPos = $p9; |
| 1449 | $r8 = self::$FAILED; |
| 1450 | goto seq_4; |
| 1451 | } |
| 1452 | seq_4: |
| 1453 | if ($r8!==self::$FAILED) { |
| 1454 | goto choice_1; |
| 1455 | } |
| 1456 | // free $p9 |
| 1457 | // start seq_5 |
| 1458 | $p9 = $this->currPos; |
| 1459 | $r12 = $this->input[$this->currPos] ?? ''; |
| 1460 | if ($r12 === "!") { |
| 1461 | $r12 = false; |
| 1462 | $this->currPos = $p9; |
| 1463 | } else { |
| 1464 | $r12 = self::$FAILED; |
| 1465 | if (!$silence) { $this->fail(10); } |
| 1466 | $r8 = self::$FAILED; |
| 1467 | goto seq_5; |
| 1468 | } |
| 1469 | $r8 = $this->parseoption_section($silence); |
| 1470 | if ($r8===self::$FAILED) { |
| 1471 | $this->currPos = $p9; |
| 1472 | $r8 = self::$FAILED; |
| 1473 | goto seq_5; |
| 1474 | } |
| 1475 | seq_5: |
| 1476 | // free $p9 |
| 1477 | choice_1: |
| 1478 | if ($r8!==self::$FAILED) { |
| 1479 | $r7[] = $r8; |
| 1480 | } else { |
| 1481 | break; |
| 1482 | } |
| 1483 | } |
| 1484 | // sections <- $r7 |
| 1485 | // free $r8 |
| 1486 | // free $r10,$r11,$r12 |
| 1487 | // start seq_6 |
| 1488 | $p9 = $this->currPos; |
| 1489 | $r11 = $this->input[$this->currPos] ?? ''; |
| 1490 | if ($r11 === "!") { |
| 1491 | $r11 = false; |
| 1492 | $this->currPos = $p9; |
| 1493 | } else { |
| 1494 | $r11 = self::$FAILED; |
| 1495 | if (!$silence) { $this->fail(11); } |
| 1496 | $r12 = self::$FAILED; |
| 1497 | goto seq_6; |
| 1498 | } |
| 1499 | $r12 = $this->discardend_section(); |
| 1500 | if ($r12===self::$FAILED) { |
| 1501 | $this->currPos = $p9; |
| 1502 | $r12 = self::$FAILED; |
| 1503 | goto seq_6; |
| 1504 | } |
| 1505 | seq_6: |
| 1506 | if ($r12===self::$FAILED) { |
| 1507 | $this->currPos = $p3; |
| 1508 | $r1 = self::$FAILED; |
| 1509 | goto seq_1; |
| 1510 | } |
| 1511 | // free $p9 |
| 1512 | $r1 = true; |
| 1513 | seq_1: |
| 1514 | if ($r1!==self::$FAILED) { |
| 1515 | $this->savedPos = $p2; |
| 1516 | $r1 = $this->a11($r6, $r7); |
| 1517 | } |
| 1518 | // free $r4,$r5,$r12,$r11 |
| 1519 | // free $p3 |
| 1520 | // free $p2 |
| 1521 | return $r1; |
| 1522 | } |
| 1523 | private function parsehooks($silence) { |
| 1524 | $p2 = $this->currPos; |
| 1525 | // start seq_1 |
| 1526 | $p3 = $this->currPos; |
| 1527 | // start seq_2 |
| 1528 | $r5 = $this->input[$this->currPos] ?? ''; |
| 1529 | if ($r5 === "!") { |
| 1530 | $r5 = false; |
| 1531 | $this->currPos = $p3; |
| 1532 | } else { |
| 1533 | $r5 = self::$FAILED; |
| 1534 | if (!$silence) { $this->fail(28); } |
| 1535 | $r4 = self::$FAILED; |
| 1536 | goto seq_2; |
| 1537 | } |
| 1538 | $r4 = $this->discardstart_hooks(); |
| 1539 | if ($r4===self::$FAILED) { |
| 1540 | $this->currPos = $p3; |
| 1541 | $r4 = self::$FAILED; |
| 1542 | goto seq_2; |
| 1543 | } |
| 1544 | seq_2: |
| 1545 | if ($r4===self::$FAILED) { |
| 1546 | $r1 = self::$FAILED; |
| 1547 | goto seq_1; |
| 1548 | } |
| 1549 | $r6 = $this->parsetext($silence); |
| 1550 | // text <- $r6 |
| 1551 | // start choice_1 |
| 1552 | // start seq_3 |
| 1553 | $p8 = $this->currPos; |
| 1554 | $r9 = $this->input[$this->currPos] ?? ''; |
| 1555 | if ($r9 === "!") { |
| 1556 | $r9 = false; |
| 1557 | $this->currPos = $p8; |
| 1558 | } else { |
| 1559 | $r9 = self::$FAILED; |
| 1560 | if (!$silence) { $this->fail(29); } |
| 1561 | $r7 = self::$FAILED; |
| 1562 | goto seq_3; |
| 1563 | } |
| 1564 | $r7 = $this->discardend_hooks(); |
| 1565 | if ($r7===self::$FAILED) { |
| 1566 | $this->currPos = $p8; |
| 1567 | $r7 = self::$FAILED; |
| 1568 | goto seq_3; |
| 1569 | } |
| 1570 | seq_3: |
| 1571 | if ($r7!==self::$FAILED) { |
| 1572 | goto choice_1; |
| 1573 | } |
| 1574 | // free $p8 |
| 1575 | // start seq_4 |
| 1576 | $p8 = $this->currPos; |
| 1577 | $r10 = $this->input[$this->currPos] ?? ''; |
| 1578 | if ($r10 === "!") { |
| 1579 | $r10 = false; |
| 1580 | $this->currPos = $p8; |
| 1581 | } else { |
| 1582 | $r10 = self::$FAILED; |
| 1583 | if (!$silence) { $this->fail(11); } |
| 1584 | $r7 = self::$FAILED; |
| 1585 | goto seq_4; |
| 1586 | } |
| 1587 | $r7 = $this->discardend_section(); |
| 1588 | if ($r7===self::$FAILED) { |
| 1589 | $this->currPos = $p8; |
| 1590 | $r7 = self::$FAILED; |
| 1591 | goto seq_4; |
| 1592 | } |
| 1593 | seq_4: |
| 1594 | // free $p8 |
| 1595 | choice_1: |
| 1596 | if ($r7===self::$FAILED) { |
| 1597 | $this->currPos = $p3; |
| 1598 | $r1 = self::$FAILED; |
| 1599 | goto seq_1; |
| 1600 | } |
| 1601 | $r1 = true; |
| 1602 | seq_1: |
| 1603 | if ($r1!==self::$FAILED) { |
| 1604 | $this->savedPos = $p2; |
| 1605 | $r1 = $this->a12($r6); |
| 1606 | } |
| 1607 | // free $r4,$r5,$r7,$r9,$r10 |
| 1608 | // free $p3 |
| 1609 | // free $p2 |
| 1610 | return $r1; |
| 1611 | } |
| 1612 | private function parsefunctionhooks($silence) { |
| 1613 | $p2 = $this->currPos; |
| 1614 | // start seq_1 |
| 1615 | $p3 = $this->currPos; |
| 1616 | // start seq_2 |
| 1617 | $r5 = $this->input[$this->currPos] ?? ''; |
| 1618 | if ($r5 === "!") { |
| 1619 | $r5 = false; |
| 1620 | $this->currPos = $p3; |
| 1621 | } else { |
| 1622 | $r5 = self::$FAILED; |
| 1623 | if (!$silence) { $this->fail(30); } |
| 1624 | $r4 = self::$FAILED; |
| 1625 | goto seq_2; |
| 1626 | } |
| 1627 | $r4 = $this->discardstart_functionhooks(); |
| 1628 | if ($r4===self::$FAILED) { |
| 1629 | $this->currPos = $p3; |
| 1630 | $r4 = self::$FAILED; |
| 1631 | goto seq_2; |
| 1632 | } |
| 1633 | seq_2: |
| 1634 | if ($r4===self::$FAILED) { |
| 1635 | $r1 = self::$FAILED; |
| 1636 | goto seq_1; |
| 1637 | } |
| 1638 | $r6 = $this->parsetext($silence); |
| 1639 | // text <- $r6 |
| 1640 | // start choice_1 |
| 1641 | // start seq_3 |
| 1642 | $p8 = $this->currPos; |
| 1643 | $r9 = $this->input[$this->currPos] ?? ''; |
| 1644 | if ($r9 === "!") { |
| 1645 | $r9 = false; |
| 1646 | $this->currPos = $p8; |
| 1647 | } else { |
| 1648 | $r9 = self::$FAILED; |
| 1649 | if (!$silence) { $this->fail(31); } |
| 1650 | $r7 = self::$FAILED; |
| 1651 | goto seq_3; |
| 1652 | } |
| 1653 | $r7 = $this->discardend_functionhooks(); |
| 1654 | if ($r7===self::$FAILED) { |
| 1655 | $this->currPos = $p8; |
| 1656 | $r7 = self::$FAILED; |
| 1657 | goto seq_3; |
| 1658 | } |
| 1659 | seq_3: |
| 1660 | if ($r7!==self::$FAILED) { |
| 1661 | goto choice_1; |
| 1662 | } |
| 1663 | // free $p8 |
| 1664 | // start seq_4 |
| 1665 | $p8 = $this->currPos; |
| 1666 | $r10 = $this->input[$this->currPos] ?? ''; |
| 1667 | if ($r10 === "!") { |
| 1668 | $r10 = false; |
| 1669 | $this->currPos = $p8; |
| 1670 | } else { |
| 1671 | $r10 = self::$FAILED; |
| 1672 | if (!$silence) { $this->fail(11); } |
| 1673 | $r7 = self::$FAILED; |
| 1674 | goto seq_4; |
| 1675 | } |
| 1676 | $r7 = $this->discardend_section(); |
| 1677 | if ($r7===self::$FAILED) { |
| 1678 | $this->currPos = $p8; |
| 1679 | $r7 = self::$FAILED; |
| 1680 | goto seq_4; |
| 1681 | } |
| 1682 | seq_4: |
| 1683 | // free $p8 |
| 1684 | choice_1: |
| 1685 | if ($r7===self::$FAILED) { |
| 1686 | $this->currPos = $p3; |
| 1687 | $r1 = self::$FAILED; |
| 1688 | goto seq_1; |
| 1689 | } |
| 1690 | $r1 = true; |
| 1691 | seq_1: |
| 1692 | if ($r1!==self::$FAILED) { |
| 1693 | $this->savedPos = $p2; |
| 1694 | $r1 = $this->a13($r6); |
| 1695 | } |
| 1696 | // free $r4,$r5,$r7,$r9,$r10 |
| 1697 | // free $p3 |
| 1698 | // free $p2 |
| 1699 | return $r1; |
| 1700 | } |
| 1701 | private function parseline($silence) { |
| 1702 | // start seq_1 |
| 1703 | $p2 = $this->currPos; |
| 1704 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 1705 | $r3 = true; |
| 1706 | } else { |
| 1707 | $r3 = self::$FAILED; |
| 1708 | } |
| 1709 | if ($r3 === self::$FAILED) { |
| 1710 | $r3 = false; |
| 1711 | } else { |
| 1712 | $r3 = self::$FAILED; |
| 1713 | $this->currPos = $p2; |
| 1714 | $r1 = self::$FAILED; |
| 1715 | goto seq_1; |
| 1716 | } |
| 1717 | $r1 = $this->parserest_of_line($silence); |
| 1718 | if ($r1===self::$FAILED) { |
| 1719 | $this->currPos = $p2; |
| 1720 | $r1 = self::$FAILED; |
| 1721 | goto seq_1; |
| 1722 | } |
| 1723 | seq_1: |
| 1724 | // free $p2 |
| 1725 | return $r1; |
| 1726 | } |
| 1727 | private function parsean_option($silence) { |
| 1728 | $p2 = $this->currPos; |
| 1729 | // start seq_1 |
| 1730 | $p3 = $this->currPos; |
| 1731 | $p5 = $this->currPos; |
| 1732 | $r4 = strcspn($this->input, "\x09\x0a !=", $this->currPos); |
| 1733 | // k <- $r4 |
| 1734 | if ($r4 > 0) { |
| 1735 | $this->currPos += $r4; |
| 1736 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
| 1737 | } else { |
| 1738 | $r4 = self::$FAILED; |
| 1739 | if (!$silence) { $this->fail(32); } |
| 1740 | $r4 = self::$FAILED; |
| 1741 | $r1 = self::$FAILED; |
| 1742 | goto seq_1; |
| 1743 | } |
| 1744 | // free $p5 |
| 1745 | // start seq_2 |
| 1746 | $p5 = $this->currPos; |
| 1747 | if (strspn($this->input, "\x09 =", $this->currPos, 1) !== 0) { |
| 1748 | $r7 = true; |
| 1749 | $r7 = false; |
| 1750 | $this->currPos = $p5; |
| 1751 | } else { |
| 1752 | $r7 = self::$FAILED; |
| 1753 | if (!$silence) { $this->fail(33); } |
| 1754 | $r6 = self::$FAILED; |
| 1755 | goto seq_2; |
| 1756 | } |
| 1757 | $r6 = $this->parseoption_value($silence); |
| 1758 | if ($r6===self::$FAILED) { |
| 1759 | $this->currPos = $p5; |
| 1760 | $r6 = self::$FAILED; |
| 1761 | goto seq_2; |
| 1762 | } |
| 1763 | seq_2: |
| 1764 | if ($r6===self::$FAILED) { |
| 1765 | $r6 = null; |
| 1766 | } |
| 1767 | // free $p5 |
| 1768 | // v <- $r6 |
| 1769 | $r1 = true; |
| 1770 | seq_1: |
| 1771 | if ($r1!==self::$FAILED) { |
| 1772 | $this->savedPos = $p2; |
| 1773 | $r1 = $this->a14($r4, $r6); |
| 1774 | } |
| 1775 | // free $r7 |
| 1776 | // free $p3 |
| 1777 | // free $p2 |
| 1778 | return $r1; |
| 1779 | } |
| 1780 | private function discardstart_article() { |
| 1781 | // start seq_1 |
| 1782 | $p2 = $this->currPos; |
| 1783 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 1784 | $r3 = true; |
| 1785 | $this->currPos += 2; |
| 1786 | } else { |
| 1787 | $r3 = self::$FAILED; |
| 1788 | $r1 = self::$FAILED; |
| 1789 | goto seq_1; |
| 1790 | } |
| 1791 | $r4 = strspn($this->input, "\x09 ", $this->currPos); |
| 1792 | if ($r4 > 0) { |
| 1793 | $this->currPos += $r4; |
| 1794 | } else { |
| 1795 | $r4 = self::$FAILED; |
| 1796 | $r4 = null; |
| 1797 | } |
| 1798 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "article", $this->currPos, 7, false) === 0) { |
| 1799 | $r1 = true; |
| 1800 | $this->currPos += 7; |
| 1801 | } else { |
| 1802 | $r1 = self::$FAILED; |
| 1803 | $this->currPos = $p2; |
| 1804 | $r1 = self::$FAILED; |
| 1805 | goto seq_1; |
| 1806 | } |
| 1807 | $r5 = strspn($this->input, "\x09 ", $this->currPos); |
| 1808 | if ($r5 > 0) { |
| 1809 | $this->currPos += $r5; |
| 1810 | } else { |
| 1811 | $r5 = self::$FAILED; |
| 1812 | $r5 = null; |
| 1813 | } |
| 1814 | // start seq_2 |
| 1815 | $p7 = $this->currPos; |
| 1816 | $r8 = $this->input[$this->currPos] ?? ''; |
| 1817 | if ($r8 === "\x0a") { |
| 1818 | $r8 = false; |
| 1819 | $this->currPos = $p7; |
| 1820 | } else { |
| 1821 | $r8 = self::$FAILED; |
| 1822 | $r6 = self::$FAILED; |
| 1823 | goto seq_2; |
| 1824 | } |
| 1825 | $r6 = $this->discardeol(); |
| 1826 | if ($r6===self::$FAILED) { |
| 1827 | $this->currPos = $p7; |
| 1828 | $r6 = self::$FAILED; |
| 1829 | goto seq_2; |
| 1830 | } |
| 1831 | seq_2: |
| 1832 | if ($r6===self::$FAILED) { |
| 1833 | $this->currPos = $p2; |
| 1834 | $r1 = self::$FAILED; |
| 1835 | goto seq_1; |
| 1836 | } |
| 1837 | // free $p7 |
| 1838 | seq_1: |
| 1839 | // free $p2 |
| 1840 | return $r1; |
| 1841 | } |
| 1842 | private function discardstart_text() { |
| 1843 | // start seq_1 |
| 1844 | $p2 = $this->currPos; |
| 1845 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 1846 | $r3 = true; |
| 1847 | $this->currPos += 2; |
| 1848 | } else { |
| 1849 | $r3 = self::$FAILED; |
| 1850 | $r1 = self::$FAILED; |
| 1851 | goto seq_1; |
| 1852 | } |
| 1853 | $r4 = strspn($this->input, "\x09 ", $this->currPos); |
| 1854 | if ($r4 > 0) { |
| 1855 | $this->currPos += $r4; |
| 1856 | } else { |
| 1857 | $r4 = self::$FAILED; |
| 1858 | $r4 = null; |
| 1859 | } |
| 1860 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "text", $this->currPos, 4, false) === 0) { |
| 1861 | $r1 = true; |
| 1862 | $this->currPos += 4; |
| 1863 | } else { |
| 1864 | $r1 = self::$FAILED; |
| 1865 | $this->currPos = $p2; |
| 1866 | $r1 = self::$FAILED; |
| 1867 | goto seq_1; |
| 1868 | } |
| 1869 | $r5 = strspn($this->input, "\x09 ", $this->currPos); |
| 1870 | if ($r5 > 0) { |
| 1871 | $this->currPos += $r5; |
| 1872 | } else { |
| 1873 | $r5 = self::$FAILED; |
| 1874 | $r5 = null; |
| 1875 | } |
| 1876 | // start seq_2 |
| 1877 | $p7 = $this->currPos; |
| 1878 | $r8 = $this->input[$this->currPos] ?? ''; |
| 1879 | if ($r8 === "\x0a") { |
| 1880 | $r8 = false; |
| 1881 | $this->currPos = $p7; |
| 1882 | } else { |
| 1883 | $r8 = self::$FAILED; |
| 1884 | $r6 = self::$FAILED; |
| 1885 | goto seq_2; |
| 1886 | } |
| 1887 | $r6 = $this->discardeol(); |
| 1888 | if ($r6===self::$FAILED) { |
| 1889 | $this->currPos = $p7; |
| 1890 | $r6 = self::$FAILED; |
| 1891 | goto seq_2; |
| 1892 | } |
| 1893 | seq_2: |
| 1894 | if ($r6===self::$FAILED) { |
| 1895 | $this->currPos = $p2; |
| 1896 | $r1 = self::$FAILED; |
| 1897 | goto seq_1; |
| 1898 | } |
| 1899 | // free $p7 |
| 1900 | seq_1: |
| 1901 | // free $p2 |
| 1902 | return $r1; |
| 1903 | } |
| 1904 | private function parsetext($silence) { |
| 1905 | $p2 = $this->currPos; |
| 1906 | $r3 = []; |
| 1907 | for (;;) { |
| 1908 | $r4 = $this->parseline($silence); |
| 1909 | if ($r4!==self::$FAILED) { |
| 1910 | $r3[] = $r4; |
| 1911 | } else { |
| 1912 | break; |
| 1913 | } |
| 1914 | } |
| 1915 | // lines <- $r3 |
| 1916 | // free $r4 |
| 1917 | $r1 = $r3; |
| 1918 | $this->savedPos = $p2; |
| 1919 | $r1 = $this->a15($r3); |
| 1920 | // free $p2 |
| 1921 | return $r1; |
| 1922 | } |
| 1923 | private function discardend_article() { |
| 1924 | // start seq_1 |
| 1925 | $p2 = $this->currPos; |
| 1926 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 1927 | $r3 = true; |
| 1928 | $this->currPos += 2; |
| 1929 | } else { |
| 1930 | $r3 = self::$FAILED; |
| 1931 | $r1 = self::$FAILED; |
| 1932 | goto seq_1; |
| 1933 | } |
| 1934 | $r4 = strspn($this->input, "\x09 ", $this->currPos); |
| 1935 | if ($r4 > 0) { |
| 1936 | $this->currPos += $r4; |
| 1937 | } else { |
| 1938 | $r4 = self::$FAILED; |
| 1939 | $r4 = null; |
| 1940 | } |
| 1941 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "endarticle", $this->currPos, 10, false) === 0) { |
| 1942 | $r1 = true; |
| 1943 | $this->currPos += 10; |
| 1944 | } else { |
| 1945 | $r1 = self::$FAILED; |
| 1946 | $this->currPos = $p2; |
| 1947 | $r1 = self::$FAILED; |
| 1948 | goto seq_1; |
| 1949 | } |
| 1950 | $r5 = strspn($this->input, "\x09 ", $this->currPos); |
| 1951 | if ($r5 > 0) { |
| 1952 | $this->currPos += $r5; |
| 1953 | } else { |
| 1954 | $r5 = self::$FAILED; |
| 1955 | $r5 = null; |
| 1956 | } |
| 1957 | // start seq_2 |
| 1958 | $p7 = $this->currPos; |
| 1959 | $r8 = $this->input[$this->currPos] ?? ''; |
| 1960 | if ($r8 === "\x0a") { |
| 1961 | $r8 = false; |
| 1962 | $this->currPos = $p7; |
| 1963 | } else { |
| 1964 | $r8 = self::$FAILED; |
| 1965 | $r6 = self::$FAILED; |
| 1966 | goto seq_2; |
| 1967 | } |
| 1968 | $r6 = $this->discardeol(); |
| 1969 | if ($r6===self::$FAILED) { |
| 1970 | $this->currPos = $p7; |
| 1971 | $r6 = self::$FAILED; |
| 1972 | goto seq_2; |
| 1973 | } |
| 1974 | seq_2: |
| 1975 | if ($r6===self::$FAILED) { |
| 1976 | $this->currPos = $p2; |
| 1977 | $r1 = self::$FAILED; |
| 1978 | goto seq_1; |
| 1979 | } |
| 1980 | // free $p7 |
| 1981 | seq_1: |
| 1982 | // free $p2 |
| 1983 | return $r1; |
| 1984 | } |
| 1985 | private function discardstart_test() { |
| 1986 | // start seq_1 |
| 1987 | $p2 = $this->currPos; |
| 1988 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 1989 | $r3 = true; |
| 1990 | $this->currPos += 2; |
| 1991 | } else { |
| 1992 | $r3 = self::$FAILED; |
| 1993 | $r1 = self::$FAILED; |
| 1994 | goto seq_1; |
| 1995 | } |
| 1996 | $r4 = strspn($this->input, "\x09 ", $this->currPos); |
| 1997 | if ($r4 > 0) { |
| 1998 | $this->currPos += $r4; |
| 1999 | } else { |
| 2000 | $r4 = self::$FAILED; |
| 2001 | $r4 = null; |
| 2002 | } |
| 2003 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "test", $this->currPos, 4, false) === 0) { |
| 2004 | $r1 = true; |
| 2005 | $this->currPos += 4; |
| 2006 | } else { |
| 2007 | $r1 = self::$FAILED; |
| 2008 | $this->currPos = $p2; |
| 2009 | $r1 = self::$FAILED; |
| 2010 | goto seq_1; |
| 2011 | } |
| 2012 | $r5 = strspn($this->input, "\x09 ", $this->currPos); |
| 2013 | if ($r5 > 0) { |
| 2014 | $this->currPos += $r5; |
| 2015 | } else { |
| 2016 | $r5 = self::$FAILED; |
| 2017 | $r5 = null; |
| 2018 | } |
| 2019 | // start seq_2 |
| 2020 | $p7 = $this->currPos; |
| 2021 | $r8 = $this->input[$this->currPos] ?? ''; |
| 2022 | if ($r8 === "\x0a") { |
| 2023 | $r8 = false; |
| 2024 | $this->currPos = $p7; |
| 2025 | } else { |
| 2026 | $r8 = self::$FAILED; |
| 2027 | $r6 = self::$FAILED; |
| 2028 | goto seq_2; |
| 2029 | } |
| 2030 | $r6 = $this->discardeol(); |
| 2031 | if ($r6===self::$FAILED) { |
| 2032 | $this->currPos = $p7; |
| 2033 | $r6 = self::$FAILED; |
| 2034 | goto seq_2; |
| 2035 | } |
| 2036 | seq_2: |
| 2037 | if ($r6===self::$FAILED) { |
| 2038 | $this->currPos = $p2; |
| 2039 | $r1 = self::$FAILED; |
| 2040 | goto seq_1; |
| 2041 | } |
| 2042 | // free $p7 |
| 2043 | seq_1: |
| 2044 | // free $p2 |
| 2045 | return $r1; |
| 2046 | } |
| 2047 | private function parsesection($silence) { |
| 2048 | $p2 = $this->currPos; |
| 2049 | // start seq_1 |
| 2050 | $p3 = $this->currPos; |
| 2051 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 2052 | $r4 = true; |
| 2053 | $this->currPos += 2; |
| 2054 | } else { |
| 2055 | if (!$silence) { $this->fail(7); } |
| 2056 | $r4 = self::$FAILED; |
| 2057 | $r1 = self::$FAILED; |
| 2058 | goto seq_1; |
| 2059 | } |
| 2060 | $r5 = strspn($this->input, "\x09 ", $this->currPos); |
| 2061 | if ($r5 > 0) { |
| 2062 | $this->currPos += $r5; |
| 2063 | } else { |
| 2064 | $r5 = self::$FAILED; |
| 2065 | if (!$silence) { $this->fail(5); } |
| 2066 | $r5 = null; |
| 2067 | } |
| 2068 | $p7 = $this->currPos; |
| 2069 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "test", $this->currPos, 4, false) === 0) { |
| 2070 | $r6 = true; |
| 2071 | } else { |
| 2072 | $r6 = self::$FAILED; |
| 2073 | } |
| 2074 | if ($r6 === self::$FAILED) { |
| 2075 | $r6 = false; |
| 2076 | } else { |
| 2077 | $r6 = self::$FAILED; |
| 2078 | $this->currPos = $p7; |
| 2079 | $this->currPos = $p3; |
| 2080 | $r1 = self::$FAILED; |
| 2081 | goto seq_1; |
| 2082 | } |
| 2083 | // free $p7 |
| 2084 | $p7 = $this->currPos; |
| 2085 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "end", $this->currPos, 3, false) === 0) { |
| 2086 | $r8 = true; |
| 2087 | } else { |
| 2088 | $r8 = self::$FAILED; |
| 2089 | } |
| 2090 | if ($r8 === self::$FAILED) { |
| 2091 | $r8 = false; |
| 2092 | } else { |
| 2093 | $r8 = self::$FAILED; |
| 2094 | $this->currPos = $p7; |
| 2095 | $this->currPos = $p3; |
| 2096 | $r1 = self::$FAILED; |
| 2097 | goto seq_1; |
| 2098 | } |
| 2099 | // free $p7 |
| 2100 | $p7 = $this->currPos; |
| 2101 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "options", $this->currPos, 7, false) === 0) { |
| 2102 | $r9 = true; |
| 2103 | } else { |
| 2104 | $r9 = self::$FAILED; |
| 2105 | } |
| 2106 | if ($r9 === self::$FAILED) { |
| 2107 | $r9 = false; |
| 2108 | } else { |
| 2109 | $r9 = self::$FAILED; |
| 2110 | $this->currPos = $p7; |
| 2111 | $this->currPos = $p3; |
| 2112 | $r1 = self::$FAILED; |
| 2113 | goto seq_1; |
| 2114 | } |
| 2115 | // free $p7 |
| 2116 | $p7 = $this->currPos; |
| 2117 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "config", $this->currPos, 6, false) === 0) { |
| 2118 | $r10 = true; |
| 2119 | } else { |
| 2120 | $r10 = self::$FAILED; |
| 2121 | } |
| 2122 | if ($r10 === self::$FAILED) { |
| 2123 | $r10 = false; |
| 2124 | } else { |
| 2125 | $r10 = self::$FAILED; |
| 2126 | $this->currPos = $p7; |
| 2127 | $this->currPos = $p3; |
| 2128 | $r1 = self::$FAILED; |
| 2129 | goto seq_1; |
| 2130 | } |
| 2131 | // free $p7 |
| 2132 | $p7 = $this->currPos; |
| 2133 | $r11 = strcspn($this->input, "\x09\x0a\x0d ", $this->currPos); |
| 2134 | // name <- $r11 |
| 2135 | if ($r11 > 0) { |
| 2136 | $this->currPos += $r11; |
| 2137 | $r11 = substr($this->input, $p7, $this->currPos - $p7); |
| 2138 | } else { |
| 2139 | $r11 = self::$FAILED; |
| 2140 | if (!$silence) { $this->fail(34); } |
| 2141 | $r11 = self::$FAILED; |
| 2142 | $this->currPos = $p3; |
| 2143 | $r1 = self::$FAILED; |
| 2144 | goto seq_1; |
| 2145 | } |
| 2146 | // free $p7 |
| 2147 | $r12 = $this->discardrest_of_line(); |
| 2148 | if ($r12===self::$FAILED) { |
| 2149 | $this->currPos = $p3; |
| 2150 | $r1 = self::$FAILED; |
| 2151 | goto seq_1; |
| 2152 | } |
| 2153 | $r13 = $this->parsetext($silence); |
| 2154 | // text <- $r13 |
| 2155 | $r1 = true; |
| 2156 | seq_1: |
| 2157 | if ($r1!==self::$FAILED) { |
| 2158 | $this->savedPos = $p2; |
| 2159 | $r1 = $this->a16($r11, $r13); |
| 2160 | } |
| 2161 | // free $r4,$r5,$r6,$r8,$r9,$r10,$r12 |
| 2162 | // free $p3 |
| 2163 | // free $p2 |
| 2164 | return $r1; |
| 2165 | } |
| 2166 | private function parseconfig_section($silence) { |
| 2167 | $p2 = $this->currPos; |
| 2168 | // start seq_1 |
| 2169 | $p3 = $this->currPos; |
| 2170 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 2171 | $r4 = true; |
| 2172 | $this->currPos += 2; |
| 2173 | } else { |
| 2174 | if (!$silence) { $this->fail(7); } |
| 2175 | $r4 = self::$FAILED; |
| 2176 | $r1 = self::$FAILED; |
| 2177 | goto seq_1; |
| 2178 | } |
| 2179 | $r5 = strspn($this->input, "\x09 ", $this->currPos); |
| 2180 | if ($r5 > 0) { |
| 2181 | $this->currPos += $r5; |
| 2182 | } else { |
| 2183 | $r5 = self::$FAILED; |
| 2184 | if (!$silence) { $this->fail(5); } |
| 2185 | $r5 = null; |
| 2186 | } |
| 2187 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "config", $this->currPos, 6, false) === 0) { |
| 2188 | $r6 = true; |
| 2189 | $this->currPos += 6; |
| 2190 | } else { |
| 2191 | if (!$silence) { $this->fail(35); } |
| 2192 | $r6 = self::$FAILED; |
| 2193 | $this->currPos = $p3; |
| 2194 | $r1 = self::$FAILED; |
| 2195 | goto seq_1; |
| 2196 | } |
| 2197 | $r7 = strspn($this->input, "\x09 ", $this->currPos); |
| 2198 | if ($r7 > 0) { |
| 2199 | $this->currPos += $r7; |
| 2200 | } else { |
| 2201 | $r7 = self::$FAILED; |
| 2202 | if (!$silence) { $this->fail(5); } |
| 2203 | $r7 = null; |
| 2204 | } |
| 2205 | // start seq_2 |
| 2206 | $p9 = $this->currPos; |
| 2207 | $r10 = $this->input[$this->currPos] ?? ''; |
| 2208 | if ($r10 === "\x0a") { |
| 2209 | $r10 = false; |
| 2210 | $this->currPos = $p9; |
| 2211 | } else { |
| 2212 | $r10 = self::$FAILED; |
| 2213 | if (!$silence) { $this->fail(6); } |
| 2214 | $r8 = self::$FAILED; |
| 2215 | goto seq_2; |
| 2216 | } |
| 2217 | $r8 = $this->discardeol(); |
| 2218 | if ($r8===self::$FAILED) { |
| 2219 | $this->currPos = $p9; |
| 2220 | $r8 = self::$FAILED; |
| 2221 | goto seq_2; |
| 2222 | } |
| 2223 | seq_2: |
| 2224 | if ($r8===self::$FAILED) { |
| 2225 | $this->currPos = $p3; |
| 2226 | $r1 = self::$FAILED; |
| 2227 | goto seq_1; |
| 2228 | } |
| 2229 | // free $p9 |
| 2230 | // start seq_3 |
| 2231 | $p9 = $this->currPos; |
| 2232 | if (strcspn($this->input, "\x09\x0a !=", $this->currPos, 1) !== 0) { |
| 2233 | $r12 = true; |
| 2234 | $r12 = false; |
| 2235 | $this->currPos = $p9; |
| 2236 | } else { |
| 2237 | $r12 = self::$FAILED; |
| 2238 | if (!$silence) { $this->fail(36); } |
| 2239 | $r11 = self::$FAILED; |
| 2240 | goto seq_3; |
| 2241 | } |
| 2242 | $r11 = $this->parseconfig_list($silence); |
| 2243 | if ($r11===self::$FAILED) { |
| 2244 | $this->currPos = $p9; |
| 2245 | $r11 = self::$FAILED; |
| 2246 | goto seq_3; |
| 2247 | } |
| 2248 | seq_3: |
| 2249 | if ($r11===self::$FAILED) { |
| 2250 | $r11 = null; |
| 2251 | } |
| 2252 | // free $p9 |
| 2253 | // items <- $r11 |
| 2254 | $r1 = true; |
| 2255 | seq_1: |
| 2256 | if ($r1!==self::$FAILED) { |
| 2257 | $this->savedPos = $p2; |
| 2258 | $r1 = $this->a17($r11); |
| 2259 | } |
| 2260 | // free $r4,$r5,$r6,$r7,$r8,$r10,$r12 |
| 2261 | // free $p3 |
| 2262 | // free $p2 |
| 2263 | return $r1; |
| 2264 | } |
| 2265 | private function discardstart_hooks() { |
| 2266 | // start seq_1 |
| 2267 | $p2 = $this->currPos; |
| 2268 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 2269 | $r3 = true; |
| 2270 | $this->currPos += 2; |
| 2271 | } else { |
| 2272 | $r3 = self::$FAILED; |
| 2273 | $r1 = self::$FAILED; |
| 2274 | goto seq_1; |
| 2275 | } |
| 2276 | $r4 = strspn($this->input, "\x09 ", $this->currPos); |
| 2277 | if ($r4 > 0) { |
| 2278 | $this->currPos += $r4; |
| 2279 | } else { |
| 2280 | $r4 = self::$FAILED; |
| 2281 | $r4 = null; |
| 2282 | } |
| 2283 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "hooks", $this->currPos, 5, false) === 0) { |
| 2284 | $r1 = true; |
| 2285 | $this->currPos += 5; |
| 2286 | } else { |
| 2287 | $r1 = self::$FAILED; |
| 2288 | $this->currPos = $p2; |
| 2289 | $r1 = self::$FAILED; |
| 2290 | goto seq_1; |
| 2291 | } |
| 2292 | if (($this->input[$this->currPos] ?? null) === ":") { |
| 2293 | $r5 = true; |
| 2294 | $this->currPos++; |
| 2295 | } else { |
| 2296 | $r5 = self::$FAILED; |
| 2297 | $r5 = null; |
| 2298 | } |
| 2299 | $r6 = strspn($this->input, "\x09 ", $this->currPos); |
| 2300 | if ($r6 > 0) { |
| 2301 | $this->currPos += $r6; |
| 2302 | } else { |
| 2303 | $r6 = self::$FAILED; |
| 2304 | $r6 = null; |
| 2305 | } |
| 2306 | // start seq_2 |
| 2307 | $p8 = $this->currPos; |
| 2308 | $r9 = $this->input[$this->currPos] ?? ''; |
| 2309 | if ($r9 === "\x0a") { |
| 2310 | $r9 = false; |
| 2311 | $this->currPos = $p8; |
| 2312 | } else { |
| 2313 | $r9 = self::$FAILED; |
| 2314 | $r7 = self::$FAILED; |
| 2315 | goto seq_2; |
| 2316 | } |
| 2317 | $r7 = $this->discardeol(); |
| 2318 | if ($r7===self::$FAILED) { |
| 2319 | $this->currPos = $p8; |
| 2320 | $r7 = self::$FAILED; |
| 2321 | goto seq_2; |
| 2322 | } |
| 2323 | seq_2: |
| 2324 | if ($r7===self::$FAILED) { |
| 2325 | $this->currPos = $p2; |
| 2326 | $r1 = self::$FAILED; |
| 2327 | goto seq_1; |
| 2328 | } |
| 2329 | // free $p8 |
| 2330 | seq_1: |
| 2331 | // free $p2 |
| 2332 | return $r1; |
| 2333 | } |
| 2334 | private function discardend_hooks() { |
| 2335 | // start seq_1 |
| 2336 | $p2 = $this->currPos; |
| 2337 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 2338 | $r3 = true; |
| 2339 | $this->currPos += 2; |
| 2340 | } else { |
| 2341 | $r3 = self::$FAILED; |
| 2342 | $r1 = self::$FAILED; |
| 2343 | goto seq_1; |
| 2344 | } |
| 2345 | $r4 = strspn($this->input, "\x09 ", $this->currPos); |
| 2346 | if ($r4 > 0) { |
| 2347 | $this->currPos += $r4; |
| 2348 | } else { |
| 2349 | $r4 = self::$FAILED; |
| 2350 | $r4 = null; |
| 2351 | } |
| 2352 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "endhooks", $this->currPos, 8, false) === 0) { |
| 2353 | $r1 = true; |
| 2354 | $this->currPos += 8; |
| 2355 | } else { |
| 2356 | $r1 = self::$FAILED; |
| 2357 | $this->currPos = $p2; |
| 2358 | $r1 = self::$FAILED; |
| 2359 | goto seq_1; |
| 2360 | } |
| 2361 | $r5 = strspn($this->input, "\x09 ", $this->currPos); |
| 2362 | if ($r5 > 0) { |
| 2363 | $this->currPos += $r5; |
| 2364 | } else { |
| 2365 | $r5 = self::$FAILED; |
| 2366 | $r5 = null; |
| 2367 | } |
| 2368 | // start seq_2 |
| 2369 | $p7 = $this->currPos; |
| 2370 | $r8 = $this->input[$this->currPos] ?? ''; |
| 2371 | if ($r8 === "\x0a") { |
| 2372 | $r8 = false; |
| 2373 | $this->currPos = $p7; |
| 2374 | } else { |
| 2375 | $r8 = self::$FAILED; |
| 2376 | $r6 = self::$FAILED; |
| 2377 | goto seq_2; |
| 2378 | } |
| 2379 | $r6 = $this->discardeol(); |
| 2380 | if ($r6===self::$FAILED) { |
| 2381 | $this->currPos = $p7; |
| 2382 | $r6 = self::$FAILED; |
| 2383 | goto seq_2; |
| 2384 | } |
| 2385 | seq_2: |
| 2386 | if ($r6===self::$FAILED) { |
| 2387 | $this->currPos = $p2; |
| 2388 | $r1 = self::$FAILED; |
| 2389 | goto seq_1; |
| 2390 | } |
| 2391 | // free $p7 |
| 2392 | seq_1: |
| 2393 | // free $p2 |
| 2394 | return $r1; |
| 2395 | } |
| 2396 | private function discardstart_functionhooks() { |
| 2397 | // start seq_1 |
| 2398 | $p2 = $this->currPos; |
| 2399 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 2400 | $r3 = true; |
| 2401 | $this->currPos += 2; |
| 2402 | } else { |
| 2403 | $r3 = self::$FAILED; |
| 2404 | $r1 = self::$FAILED; |
| 2405 | goto seq_1; |
| 2406 | } |
| 2407 | $r4 = strspn($this->input, "\x09 ", $this->currPos); |
| 2408 | if ($r4 > 0) { |
| 2409 | $this->currPos += $r4; |
| 2410 | } else { |
| 2411 | $r4 = self::$FAILED; |
| 2412 | $r4 = null; |
| 2413 | } |
| 2414 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "functionhooks", $this->currPos, 13, false) === 0) { |
| 2415 | $r1 = true; |
| 2416 | $this->currPos += 13; |
| 2417 | } else { |
| 2418 | $r1 = self::$FAILED; |
| 2419 | $this->currPos = $p2; |
| 2420 | $r1 = self::$FAILED; |
| 2421 | goto seq_1; |
| 2422 | } |
| 2423 | if (($this->input[$this->currPos] ?? null) === ":") { |
| 2424 | $r5 = true; |
| 2425 | $this->currPos++; |
| 2426 | } else { |
| 2427 | $r5 = self::$FAILED; |
| 2428 | $r5 = null; |
| 2429 | } |
| 2430 | $r6 = strspn($this->input, "\x09 ", $this->currPos); |
| 2431 | if ($r6 > 0) { |
| 2432 | $this->currPos += $r6; |
| 2433 | } else { |
| 2434 | $r6 = self::$FAILED; |
| 2435 | $r6 = null; |
| 2436 | } |
| 2437 | // start seq_2 |
| 2438 | $p8 = $this->currPos; |
| 2439 | $r9 = $this->input[$this->currPos] ?? ''; |
| 2440 | if ($r9 === "\x0a") { |
| 2441 | $r9 = false; |
| 2442 | $this->currPos = $p8; |
| 2443 | } else { |
| 2444 | $r9 = self::$FAILED; |
| 2445 | $r7 = self::$FAILED; |
| 2446 | goto seq_2; |
| 2447 | } |
| 2448 | $r7 = $this->discardeol(); |
| 2449 | if ($r7===self::$FAILED) { |
| 2450 | $this->currPos = $p8; |
| 2451 | $r7 = self::$FAILED; |
| 2452 | goto seq_2; |
| 2453 | } |
| 2454 | seq_2: |
| 2455 | if ($r7===self::$FAILED) { |
| 2456 | $this->currPos = $p2; |
| 2457 | $r1 = self::$FAILED; |
| 2458 | goto seq_1; |
| 2459 | } |
| 2460 | // free $p8 |
| 2461 | seq_1: |
| 2462 | // free $p2 |
| 2463 | return $r1; |
| 2464 | } |
| 2465 | private function discardend_functionhooks() { |
| 2466 | // start seq_1 |
| 2467 | $p2 = $this->currPos; |
| 2468 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "!!", $this->currPos, 2, false) === 0) { |
| 2469 | $r3 = true; |
| 2470 | $this->currPos += 2; |
| 2471 | } else { |
| 2472 | $r3 = self::$FAILED; |
| 2473 | $r1 = self::$FAILED; |
| 2474 | goto seq_1; |
| 2475 | } |
| 2476 | $r4 = strspn($this->input, "\x09 ", $this->currPos); |
| 2477 | if ($r4 > 0) { |
| 2478 | $this->currPos += $r4; |
| 2479 | } else { |
| 2480 | $r4 = self::$FAILED; |
| 2481 | $r4 = null; |
| 2482 | } |
| 2483 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "endfunctionhooks", $this->currPos, 16, false) === 0) { |
| 2484 | $r1 = true; |
| 2485 | $this->currPos += 16; |
| 2486 | } else { |
| 2487 | $r1 = self::$FAILED; |
| 2488 | $this->currPos = $p2; |
| 2489 | $r1 = self::$FAILED; |
| 2490 | goto seq_1; |
| 2491 | } |
| 2492 | if (($this->input[$this->currPos] ?? null) === ":") { |
| 2493 | $r5 = true; |
| 2494 | $this->currPos++; |
| 2495 | } else { |
| 2496 | $r5 = self::$FAILED; |
| 2497 | $r5 = null; |
| 2498 | } |
| 2499 | $r6 = strspn($this->input, "\x09 ", $this->currPos); |
| 2500 | if ($r6 > 0) { |
| 2501 | $this->currPos += $r6; |
| 2502 | } else { |
| 2503 | $r6 = self::$FAILED; |
| 2504 | $r6 = null; |
| 2505 | } |
| 2506 | // start seq_2 |
| 2507 | $p8 = $this->currPos; |
| 2508 | $r9 = $this->input[$this->currPos] ?? ''; |
| 2509 | if ($r9 === "\x0a") { |
| 2510 | $r9 = false; |
| 2511 | $this->currPos = $p8; |
| 2512 | } else { |
| 2513 | $r9 = self::$FAILED; |
| 2514 | $r7 = self::$FAILED; |
| 2515 | goto seq_2; |
| 2516 | } |
| 2517 | $r7 = $this->discardeol(); |
| 2518 | if ($r7===self::$FAILED) { |
| 2519 | $this->currPos = $p8; |
| 2520 | $r7 = self::$FAILED; |
| 2521 | goto seq_2; |
| 2522 | } |
| 2523 | seq_2: |
| 2524 | if ($r7===self::$FAILED) { |
| 2525 | $this->currPos = $p2; |
| 2526 | $r1 = self::$FAILED; |
| 2527 | goto seq_1; |
| 2528 | } |
| 2529 | // free $p8 |
| 2530 | seq_1: |
| 2531 | // free $p2 |
| 2532 | return $r1; |
| 2533 | } |
| 2534 | private function parseoption_value($silence) { |
| 2535 | $p2 = $this->currPos; |
| 2536 | // start seq_1 |
| 2537 | $p3 = $this->currPos; |
| 2538 | $r4 = strspn($this->input, "\x09 ", $this->currPos); |
| 2539 | if ($r4 > 0) { |
| 2540 | $this->currPos += $r4; |
| 2541 | } else { |
| 2542 | $r4 = self::$FAILED; |
| 2543 | if (!$silence) { $this->fail(5); } |
| 2544 | $r4 = null; |
| 2545 | } |
| 2546 | if (($this->input[$this->currPos] ?? null) === "=") { |
| 2547 | $r5 = true; |
| 2548 | $this->currPos++; |
| 2549 | } else { |
| 2550 | if (!$silence) { $this->fail(37); } |
| 2551 | $r5 = self::$FAILED; |
| 2552 | $this->currPos = $p3; |
| 2553 | $r1 = self::$FAILED; |
| 2554 | goto seq_1; |
| 2555 | } |
| 2556 | $r6 = strspn($this->input, "\x09 ", $this->currPos); |
| 2557 | if ($r6 > 0) { |
| 2558 | $this->currPos += $r6; |
| 2559 | } else { |
| 2560 | $r6 = self::$FAILED; |
| 2561 | if (!$silence) { $this->fail(5); } |
| 2562 | $r6 = null; |
| 2563 | } |
| 2564 | // start seq_2 |
| 2565 | $p8 = $this->currPos; |
| 2566 | if (strcspn($this->input, "\x09\x0a !',=]", $this->currPos, 1) !== 0) { |
| 2567 | $r9 = true; |
| 2568 | $r9 = false; |
| 2569 | $this->currPos = $p8; |
| 2570 | } else { |
| 2571 | $r9 = self::$FAILED; |
| 2572 | if (!$silence) { $this->fail(38); } |
| 2573 | $r7 = self::$FAILED; |
| 2574 | goto seq_2; |
| 2575 | } |
| 2576 | $r7 = $this->parseoption_value_list($silence); |
| 2577 | if ($r7===self::$FAILED) { |
| 2578 | $this->currPos = $p8; |
| 2579 | $r7 = self::$FAILED; |
| 2580 | goto seq_2; |
| 2581 | } |
| 2582 | seq_2: |
| 2583 | // ovl <- $r7 |
| 2584 | if ($r7===self::$FAILED) { |
| 2585 | $this->currPos = $p3; |
| 2586 | $r1 = self::$FAILED; |
| 2587 | goto seq_1; |
| 2588 | } |
| 2589 | // free $p8 |
| 2590 | $r1 = true; |
| 2591 | seq_1: |
| 2592 | if ($r1!==self::$FAILED) { |
| 2593 | $this->savedPos = $p2; |
| 2594 | $r1 = $this->a18($r7); |
| 2595 | } |
| 2596 | // free $r4,$r5,$r6,$r9 |
| 2597 | // free $p3 |
| 2598 | // free $p2 |
| 2599 | return $r1; |
| 2600 | } |
| 2601 | private function parseconfig_list($silence) { |
| 2602 | $p2 = $this->currPos; |
| 2603 | // start seq_1 |
| 2604 | $p3 = $this->currPos; |
| 2605 | // start seq_2 |
| 2606 | if (strcspn($this->input, "\x09\x0a !=", $this->currPos, 1) !== 0) { |
| 2607 | $r5 = true; |
| 2608 | $r5 = false; |
| 2609 | $this->currPos = $p3; |
| 2610 | } else { |
| 2611 | $r5 = self::$FAILED; |
| 2612 | if (!$silence) { $this->fail(39); } |
| 2613 | $r4 = self::$FAILED; |
| 2614 | goto seq_2; |
| 2615 | } |
| 2616 | $r4 = $this->parsea_config_line($silence); |
| 2617 | if ($r4===self::$FAILED) { |
| 2618 | $this->currPos = $p3; |
| 2619 | $r4 = self::$FAILED; |
| 2620 | goto seq_2; |
| 2621 | } |
| 2622 | seq_2: |
| 2623 | // c <- $r4 |
| 2624 | if ($r4===self::$FAILED) { |
| 2625 | $r1 = self::$FAILED; |
| 2626 | goto seq_1; |
| 2627 | } |
| 2628 | $r6 = self::$FAILED; |
| 2629 | for (;;) { |
| 2630 | // start seq_3 |
| 2631 | $p8 = $this->currPos; |
| 2632 | $r9 = $this->input[$this->currPos] ?? ''; |
| 2633 | if ($r9 === "\x0a") { |
| 2634 | $r9 = false; |
| 2635 | $this->currPos = $p8; |
| 2636 | } else { |
| 2637 | $r9 = self::$FAILED; |
| 2638 | if (!$silence) { $this->fail(6); } |
| 2639 | $r7 = self::$FAILED; |
| 2640 | goto seq_3; |
| 2641 | } |
| 2642 | $r7 = $this->discardeol(); |
| 2643 | if ($r7===self::$FAILED) { |
| 2644 | $this->currPos = $p8; |
| 2645 | $r7 = self::$FAILED; |
| 2646 | goto seq_3; |
| 2647 | } |
| 2648 | seq_3: |
| 2649 | if ($r7!==self::$FAILED) { |
| 2650 | $r6 = true; |
| 2651 | } else { |
| 2652 | break; |
| 2653 | } |
| 2654 | // free $p8 |
| 2655 | } |
| 2656 | if ($r6===self::$FAILED) { |
| 2657 | $this->currPos = $p3; |
| 2658 | $r1 = self::$FAILED; |
| 2659 | goto seq_1; |
| 2660 | } |
| 2661 | // free $r7 |
| 2662 | // start seq_4 |
| 2663 | $p8 = $this->currPos; |
| 2664 | if (strcspn($this->input, "\x09\x0a !=", $this->currPos, 1) !== 0) { |
| 2665 | $r10 = true; |
| 2666 | $r10 = false; |
| 2667 | $this->currPos = $p8; |
| 2668 | } else { |
| 2669 | $r10 = self::$FAILED; |
| 2670 | if (!$silence) { $this->fail(36); } |
| 2671 | $r7 = self::$FAILED; |
| 2672 | goto seq_4; |
| 2673 | } |
| 2674 | $r7 = $this->parseconfig_list($silence); |
| 2675 | if ($r7===self::$FAILED) { |
| 2676 | $this->currPos = $p8; |
| 2677 | $r7 = self::$FAILED; |
| 2678 | goto seq_4; |
| 2679 | } |
| 2680 | seq_4: |
| 2681 | if ($r7===self::$FAILED) { |
| 2682 | $r7 = null; |
| 2683 | } |
| 2684 | // free $p8 |
| 2685 | // rest <- $r7 |
| 2686 | $r1 = true; |
| 2687 | seq_1: |
| 2688 | if ($r1!==self::$FAILED) { |
| 2689 | $this->savedPos = $p2; |
| 2690 | $r1 = $this->a19($r4, $r7); |
| 2691 | } |
| 2692 | // free $r5,$r6,$r10 |
| 2693 | // free $p3 |
| 2694 | // free $p2 |
| 2695 | return $r1; |
| 2696 | } |
| 2697 | private function parseoption_value_list($silence) { |
| 2698 | $p2 = $this->currPos; |
| 2699 | // start seq_1 |
| 2700 | $p3 = $this->currPos; |
| 2701 | // start seq_2 |
| 2702 | if (strcspn($this->input, "\x09\x0a !',=]", $this->currPos, 1) !== 0) { |
| 2703 | $r5 = true; |
| 2704 | $r5 = false; |
| 2705 | $this->currPos = $p3; |
| 2706 | } else { |
| 2707 | $r5 = self::$FAILED; |
| 2708 | if (!$silence) { $this->fail(40); } |
| 2709 | $r4 = self::$FAILED; |
| 2710 | goto seq_2; |
| 2711 | } |
| 2712 | $r4 = $this->parsean_option_value($silence); |
| 2713 | if ($r4===self::$FAILED) { |
| 2714 | $this->currPos = $p3; |
| 2715 | $r4 = self::$FAILED; |
| 2716 | goto seq_2; |
| 2717 | } |
| 2718 | seq_2: |
| 2719 | // v <- $r4 |
| 2720 | if ($r4===self::$FAILED) { |
| 2721 | $r1 = self::$FAILED; |
| 2722 | goto seq_1; |
| 2723 | } |
| 2724 | // start seq_3 |
| 2725 | $p7 = $this->currPos; |
| 2726 | $r8 = strspn($this->input, "\x09 ", $this->currPos); |
| 2727 | if ($r8 > 0) { |
| 2728 | $this->currPos += $r8; |
| 2729 | } else { |
| 2730 | $r8 = self::$FAILED; |
| 2731 | if (!$silence) { $this->fail(5); } |
| 2732 | $r8 = null; |
| 2733 | } |
| 2734 | if (($this->input[$this->currPos] ?? null) === ",") { |
| 2735 | $r9 = true; |
| 2736 | $this->currPos++; |
| 2737 | } else { |
| 2738 | if (!$silence) { $this->fail(41); } |
| 2739 | $r9 = self::$FAILED; |
| 2740 | $this->currPos = $p7; |
| 2741 | $r6 = self::$FAILED; |
| 2742 | goto seq_3; |
| 2743 | } |
| 2744 | $r10 = strspn($this->input, "\x09 ", $this->currPos); |
| 2745 | if ($r10 > 0) { |
| 2746 | $this->currPos += $r10; |
| 2747 | } else { |
| 2748 | $r10 = self::$FAILED; |
| 2749 | if (!$silence) { $this->fail(5); } |
| 2750 | $r10 = null; |
| 2751 | } |
| 2752 | // start seq_4 |
| 2753 | $p11 = $this->currPos; |
| 2754 | if (strcspn($this->input, "\x09\x0a !',=]", $this->currPos, 1) !== 0) { |
| 2755 | $r12 = true; |
| 2756 | $r12 = false; |
| 2757 | $this->currPos = $p11; |
| 2758 | } else { |
| 2759 | $r12 = self::$FAILED; |
| 2760 | if (!$silence) { $this->fail(38); } |
| 2761 | $r6 = self::$FAILED; |
| 2762 | goto seq_4; |
| 2763 | } |
| 2764 | $r6 = $this->parseoption_value_list($silence); |
| 2765 | if ($r6===self::$FAILED) { |
| 2766 | $this->currPos = $p11; |
| 2767 | $r6 = self::$FAILED; |
| 2768 | goto seq_4; |
| 2769 | } |
| 2770 | seq_4: |
| 2771 | if ($r6===self::$FAILED) { |
| 2772 | $this->currPos = $p7; |
| 2773 | $r6 = self::$FAILED; |
| 2774 | goto seq_3; |
| 2775 | } |
| 2776 | // free $p11 |
| 2777 | seq_3: |
| 2778 | if ($r6===self::$FAILED) { |
| 2779 | $r6 = null; |
| 2780 | } |
| 2781 | // free $r12 |
| 2782 | // free $p7 |
| 2783 | // rest <- $r6 |
| 2784 | $r1 = true; |
| 2785 | seq_1: |
| 2786 | if ($r1!==self::$FAILED) { |
| 2787 | $this->savedPos = $p2; |
| 2788 | $r1 = $this->a20($r4, $r6); |
| 2789 | } |
| 2790 | // free $r5,$r8,$r9,$r10 |
| 2791 | // free $p3 |
| 2792 | // free $p2 |
| 2793 | return $r1; |
| 2794 | } |
| 2795 | private function parsea_config_line($silence) { |
| 2796 | $p2 = $this->currPos; |
| 2797 | // start seq_1 |
| 2798 | $p3 = $this->currPos; |
| 2799 | $p5 = $this->currPos; |
| 2800 | $r4 = strcspn($this->input, "\x09\x0a !=", $this->currPos); |
| 2801 | // k <- $r4 |
| 2802 | if ($r4 > 0) { |
| 2803 | $this->currPos += $r4; |
| 2804 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
| 2805 | } else { |
| 2806 | $r4 = self::$FAILED; |
| 2807 | if (!$silence) { $this->fail(32); } |
| 2808 | $r4 = self::$FAILED; |
| 2809 | $r1 = self::$FAILED; |
| 2810 | goto seq_1; |
| 2811 | } |
| 2812 | // free $p5 |
| 2813 | // start seq_2 |
| 2814 | $p5 = $this->currPos; |
| 2815 | if (strspn($this->input, "\x09 =", $this->currPos, 1) !== 0) { |
| 2816 | $r7 = true; |
| 2817 | $r7 = false; |
| 2818 | $this->currPos = $p5; |
| 2819 | } else { |
| 2820 | $r7 = self::$FAILED; |
| 2821 | if (!$silence) { $this->fail(42); } |
| 2822 | $r6 = self::$FAILED; |
| 2823 | goto seq_2; |
| 2824 | } |
| 2825 | $r6 = $this->parseconfig_value($silence); |
| 2826 | if ($r6===self::$FAILED) { |
| 2827 | $this->currPos = $p5; |
| 2828 | $r6 = self::$FAILED; |
| 2829 | goto seq_2; |
| 2830 | } |
| 2831 | seq_2: |
| 2832 | // v <- $r6 |
| 2833 | if ($r6===self::$FAILED) { |
| 2834 | $this->currPos = $p3; |
| 2835 | $r1 = self::$FAILED; |
| 2836 | goto seq_1; |
| 2837 | } |
| 2838 | // free $p5 |
| 2839 | $r1 = true; |
| 2840 | seq_1: |
| 2841 | if ($r1!==self::$FAILED) { |
| 2842 | $this->savedPos = $p2; |
| 2843 | $r1 = $this->a21($r4, $r6); |
| 2844 | } |
| 2845 | // free $r7 |
| 2846 | // free $p3 |
| 2847 | // free $p2 |
| 2848 | return $r1; |
| 2849 | } |
| 2850 | private function parsean_option_value($silence) { |
| 2851 | $p2 = $this->currPos; |
| 2852 | // start choice_1 |
| 2853 | // start seq_1 |
| 2854 | $p4 = $this->currPos; |
| 2855 | $r5 = $this->input[$this->currPos] ?? ''; |
| 2856 | if ($r5 === "[") { |
| 2857 | $r5 = false; |
| 2858 | $this->currPos = $p4; |
| 2859 | } else { |
| 2860 | $r5 = self::$FAILED; |
| 2861 | if (!$silence) { $this->fail(43); } |
| 2862 | $r3 = self::$FAILED; |
| 2863 | goto seq_1; |
| 2864 | } |
| 2865 | $r3 = $this->parselink_target_value($silence); |
| 2866 | if ($r3===self::$FAILED) { |
| 2867 | $this->currPos = $p4; |
| 2868 | $r3 = self::$FAILED; |
| 2869 | goto seq_1; |
| 2870 | } |
| 2871 | seq_1: |
| 2872 | if ($r3!==self::$FAILED) { |
| 2873 | goto choice_1; |
| 2874 | } |
| 2875 | // free $p4 |
| 2876 | // start seq_2 |
| 2877 | $p4 = $this->currPos; |
| 2878 | $r6 = $this->input[$this->currPos] ?? ''; |
| 2879 | if ($r6 === "\"") { |
| 2880 | $r6 = false; |
| 2881 | $this->currPos = $p4; |
| 2882 | } else { |
| 2883 | $r6 = self::$FAILED; |
| 2884 | if (!$silence) { $this->fail(44); } |
| 2885 | $r3 = self::$FAILED; |
| 2886 | goto seq_2; |
| 2887 | } |
| 2888 | $r3 = $this->parsequoted_value($silence); |
| 2889 | if ($r3===self::$FAILED) { |
| 2890 | $this->currPos = $p4; |
| 2891 | $r3 = self::$FAILED; |
| 2892 | goto seq_2; |
| 2893 | } |
| 2894 | seq_2: |
| 2895 | if ($r3!==self::$FAILED) { |
| 2896 | goto choice_1; |
| 2897 | } |
| 2898 | // free $p4 |
| 2899 | $p4 = $this->currPos; |
| 2900 | $r3 = strcspn($this->input, "\x09\x0a !\"',=[]{", $this->currPos); |
| 2901 | if ($r3 > 0) { |
| 2902 | $this->currPos += $r3; |
| 2903 | $r3 = substr($this->input, $p4, $this->currPos - $p4); |
| 2904 | goto choice_1; |
| 2905 | } else { |
| 2906 | $r3 = self::$FAILED; |
| 2907 | if (!$silence) { $this->fail(45); } |
| 2908 | $r3 = self::$FAILED; |
| 2909 | } |
| 2910 | // free $p4 |
| 2911 | // start seq_3 |
| 2912 | $p4 = $this->currPos; |
| 2913 | $r7 = $this->input[$this->currPos] ?? ''; |
| 2914 | if ($r7 === "{") { |
| 2915 | $r7 = false; |
| 2916 | $this->currPos = $p4; |
| 2917 | } else { |
| 2918 | $r7 = self::$FAILED; |
| 2919 | if (!$silence) { $this->fail(46); } |
| 2920 | $r3 = self::$FAILED; |
| 2921 | goto seq_3; |
| 2922 | } |
| 2923 | $r3 = $this->parsejson_value($silence); |
| 2924 | if ($r3===self::$FAILED) { |
| 2925 | $this->currPos = $p4; |
| 2926 | $r3 = self::$FAILED; |
| 2927 | goto seq_3; |
| 2928 | } |
| 2929 | seq_3: |
| 2930 | // free $p4 |
| 2931 | choice_1: |
| 2932 | // v <- $r3 |
| 2933 | $r1 = $r3; |
| 2934 | if ($r1!==self::$FAILED) { |
| 2935 | $this->savedPos = $p2; |
| 2936 | $r1 = $this->a22($r3); |
| 2937 | } |
| 2938 | // free $r5,$r6,$r7 |
| 2939 | // free $p2 |
| 2940 | return $r1; |
| 2941 | } |
| 2942 | private function parseconfig_value($silence) { |
| 2943 | // start seq_1 |
| 2944 | $p2 = $this->currPos; |
| 2945 | $r3 = strspn($this->input, "\x09 ", $this->currPos); |
| 2946 | if ($r3 > 0) { |
| 2947 | $this->currPos += $r3; |
| 2948 | } else { |
| 2949 | $r3 = self::$FAILED; |
| 2950 | if (!$silence) { $this->fail(5); } |
| 2951 | $r3 = null; |
| 2952 | } |
| 2953 | if (($this->input[$this->currPos] ?? null) === "=") { |
| 2954 | $r4 = true; |
| 2955 | $this->currPos++; |
| 2956 | } else { |
| 2957 | if (!$silence) { $this->fail(37); } |
| 2958 | $r4 = self::$FAILED; |
| 2959 | $this->currPos = $p2; |
| 2960 | $r1 = self::$FAILED; |
| 2961 | goto seq_1; |
| 2962 | } |
| 2963 | $r5 = strspn($this->input, "\x09 ", $this->currPos); |
| 2964 | if ($r5 > 0) { |
| 2965 | $this->currPos += $r5; |
| 2966 | } else { |
| 2967 | $r5 = self::$FAILED; |
| 2968 | if (!$silence) { $this->fail(5); } |
| 2969 | $r5 = null; |
| 2970 | } |
| 2971 | // start seq_2 |
| 2972 | $p6 = $this->currPos; |
| 2973 | if (strcspn($this->input, "\x09\x0a !',=]", $this->currPos, 1) !== 0) { |
| 2974 | $r7 = true; |
| 2975 | $r7 = false; |
| 2976 | $this->currPos = $p6; |
| 2977 | } else { |
| 2978 | $r7 = self::$FAILED; |
| 2979 | if (!$silence) { $this->fail(47); } |
| 2980 | $r1 = self::$FAILED; |
| 2981 | goto seq_2; |
| 2982 | } |
| 2983 | $r1 = $this->parsevalid_json_value($silence); |
| 2984 | if ($r1===self::$FAILED) { |
| 2985 | $this->currPos = $p6; |
| 2986 | $r1 = self::$FAILED; |
| 2987 | goto seq_2; |
| 2988 | } |
| 2989 | seq_2: |
| 2990 | if ($r1===self::$FAILED) { |
| 2991 | $this->currPos = $p2; |
| 2992 | $r1 = self::$FAILED; |
| 2993 | goto seq_1; |
| 2994 | } |
| 2995 | // free $p6 |
| 2996 | seq_1: |
| 2997 | // free $r7 |
| 2998 | // free $p2 |
| 2999 | return $r1; |
| 3000 | } |
| 3001 | private function parselink_target_value($silence) { |
| 3002 | $p2 = $this->currPos; |
| 3003 | // start seq_1 |
| 3004 | $p3 = $this->currPos; |
| 3005 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "[[", $this->currPos, 2, false) === 0) { |
| 3006 | $r4 = true; |
| 3007 | $this->currPos += 2; |
| 3008 | } else { |
| 3009 | if (!$silence) { $this->fail(48); } |
| 3010 | $r4 = self::$FAILED; |
| 3011 | $r1 = self::$FAILED; |
| 3012 | goto seq_1; |
| 3013 | } |
| 3014 | $p6 = $this->currPos; |
| 3015 | $r5 = strcspn($this->input, "\x0a]", $this->currPos); |
| 3016 | // v <- $r5 |
| 3017 | $this->currPos += $r5; |
| 3018 | $r5 = substr($this->input, $p6, $this->currPos - $p6); |
| 3019 | // free $p6 |
| 3020 | if ($this->currPos >= $this->inputLength ? false : substr_compare($this->input, "]]", $this->currPos, 2, false) === 0) { |
| 3021 | $r7 = true; |
| 3022 | $this->currPos += 2; |
| 3023 | } else { |
| 3024 | if (!$silence) { $this->fail(50); } |
| 3025 | $r7 = self::$FAILED; |
| 3026 | $this->currPos = $p3; |
| 3027 | $r1 = self::$FAILED; |
| 3028 | goto seq_1; |
| 3029 | } |
| 3030 | $r1 = true; |
| 3031 | seq_1: |
| 3032 | if ($r1!==self::$FAILED) { |
| 3033 | $this->savedPos = $p2; |
| 3034 | $r1 = $this->a23($r5); |
| 3035 | } |
| 3036 | // free $r4,$r7 |
| 3037 | // free $p3 |
| 3038 | // free $p2 |
| 3039 | return $r1; |
| 3040 | } |
| 3041 | private function parsequoted_value($silence) { |
| 3042 | $p2 = $this->currPos; |
| 3043 | // start seq_1 |
| 3044 | $p3 = $this->currPos; |
| 3045 | $r4 = $this->input[$this->currPos] ?? ''; |
| 3046 | if ($r4 === "\"") { |
| 3047 | $this->currPos++; |
| 3048 | } else { |
| 3049 | $r4 = self::$FAILED; |
| 3050 | if (!$silence) { $this->fail(51); } |
| 3051 | $r1 = self::$FAILED; |
| 3052 | goto seq_1; |
| 3053 | } |
| 3054 | $r5 = []; |
| 3055 | for (;;) { |
| 3056 | // start choice_1 |
| 3057 | if (strcspn($this->input, "\x0a\"\\", $this->currPos, 1) !== 0) { |
| 3058 | $r6 = self::consumeChar($this->input, $this->currPos); |
| 3059 | goto choice_1; |
| 3060 | } else { |
| 3061 | $r6 = self::$FAILED; |
| 3062 | if (!$silence) { $this->fail(52); } |
| 3063 | } |
| 3064 | $p7 = $this->currPos; |
| 3065 | // start seq_2 |
| 3066 | $p8 = $this->currPos; |
| 3067 | if (($this->input[$this->currPos] ?? null) === "\\") { |
| 3068 | $r9 = true; |
| 3069 | $this->currPos++; |
| 3070 | } else { |
| 3071 | if (!$silence) { $this->fail(53); } |
| 3072 | $r9 = self::$FAILED; |
| 3073 | $r6 = self::$FAILED; |
| 3074 | goto seq_2; |
| 3075 | } |
| 3076 | $r10 = self::charAt($this->input, $this->currPos); |
| 3077 | // c <- $r10 |
| 3078 | if ($r10 !== '' && !($r10 === "\x0a")) { |
| 3079 | $this->currPos += strlen($r10); |
| 3080 | } else { |
| 3081 | $r10 = self::$FAILED; |
| 3082 | if (!$silence) { $this->fail(20); } |
| 3083 | $this->currPos = $p8; |
| 3084 | $r6 = self::$FAILED; |
| 3085 | goto seq_2; |
| 3086 | } |
| 3087 | $r6 = true; |
| 3088 | seq_2: |
| 3089 | if ($r6!==self::$FAILED) { |
| 3090 | $this->savedPos = $p7; |
| 3091 | $r6 = $this->a24($r10); |
| 3092 | } |
| 3093 | // free $r9 |
| 3094 | // free $p8 |
| 3095 | // free $p7 |
| 3096 | choice_1: |
| 3097 | if ($r6!==self::$FAILED) { |
| 3098 | $r5[] = $r6; |
| 3099 | } else { |
| 3100 | break; |
| 3101 | } |
| 3102 | } |
| 3103 | // v <- $r5 |
| 3104 | // free $r6 |
| 3105 | $r6 = $this->input[$this->currPos] ?? ''; |
| 3106 | if ($r6 === "\"") { |
| 3107 | $this->currPos++; |
| 3108 | } else { |
| 3109 | $r6 = self::$FAILED; |
| 3110 | if (!$silence) { $this->fail(51); } |
| 3111 | $this->currPos = $p3; |
| 3112 | $r1 = self::$FAILED; |
| 3113 | goto seq_1; |
| 3114 | } |
| 3115 | $r1 = true; |
| 3116 | seq_1: |
| 3117 | if ($r1!==self::$FAILED) { |
| 3118 | $this->savedPos = $p2; |
| 3119 | $r1 = $this->a25($r5); |
| 3120 | } |
| 3121 | // free $r4,$r6 |
| 3122 | // free $p3 |
| 3123 | // free $p2 |
| 3124 | return $r1; |
| 3125 | } |
| 3126 | private function parsejson_value($silence) { |
| 3127 | $p2 = $this->currPos; |
| 3128 | // start seq_1 |
| 3129 | $p3 = $this->currPos; |
| 3130 | if (($this->input[$this->currPos] ?? null) === "{") { |
| 3131 | $r4 = true; |
| 3132 | $this->currPos++; |
| 3133 | } else { |
| 3134 | if (!$silence) { $this->fail(54); } |
| 3135 | $r4 = self::$FAILED; |
| 3136 | $r1 = self::$FAILED; |
| 3137 | goto seq_1; |
| 3138 | } |
| 3139 | $r5 = []; |
| 3140 | for (;;) { |
| 3141 | // start choice_1 |
| 3142 | if (strcspn($this->input, "\x0a\"{}", $this->currPos, 1) !== 0) { |
| 3143 | $r6 = self::consumeChar($this->input, $this->currPos); |
| 3144 | goto choice_1; |
| 3145 | } else { |
| 3146 | $r6 = self::$FAILED; |
| 3147 | if (!$silence) { $this->fail(55); } |
| 3148 | } |
| 3149 | // start seq_2 |
| 3150 | $p7 = $this->currPos; |
| 3151 | $r8 = $this->input[$this->currPos] ?? ''; |
| 3152 | if ($r8 === "\"") { |
| 3153 | $r8 = false; |
| 3154 | $this->currPos = $p7; |
| 3155 | } else { |
| 3156 | $r8 = self::$FAILED; |
| 3157 | if (!$silence) { $this->fail(44); } |
| 3158 | $r6 = self::$FAILED; |
| 3159 | goto seq_2; |
| 3160 | } |
| 3161 | $r6 = $this->parsequoted_value($silence); |
| 3162 | if ($r6===self::$FAILED) { |
| 3163 | $this->currPos = $p7; |
| 3164 | $r6 = self::$FAILED; |
| 3165 | goto seq_2; |
| 3166 | } |
| 3167 | seq_2: |
| 3168 | if ($r6!==self::$FAILED) { |
| 3169 | goto choice_1; |
| 3170 | } |
| 3171 | // free $p7 |
| 3172 | // start seq_3 |
| 3173 | $p7 = $this->currPos; |
| 3174 | $r9 = $this->input[$this->currPos] ?? ''; |
| 3175 | if ($r9 === "{") { |
| 3176 | $r9 = false; |
| 3177 | $this->currPos = $p7; |
| 3178 | } else { |
| 3179 | $r9 = self::$FAILED; |
| 3180 | if (!$silence) { $this->fail(46); } |
| 3181 | $r6 = self::$FAILED; |
| 3182 | goto seq_3; |
| 3183 | } |
| 3184 | $r6 = $this->parsejson_value($silence); |
| 3185 | if ($r6===self::$FAILED) { |
| 3186 | $this->currPos = $p7; |
| 3187 | $r6 = self::$FAILED; |
| 3188 | goto seq_3; |
| 3189 | } |
| 3190 | seq_3: |
| 3191 | if ($r6!==self::$FAILED) { |
| 3192 | goto choice_1; |
| 3193 | } |
| 3194 | // free $p7 |
| 3195 | // start seq_4 |
| 3196 | $p7 = $this->currPos; |
| 3197 | $r10 = $this->input[$this->currPos] ?? ''; |
| 3198 | if ($r10 === "\x0a") { |
| 3199 | $r10 = false; |
| 3200 | $this->currPos = $p7; |
| 3201 | } else { |
| 3202 | $r10 = self::$FAILED; |
| 3203 | if (!$silence) { $this->fail(6); } |
| 3204 | $r6 = self::$FAILED; |
| 3205 | goto seq_4; |
| 3206 | } |
| 3207 | $r6 = $this->parseeol($silence); |
| 3208 | if ($r6===self::$FAILED) { |
| 3209 | $this->currPos = $p7; |
| 3210 | $r6 = self::$FAILED; |
| 3211 | goto seq_4; |
| 3212 | } |
| 3213 | seq_4: |
| 3214 | // free $p7 |
| 3215 | choice_1: |
| 3216 | if ($r6!==self::$FAILED) { |
| 3217 | $r5[] = $r6; |
| 3218 | } else { |
| 3219 | break; |
| 3220 | } |
| 3221 | } |
| 3222 | // v <- $r5 |
| 3223 | // free $r6 |
| 3224 | // free $r8,$r9,$r10 |
| 3225 | if (($this->input[$this->currPos] ?? null) === "}") { |
| 3226 | $r10 = true; |
| 3227 | $this->currPos++; |
| 3228 | } else { |
| 3229 | if (!$silence) { $this->fail(56); } |
| 3230 | $r10 = self::$FAILED; |
| 3231 | $this->currPos = $p3; |
| 3232 | $r1 = self::$FAILED; |
| 3233 | goto seq_1; |
| 3234 | } |
| 3235 | $r1 = true; |
| 3236 | seq_1: |
| 3237 | if ($r1!==self::$FAILED) { |
| 3238 | $this->savedPos = $p2; |
| 3239 | $r1 = $this->a26($r5); |
| 3240 | } |
| 3241 | // free $r4,$r10 |
| 3242 | // free $p3 |
| 3243 | // free $p2 |
| 3244 | return $r1; |
| 3245 | } |
| 3246 | private function parsevalid_json_value($silence) { |
| 3247 | $p2 = $this->currPos; |
| 3248 | // start seq_1 |
| 3249 | $p3 = $this->currPos; |
| 3250 | $p5 = $this->currPos; |
| 3251 | // start choice_1 |
| 3252 | // start seq_2 |
| 3253 | $r6 = $this->input[$this->currPos] ?? ''; |
| 3254 | if ($r6 === "\"") { |
| 3255 | $r6 = false; |
| 3256 | $this->currPos = $p3; |
| 3257 | } else { |
| 3258 | $r6 = self::$FAILED; |
| 3259 | if (!$silence) { $this->fail(44); } |
| 3260 | $r4 = self::$FAILED; |
| 3261 | goto seq_2; |
| 3262 | } |
| 3263 | $r4 = $this->discardquoted_value(); |
| 3264 | if ($r4===self::$FAILED) { |
| 3265 | $this->currPos = $p3; |
| 3266 | $r4 = self::$FAILED; |
| 3267 | goto seq_2; |
| 3268 | } |
| 3269 | seq_2: |
| 3270 | if ($r4!==self::$FAILED) { |
| 3271 | goto choice_1; |
| 3272 | } |
| 3273 | $r4 = strcspn($this->input, "\x09\x0a !\"',=[]{", $this->currPos); |
| 3274 | if ($r4 > 0) { |
| 3275 | $this->currPos += $r4; |
| 3276 | goto choice_1; |
| 3277 | } else { |
| 3278 | $r4 = self::$FAILED; |
| 3279 | if (!$silence) { $this->fail(45); } |
| 3280 | } |
| 3281 | // start seq_3 |
| 3282 | $r7 = $this->input[$this->currPos] ?? ''; |
| 3283 | if ($r7 === "[") { |
| 3284 | $r7 = false; |
| 3285 | $this->currPos = $p3; |
| 3286 | } else { |
| 3287 | $r7 = self::$FAILED; |
| 3288 | if (!$silence) { $this->fail(57); } |
| 3289 | $r4 = self::$FAILED; |
| 3290 | goto seq_3; |
| 3291 | } |
| 3292 | $r4 = $this->discardarray_value(); |
| 3293 | if ($r4===self::$FAILED) { |
| 3294 | $this->currPos = $p3; |
| 3295 | $r4 = self::$FAILED; |
| 3296 | goto seq_3; |
| 3297 | } |
| 3298 | seq_3: |
| 3299 | if ($r4!==self::$FAILED) { |
| 3300 | goto choice_1; |
| 3301 | } |
| 3302 | // start seq_4 |
| 3303 | $r8 = $this->input[$this->currPos] ?? ''; |
| 3304 | if ($r8 === "{") { |
| 3305 | $r8 = false; |
| 3306 | $this->currPos = $p3; |
| 3307 | } else { |
| 3308 | $r8 = self::$FAILED; |
| 3309 | if (!$silence) { $this->fail(46); } |
| 3310 | $r4 = self::$FAILED; |
| 3311 | goto seq_4; |
| 3312 | } |
| 3313 | $r4 = $this->discardjson_value(); |
| 3314 | if ($r4===self::$FAILED) { |
| 3315 | $this->currPos = $p3; |
| 3316 | $r4 = self::$FAILED; |
| 3317 | goto seq_4; |
| 3318 | } |
| 3319 | seq_4: |
| 3320 | choice_1: |
| 3321 | // v <- $r4 |
| 3322 | if ($r4!==self::$FAILED) { |
| 3323 | $r4 = substr($this->input, $p5, $this->currPos - $p5); |
| 3324 | } else { |
| 3325 | $r4 = self::$FAILED; |
| 3326 | $r1 = self::$FAILED; |
| 3327 | goto seq_1; |
| 3328 | } |
| 3329 | // free $p5 |
| 3330 | $this->savedPos = $this->currPos; |
| 3331 | $r9 = $this->a27($r4); |
| 3332 | if ($r9) { |
| 3333 | $r9 = false; |
| 3334 | } else { |
| 3335 | $r9 = self::$FAILED; |
| 3336 | $this->currPos = $p3; |
| 3337 | $r1 = self::$FAILED; |
| 3338 | goto seq_1; |
| 3339 | } |
| 3340 | $r1 = true; |
| 3341 | seq_1: |
| 3342 | if ($r1!==self::$FAILED) { |
| 3343 | $this->savedPos = $p2; |
| 3344 | $r1 = $this->a28($r4); |
| 3345 | } |
| 3346 | // free $r6,$r7,$r8,$r9 |
| 3347 | // free $p3 |
| 3348 | // free $p2 |
| 3349 | return $r1; |
| 3350 | } |
| 3351 | private function discardquoted_value() { |
| 3352 | $p2 = $this->currPos; |
| 3353 | // start seq_1 |
| 3354 | $p3 = $this->currPos; |
| 3355 | $r4 = $this->input[$this->currPos] ?? ''; |
| 3356 | if ($r4 === "\"") { |
| 3357 | $this->currPos++; |
| 3358 | } else { |
| 3359 | $r4 = self::$FAILED; |
| 3360 | $r1 = self::$FAILED; |
| 3361 | goto seq_1; |
| 3362 | } |
| 3363 | $r5 = []; |
| 3364 | for (;;) { |
| 3365 | // start choice_1 |
| 3366 | if (strcspn($this->input, "\x0a\"\\", $this->currPos, 1) !== 0) { |
| 3367 | $r6 = self::consumeChar($this->input, $this->currPos); |
| 3368 | goto choice_1; |
| 3369 | } else { |
| 3370 | $r6 = self::$FAILED; |
| 3371 | } |
| 3372 | $p7 = $this->currPos; |
| 3373 | // start seq_2 |
| 3374 | $p8 = $this->currPos; |
| 3375 | if (($this->input[$this->currPos] ?? null) === "\\") { |
| 3376 | $r9 = true; |
| 3377 | $this->currPos++; |
| 3378 | } else { |
| 3379 | $r9 = self::$FAILED; |
| 3380 | $r6 = self::$FAILED; |
| 3381 | goto seq_2; |
| 3382 | } |
| 3383 | $r10 = self::charAt($this->input, $this->currPos); |
| 3384 | // c <- $r10 |
| 3385 | if ($r10 !== '' && !($r10 === "\x0a")) { |
| 3386 | $this->currPos += strlen($r10); |
| 3387 | } else { |
| 3388 | $r10 = self::$FAILED; |
| 3389 | $this->currPos = $p8; |
| 3390 | $r6 = self::$FAILED; |
| 3391 | goto seq_2; |
| 3392 | } |
| 3393 | $r6 = true; |
| 3394 | seq_2: |
| 3395 | if ($r6!==self::$FAILED) { |
| 3396 | $this->savedPos = $p7; |
| 3397 | $r6 = $this->a24($r10); |
| 3398 | } |
| 3399 | // free $r9 |
| 3400 | // free $p8 |
| 3401 | // free $p7 |
| 3402 | choice_1: |
| 3403 | if ($r6!==self::$FAILED) { |
| 3404 | $r5[] = $r6; |
| 3405 | } else { |
| 3406 | break; |
| 3407 | } |
| 3408 | } |
| 3409 | // v <- $r5 |
| 3410 | // free $r6 |
| 3411 | $r6 = $this->input[$this->currPos] ?? ''; |
| 3412 | if ($r6 === "\"") { |
| 3413 | $this->currPos++; |
| 3414 | } else { |
| 3415 | $r6 = self::$FAILED; |
| 3416 | $this->currPos = $p3; |
| 3417 | $r1 = self::$FAILED; |
| 3418 | goto seq_1; |
| 3419 | } |
| 3420 | $r1 = true; |
| 3421 | seq_1: |
| 3422 | if ($r1!==self::$FAILED) { |
| 3423 | $this->savedPos = $p2; |
| 3424 | $r1 = $this->a25($r5); |
| 3425 | } |
| 3426 | // free $r4,$r6 |
| 3427 | // free $p3 |
| 3428 | // free $p2 |
| 3429 | return $r1; |
| 3430 | } |
| 3431 | private function discardarray_value() { |
| 3432 | $p2 = $this->currPos; |
| 3433 | // start seq_1 |
| 3434 | $p3 = $this->currPos; |
| 3435 | if (($this->input[$this->currPos] ?? null) === "[") { |
| 3436 | $r4 = true; |
| 3437 | $this->currPos++; |
| 3438 | } else { |
| 3439 | $r4 = self::$FAILED; |
| 3440 | $r1 = self::$FAILED; |
| 3441 | goto seq_1; |
| 3442 | } |
| 3443 | $r5 = []; |
| 3444 | for (;;) { |
| 3445 | // start choice_1 |
| 3446 | if (strcspn($this->input, "\x0a\"[]", $this->currPos, 1) !== 0) { |
| 3447 | $r6 = self::consumeChar($this->input, $this->currPos); |
| 3448 | goto choice_1; |
| 3449 | } else { |
| 3450 | $r6 = self::$FAILED; |
| 3451 | } |
| 3452 | // start seq_2 |
| 3453 | $p7 = $this->currPos; |
| 3454 | $r8 = $this->input[$this->currPos] ?? ''; |
| 3455 | if ($r8 === "\"") { |
| 3456 | $r8 = false; |
| 3457 | $this->currPos = $p7; |
| 3458 | } else { |
| 3459 | $r8 = self::$FAILED; |
| 3460 | $r6 = self::$FAILED; |
| 3461 | goto seq_2; |
| 3462 | } |
| 3463 | $r6 = $this->parsequoted_value(true); |
| 3464 | if ($r6===self::$FAILED) { |
| 3465 | $this->currPos = $p7; |
| 3466 | $r6 = self::$FAILED; |
| 3467 | goto seq_2; |
| 3468 | } |
| 3469 | seq_2: |
| 3470 | if ($r6!==self::$FAILED) { |
| 3471 | goto choice_1; |
| 3472 | } |
| 3473 | // free $p7 |
| 3474 | // start seq_3 |
| 3475 | $p7 = $this->currPos; |
| 3476 | $r9 = $this->input[$this->currPos] ?? ''; |
| 3477 | if ($r9 === "[") { |
| 3478 | $r9 = false; |
| 3479 | $this->currPos = $p7; |
| 3480 | } else { |
| 3481 | $r9 = self::$FAILED; |
| 3482 | $r6 = self::$FAILED; |
| 3483 | goto seq_3; |
| 3484 | } |
| 3485 | $r6 = $this->parsearray_value(true); |
| 3486 | if ($r6===self::$FAILED) { |
| 3487 | $this->currPos = $p7; |
| 3488 | $r6 = self::$FAILED; |
| 3489 | goto seq_3; |
| 3490 | } |
| 3491 | seq_3: |
| 3492 | if ($r6!==self::$FAILED) { |
| 3493 | goto choice_1; |
| 3494 | } |
| 3495 | // free $p7 |
| 3496 | // start seq_4 |
| 3497 | $p7 = $this->currPos; |
| 3498 | $r10 = $this->input[$this->currPos] ?? ''; |
| 3499 | if ($r10 === "\x0a") { |
| 3500 | $r10 = false; |
| 3501 | $this->currPos = $p7; |
| 3502 | } else { |
| 3503 | $r10 = self::$FAILED; |
| 3504 | $r6 = self::$FAILED; |
| 3505 | goto seq_4; |
| 3506 | } |
| 3507 | $r6 = $this->parseeol(true); |
| 3508 | if ($r6===self::$FAILED) { |
| 3509 | $this->currPos = $p7; |
| 3510 | $r6 = self::$FAILED; |
| 3511 | goto seq_4; |
| 3512 | } |
| 3513 | seq_4: |
| 3514 | // free $p7 |
| 3515 | choice_1: |
| 3516 | if ($r6!==self::$FAILED) { |
| 3517 | $r5[] = $r6; |
| 3518 | } else { |
| 3519 | break; |
| 3520 | } |
| 3521 | } |
| 3522 | // v <- $r5 |
| 3523 | // free $r6 |
| 3524 | // free $r8,$r9,$r10 |
| 3525 | if (($this->input[$this->currPos] ?? null) === "]") { |
| 3526 | $r10 = true; |
| 3527 | $this->currPos++; |
| 3528 | } else { |
| 3529 | $r10 = self::$FAILED; |
| 3530 | $this->currPos = $p3; |
| 3531 | $r1 = self::$FAILED; |
| 3532 | goto seq_1; |
| 3533 | } |
| 3534 | $r1 = true; |
| 3535 | seq_1: |
| 3536 | if ($r1!==self::$FAILED) { |
| 3537 | $this->savedPos = $p2; |
| 3538 | $r1 = $this->a29($r5); |
| 3539 | } |
| 3540 | // free $r4,$r10 |
| 3541 | // free $p3 |
| 3542 | // free $p2 |
| 3543 | return $r1; |
| 3544 | } |
| 3545 | private function discardjson_value() { |
| 3546 | $p2 = $this->currPos; |
| 3547 | // start seq_1 |
| 3548 | $p3 = $this->currPos; |
| 3549 | if (($this->input[$this->currPos] ?? null) === "{") { |
| 3550 | $r4 = true; |
| 3551 | $this->currPos++; |
| 3552 | } else { |
| 3553 | $r4 = self::$FAILED; |
| 3554 | $r1 = self::$FAILED; |
| 3555 | goto seq_1; |
| 3556 | } |
| 3557 | $r5 = []; |
| 3558 | for (;;) { |
| 3559 | // start choice_1 |
| 3560 | if (strcspn($this->input, "\x0a\"{}", $this->currPos, 1) !== 0) { |
| 3561 | $r6 = self::consumeChar($this->input, $this->currPos); |
| 3562 | goto choice_1; |
| 3563 | } else { |
| 3564 | $r6 = self::$FAILED; |
| 3565 | } |
| 3566 | // start seq_2 |
| 3567 | $p7 = $this->currPos; |
| 3568 | $r8 = $this->input[$this->currPos] ?? ''; |
| 3569 | if ($r8 === "\"") { |
| 3570 | $r8 = false; |
| 3571 | $this->currPos = $p7; |
| 3572 | } else { |
| 3573 | $r8 = self::$FAILED; |
| 3574 | $r6 = self::$FAILED; |
| 3575 | goto seq_2; |
| 3576 | } |
| 3577 | $r6 = $this->parsequoted_value(true); |
| 3578 | if ($r6===self::$FAILED) { |
| 3579 | $this->currPos = $p7; |
| 3580 | $r6 = self::$FAILED; |
| 3581 | goto seq_2; |
| 3582 | } |
| 3583 | seq_2: |
| 3584 | if ($r6!==self::$FAILED) { |
| 3585 | goto choice_1; |
| 3586 | } |
| 3587 | // free $p7 |
| 3588 | // start seq_3 |
| 3589 | $p7 = $this->currPos; |
| 3590 | $r9 = $this->input[$this->currPos] ?? ''; |
| 3591 | if ($r9 === "{") { |
| 3592 | $r9 = false; |
| 3593 | $this->currPos = $p7; |
| 3594 | } else { |
| 3595 | $r9 = self::$FAILED; |
| 3596 | $r6 = self::$FAILED; |
| 3597 | goto seq_3; |
| 3598 | } |
| 3599 | $r6 = $this->parsejson_value(true); |
| 3600 | if ($r6===self::$FAILED) { |
| 3601 | $this->currPos = $p7; |
| 3602 | $r6 = self::$FAILED; |
| 3603 | goto seq_3; |
| 3604 | } |
| 3605 | seq_3: |
| 3606 | if ($r6!==self::$FAILED) { |
| 3607 | goto choice_1; |
| 3608 | } |
| 3609 | // free $p7 |
| 3610 | // start seq_4 |
| 3611 | $p7 = $this->currPos; |
| 3612 | $r10 = $this->input[$this->currPos] ?? ''; |
| 3613 | if ($r10 === "\x0a") { |
| 3614 | $r10 = false; |
| 3615 | $this->currPos = $p7; |
| 3616 | } else { |
| 3617 | $r10 = self::$FAILED; |
| 3618 | $r6 = self::$FAILED; |
| 3619 | goto seq_4; |
| 3620 | } |
| 3621 | $r6 = $this->parseeol(true); |
| 3622 | if ($r6===self::$FAILED) { |
| 3623 | $this->currPos = $p7; |
| 3624 | $r6 = self::$FAILED; |
| 3625 | goto seq_4; |
| 3626 | } |
| 3627 | seq_4: |
| 3628 | // free $p7 |
| 3629 | choice_1: |
| 3630 | if ($r6!==self::$FAILED) { |
| 3631 | $r5[] = $r6; |
| 3632 | } else { |
| 3633 | break; |
| 3634 | } |
| 3635 | } |
| 3636 | // v <- $r5 |
| 3637 | // free $r6 |
| 3638 | // free $r8,$r9,$r10 |
| 3639 | if (($this->input[$this->currPos] ?? null) === "}") { |
| 3640 | $r10 = true; |
| 3641 | $this->currPos++; |
| 3642 | } else { |
| 3643 | $r10 = self::$FAILED; |
| 3644 | $this->currPos = $p3; |
| 3645 | $r1 = self::$FAILED; |
| 3646 | goto seq_1; |
| 3647 | } |
| 3648 | $r1 = true; |
| 3649 | seq_1: |
| 3650 | if ($r1!==self::$FAILED) { |
| 3651 | $this->savedPos = $p2; |
| 3652 | $r1 = $this->a26($r5); |
| 3653 | } |
| 3654 | // free $r4,$r10 |
| 3655 | // free $p3 |
| 3656 | // free $p2 |
| 3657 | return $r1; |
| 3658 | } |
| 3659 | private function parsearray_value($silence) { |
| 3660 | $p2 = $this->currPos; |
| 3661 | // start seq_1 |
| 3662 | $p3 = $this->currPos; |
| 3663 | if (($this->input[$this->currPos] ?? null) === "[") { |
| 3664 | $r4 = true; |
| 3665 | $this->currPos++; |
| 3666 | } else { |
| 3667 | if (!$silence) { $this->fail(58); } |
| 3668 | $r4 = self::$FAILED; |
| 3669 | $r1 = self::$FAILED; |
| 3670 | goto seq_1; |
| 3671 | } |
| 3672 | $r5 = []; |
| 3673 | for (;;) { |
| 3674 | // start choice_1 |
| 3675 | if (strcspn($this->input, "\x0a\"[]", $this->currPos, 1) !== 0) { |
| 3676 | $r6 = self::consumeChar($this->input, $this->currPos); |
| 3677 | goto choice_1; |
| 3678 | } else { |
| 3679 | $r6 = self::$FAILED; |
| 3680 | if (!$silence) { $this->fail(59); } |
| 3681 | } |
| 3682 | // start seq_2 |
| 3683 | $p7 = $this->currPos; |
| 3684 | $r8 = $this->input[$this->currPos] ?? ''; |
| 3685 | if ($r8 === "\"") { |
| 3686 | $r8 = false; |
| 3687 | $this->currPos = $p7; |
| 3688 | } else { |
| 3689 | $r8 = self::$FAILED; |
| 3690 | if (!$silence) { $this->fail(44); } |
| 3691 | $r6 = self::$FAILED; |
| 3692 | goto seq_2; |
| 3693 | } |
| 3694 | $r6 = $this->parsequoted_value($silence); |
| 3695 | if ($r6===self::$FAILED) { |
| 3696 | $this->currPos = $p7; |
| 3697 | $r6 = self::$FAILED; |
| 3698 | goto seq_2; |
| 3699 | } |
| 3700 | seq_2: |
| 3701 | if ($r6!==self::$FAILED) { |
| 3702 | goto choice_1; |
| 3703 | } |
| 3704 | // free $p7 |
| 3705 | // start seq_3 |
| 3706 | $p7 = $this->currPos; |
| 3707 | $r9 = $this->input[$this->currPos] ?? ''; |
| 3708 | if ($r9 === "[") { |
| 3709 | $r9 = false; |
| 3710 | $this->currPos = $p7; |
| 3711 | } else { |
| 3712 | $r9 = self::$FAILED; |
| 3713 | if (!$silence) { $this->fail(57); } |
| 3714 | $r6 = self::$FAILED; |
| 3715 | goto seq_3; |
| 3716 | } |
| 3717 | $r6 = $this->parsearray_value($silence); |
| 3718 | if ($r6===self::$FAILED) { |
| 3719 | $this->currPos = $p7; |
| 3720 | $r6 = self::$FAILED; |
| 3721 | goto seq_3; |
| 3722 | } |
| 3723 | seq_3: |
| 3724 | if ($r6!==self::$FAILED) { |
| 3725 | goto choice_1; |
| 3726 | } |
| 3727 | // free $p7 |
| 3728 | // start seq_4 |
| 3729 | $p7 = $this->currPos; |
| 3730 | $r10 = $this->input[$this->currPos] ?? ''; |
| 3731 | if ($r10 === "\x0a") { |
| 3732 | $r10 = false; |
| 3733 | $this->currPos = $p7; |
| 3734 | } else { |
| 3735 | $r10 = self::$FAILED; |
| 3736 | if (!$silence) { $this->fail(6); } |
| 3737 | $r6 = self::$FAILED; |
| 3738 | goto seq_4; |
| 3739 | } |
| 3740 | $r6 = $this->parseeol($silence); |
| 3741 | if ($r6===self::$FAILED) { |
| 3742 | $this->currPos = $p7; |
| 3743 | $r6 = self::$FAILED; |
| 3744 | goto seq_4; |
| 3745 | } |
| 3746 | seq_4: |
| 3747 | // free $p7 |
| 3748 | choice_1: |
| 3749 | if ($r6!==self::$FAILED) { |
| 3750 | $r5[] = $r6; |
| 3751 | } else { |
| 3752 | break; |
| 3753 | } |
| 3754 | } |
| 3755 | // v <- $r5 |
| 3756 | // free $r6 |
| 3757 | // free $r8,$r9,$r10 |
| 3758 | if (($this->input[$this->currPos] ?? null) === "]") { |
| 3759 | $r10 = true; |
| 3760 | $this->currPos++; |
| 3761 | } else { |
| 3762 | if (!$silence) { $this->fail(60); } |
| 3763 | $r10 = self::$FAILED; |
| 3764 | $this->currPos = $p3; |
| 3765 | $r1 = self::$FAILED; |
| 3766 | goto seq_1; |
| 3767 | } |
| 3768 | $r1 = true; |
| 3769 | seq_1: |
| 3770 | if ($r1!==self::$FAILED) { |
| 3771 | $this->savedPos = $p2; |
| 3772 | $r1 = $this->a29($r5); |
| 3773 | } |
| 3774 | // free $r4,$r10 |
| 3775 | // free $p3 |
| 3776 | // free $p2 |
| 3777 | return $r1; |
| 3778 | } |
| 3779 | |
| 3780 | public function parse( $input, $options = [] ) { |
| 3781 | $this->initInternal( $input, $options ); |
| 3782 | $startRule = $options['startRule'] ?? '(DEFAULT)'; |
| 3783 | $result = null; |
| 3784 | |
| 3785 | if ( !empty( $options['stream'] ) ) { |
| 3786 | switch ( $startRule ) { |
| 3787 | |
| 3788 | default: |
| 3789 | throw new \Wikimedia\WikiPEG\InternalError( "Can't stream rule $startRule." ); |
| 3790 | } |
| 3791 | } else { |
| 3792 | switch ( $startRule ) { |
| 3793 | case '(DEFAULT)': |
| 3794 | case "testfile": |
| 3795 | $result = $this->parsetestfile(false); |
| 3796 | break; |
| 3797 | default: |
| 3798 | throw new \Wikimedia\WikiPEG\InternalError( "Can't start parsing from rule $startRule." ); |
| 3799 | } |
| 3800 | } |
| 3801 | |
| 3802 | if ( $result !== self::$FAILED && $this->currPos === $this->inputLength ) { |
| 3803 | return $result; |
| 3804 | } else { |
| 3805 | if ( $result !== self::$FAILED && $this->currPos < $this->inputLength ) { |
| 3806 | $this->fail( 0 ); |
| 3807 | } |
| 3808 | throw $this->buildParseException(); |
| 3809 | } |
| 3810 | } |
| 3811 | } |
| 3812 |