[ Index ] |
PHP Cross Reference of vtigercrm-6.1.0 |
[Summary view] [Print] [Text view]
1 <?php 2 require_once dirname(__FILE__) . '/Parser.php'; 3 class PHP_LexerGenerator_Regex_Lexer 4 { 5 const MATCHSTART = PHP_LexerGenerator_Regex_Parser::MATCHSTART; 6 const MATCHEND = PHP_LexerGenerator_Regex_Parser::MATCHEND; 7 const CONTROLCHAR = PHP_LexerGenerator_Regex_Parser::CONTROLCHAR; 8 const OPENCHARCLASS = PHP_LexerGenerator_Regex_Parser::OPENCHARCLASS; 9 const FULLSTOP = PHP_LexerGenerator_Regex_Parser::FULLSTOP; 10 const TEXT = PHP_LexerGenerator_Regex_Parser::TEXT; 11 const BACKREFERENCE = PHP_LexerGenerator_Regex_Parser::BACKREFERENCE; 12 const OPENASSERTION = PHP_LexerGenerator_Regex_Parser::OPENASSERTION; 13 const COULDBEBACKREF = PHP_LexerGenerator_Regex_Parser::COULDBEBACKREF; 14 const NEGATE = PHP_LexerGenerator_Regex_Parser::NEGATE; 15 const HYPHEN = PHP_LexerGenerator_Regex_Parser::HYPHEN; 16 const CLOSECHARCLASS = PHP_LexerGenerator_Regex_Parser::CLOSECHARCLASS; 17 const BAR = PHP_LexerGenerator_Regex_Parser::BAR; 18 const MULTIPLIER = PHP_LexerGenerator_Regex_Parser::MULTIPLIER; 19 const INTERNALOPTIONS = PHP_LexerGenerator_Regex_Parser::INTERNALOPTIONS; 20 const COLON = PHP_LexerGenerator_Regex_Parser::COLON; 21 const OPENPAREN = PHP_LexerGenerator_Regex_Parser::OPENPAREN; 22 const CLOSEPAREN = PHP_LexerGenerator_Regex_Parser::CLOSEPAREN; 23 const PATTERNNAME = PHP_LexerGenerator_Regex_Parser::PATTERNNAME; 24 const POSITIVELOOKBEHIND = PHP_LexerGenerator_Regex_Parser::POSITIVELOOKBEHIND; 25 const NEGATIVELOOKBEHIND = PHP_LexerGenerator_Regex_Parser::NEGATIVELOOKBEHIND; 26 const POSITIVELOOKAHEAD = PHP_LexerGenerator_Regex_Parser::POSITIVELOOKAHEAD; 27 const NEGATIVELOOKAHEAD = PHP_LexerGenerator_Regex_Parser::NEGATIVELOOKAHEAD; 28 const ONCEONLY = PHP_LexerGenerator_Regex_Parser::ONCEONLY; 29 const COMMENT = PHP_LexerGenerator_Regex_Parser::COMMENT; 30 const RECUR = PHP_LexerGenerator_Regex_Parser::RECUR; 31 const ESCAPEDBACKSLASH = PHP_LexerGenerator_Regex_Parser::ESCAPEDBACKSLASH; 32 private $input; 33 private $N; 34 public $token; 35 public $value; 36 public $line; 37 38 function __construct($data) 39 { 40 $this->input = $data; 41 $this->N = 0; 42 } 43 44 function reset($data) 45 { 46 $this->input = $data; 47 $this->N = 0; 48 $this->yybegin(self::INITIAL); 49 } 50 51 52 private $_yy_state = 1; 53 private $_yy_stack = array(); 54 55 function yylex() 56 { 57 return $this->{'yylex' . $this->_yy_state}(); 58 } 59 60 function yypushstate($state) 61 { 62 array_push($this->_yy_stack, $this->_yy_state); 63 $this->_yy_state = $state; 64 } 65 66 function yypopstate() 67 { 68 $this->_yy_state = array_pop($this->_yy_stack); 69 } 70 71 function yybegin($state) 72 { 73 $this->_yy_state = $state; 74 } 75 76 77 78 function yylex1() 79 { 80 $tokenMap = array ( 81 1 => 0, 82 2 => 0, 83 3 => 0, 84 4 => 0, 85 5 => 0, 86 6 => 0, 87 7 => 0, 88 8 => 0, 89 9 => 0, 90 10 => 0, 91 11 => 0, 92 12 => 0, 93 13 => 0, 94 14 => 0, 95 15 => 0, 96 16 => 0, 97 17 => 0, 98 18 => 0, 99 19 => 0, 100 20 => 0, 101 21 => 0, 102 22 => 0, 103 23 => 0, 104 ); 105 if ($this->N >= strlen($this->input)) { 106 return false; // end of input 107 } 108 $yy_global_pattern = "/^(\\\\\\\\)|^([^[\\\\^$.|()?*+{}]+)|^(\\\\[][{}*.^$|?()+])|^(\\[)|^(\\|)|^(\\\\[0-9][0-9])|^(\\\\[frnt]|\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7][0-7][0-7]|\\\\x\\{[0-9a-fA-F]+\\})|^(\\\\[abBGcedDsSwW0C])|^(\\^)|^(\\\\A)|^(\\))|^(\\$)|^([*?+]|\\{[0-9]+\\}|\\{[0-9]+,\\}|\\{[0-9]+,[0-9]+\\})|^(\\\\[zZ])|^(\\(\\?)|^(\\()|^(\\.)|^(\\\\[1-9])|^(\\\\p\\{\\^?..?\\}|\\\\P\\{..?\\}|\\\\X)|^(\\\\p\\{C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|^(\\\\p\\{\\^C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|^(\\\\p[CLMNPSZ])|^(\\\\)/"; 109 110 do { 111 if (preg_match($yy_global_pattern, substr($this->input, $this->N), $yymatches)) { 112 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns 113 if (!count($yymatches)) { 114 throw new Exception('Error: lexing failed because a rule matched' . 115 'an empty string. Input "' . substr($this->input, 116 $this->N, 5) . '... state INITIAL'); 117 } 118 next($yymatches); // skip global match 119 $this->token = key($yymatches); // token number 120 // extract sub-patterns for passing to lex function 121 $yysubmatches = array_slice($yymatches, $this->token, 122 $tokenMap[$this->token]); 123 $this->value = current($yymatches); // token value 124 $r = $this->{'yy_r1_' . $this->token}($yysubmatches); 125 if ($r === null) { 126 $this->N += strlen($this->value); 127 $this->line += substr_count("\n", $this->value); 128 // accept this token 129 return true; 130 } elseif ($r === true) { 131 // we have changed state 132 // process this token in the new state 133 return $this->yylex(); 134 } elseif ($r === false) { 135 $this->N += strlen($this->value); 136 $this->line += substr_count("\n", $this->value); 137 if ($this->N >= strlen($this->input)) { 138 return false; // end of input 139 } 140 // skip this token 141 continue; 142 } else { $yy_yymore_patterns = array( 143 1 => "^([^[\\\\^$.|()?*+{}]+)|^(\\\\[][{}*.^$|?()+])|^(\\[)|^(\\|)|^(\\\\[0-9][0-9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\\\p\\{\\^?..?\\}|\\\\P\\{..?\\}|\\\\X)|^(\\\\p\\{C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|^(\\\\p\\{\\^C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|^(\\\\p[CLMNPSZ])|^(\\\\)", 161 19 => "^(\\\\p\\{C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|^(\\\\p\\{\\^C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|^(\\\\p[CLMNPSZ])|^(\\\\)", 162 20 => "^(\\\\p\\{\\^C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|^(\\\\p[CLMNPSZ])|^(\\\\)", 163 21 => "^(\\\\p[CLMNPSZ])|^(\\\\)", 164 22 => "^(\\\\)", 165 23 => "", 166 ); 167 168 // yymore is needed 169 do { 170 if (!strlen($yy_yymore_patterns[$this->token])) { 171 throw new Exception('cannot do yymore for the last token'); 172 } 173 if (preg_match($yy_yymore_patterns[$this->token], 174 substr($this->input, $this->N), $yymatches)) { 175 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns 176 next($yymatches); // skip global match 177 $this->token = key($yymatches); // token number 178 $this->value = current($yymatches); // token value 179 $this->line = substr_count("\n", $this->value); 180 } 181 } while ($this->{'yy_r1_' . $this->token}() !== null); 182 // accept 183 $this->N += strlen($this->value); 184 $this->line += substr_count("\n", $this->value); 185 return true; 186 } 187 } else { 188 throw new Exception('Unexpected input at line' . $this->line . 189 ': ' . $this->input[$this->N]); 190 } 191 break; 192 } while (true); 193 } // end function 194 195 196 const INITIAL = 1; 197 function yy_r1_1($yy_subpatterns) 198 { 199 200 $this->token = self::ESCAPEDBACKSLASH; 201 } 202 function yy_r1_2($yy_subpatterns) 203 { 204 205 $this->token = self::TEXT; 206 } 207 function yy_r1_3($yy_subpatterns) 208 { 209 210 $this->token = self::CONTROLCHAR; 211 } 212 function yy_r1_4($yy_subpatterns) 213 { 214 215 $this->token = self::OPENCHARCLASS; 216 $this->yybegin(self::CHARACTERCLASSSTART); 217 } 218 function yy_r1_5($yy_subpatterns) 219 { 220 221 $this->token = self::BAR; 222 } 223 function yy_r1_6($yy_subpatterns) 224 { 225 226 $this->token = self::COULDBEBACKREF; 227 } 228 function yy_r1_7($yy_subpatterns) 229 { 230 231 $this->token = self::TEXT; 232 } 233 function yy_r1_8($yy_subpatterns) 234 { 235 236 $this->token = self::CONTROLCHAR; 237 } 238 function yy_r1_9($yy_subpatterns) 239 { 240 241 $this->token = self::MATCHSTART; 242 } 243 function yy_r1_10($yy_subpatterns) 244 { 245 246 $this->token = self::MATCHSTART; 247 } 248 function yy_r1_11($yy_subpatterns) 249 { 250 251 $this->token = self::CLOSEPAREN; 252 $this->yybegin(self::INITIAL); 253 } 254 function yy_r1_12($yy_subpatterns) 255 { 256 257 $this->token = self::MATCHEND; 258 } 259 function yy_r1_13($yy_subpatterns) 260 { 261 262 $this->token = self::MULTIPLIER; 263 } 264 function yy_r1_14($yy_subpatterns) 265 { 266 267 $this->token = self::MATCHEND; 268 } 269 function yy_r1_15($yy_subpatterns) 270 { 271 272 $this->token = self::OPENASSERTION; 273 $this->yybegin(self::ASSERTION); 274 } 275 function yy_r1_16($yy_subpatterns) 276 { 277 278 $this->token = self::OPENPAREN; 279 } 280 function yy_r1_17($yy_subpatterns) 281 { 282 283 $this->token = self::FULLSTOP; 284 } 285 function yy_r1_18($yy_subpatterns) 286 { 287 288 $this->token = self::BACKREFERENCE; 289 } 290 function yy_r1_19($yy_subpatterns) 291 { 292 293 $this->token = self::CONTROLCHAR; 294 } 295 function yy_r1_20($yy_subpatterns) 296 { 297 298 $this->token = self::CONTROLCHAR; 299 } 300 function yy_r1_21($yy_subpatterns) 301 { 302 303 $this->token = self::CONTROLCHAR; 304 } 305 function yy_r1_22($yy_subpatterns) 306 { 307 308 $this->token = self::CONTROLCHAR; 309 } 310 function yy_r1_23($yy_subpatterns) 311 { 312 313 return false; 314 } 315 316 317 function yylex2() 318 { 319 $tokenMap = array ( 320 1 => 0, 321 2 => 0, 322 3 => 0, 323 ); 324 if ($this->N >= strlen($this->input)) { 325 return false; // end of input 326 } 327 $yy_global_pattern = "/^(\\^)|^(\\])|^(.)/"; 328 329 do { 330 if (preg_match($yy_global_pattern, substr($this->input, $this->N), $yymatches)) { 331 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns 332 if (!count($yymatches)) { 333 throw new Exception('Error: lexing failed because a rule matched' . 334 'an empty string. Input "' . substr($this->input, 335 $this->N, 5) . '... state CHARACTERCLASSSTART'); 336 } 337 next($yymatches); // skip global match 338 $this->token = key($yymatches); // token number 339 // extract sub-patterns for passing to lex function 340 $yysubmatches = array_slice($yymatches, $this->token, 341 $tokenMap[$this->token]); 342 $this->value = current($yymatches); // token value 343 $r = $this->{'yy_r2_' . $this->token}($yysubmatches); 344 if ($r === null) { 345 $this->N += strlen($this->value); 346 $this->line += substr_count("\n", $this->value); 347 // accept this token 348 return true; 349 } elseif ($r === true) { 350 // we have changed state 351 // process this token in the new state 352 return $this->yylex(); 353 } elseif ($r === false) { 354 $this->N += strlen($this->value); 355 $this->line += substr_count("\n", $this->value); 356 if ($this->N >= strlen($this->input)) { 357 return false; // end of input 358 } 359 // skip this token 360 continue; 361 } else { $yy_yymore_patterns = array( 362 1 => "^(\\])|^(.)", 363 2 => "^(.)", 364 3 => "", 365 ); 366 367 // yymore is needed 368 do { 369 if (!strlen($yy_yymore_patterns[$this->token])) { 370 throw new Exception('cannot do yymore for the last token'); 371 } 372 if (preg_match($yy_yymore_patterns[$this->token], 373 substr($this->input, $this->N), $yymatches)) { 374 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns 375 next($yymatches); // skip global match 376 $this->token = key($yymatches); // token number 377 $this->value = current($yymatches); // token value 378 $this->line = substr_count("\n", $this->value); 379 } 380 } while ($this->{'yy_r2_' . $this->token}() !== null); 381 // accept 382 $this->N += strlen($this->value); 383 $this->line += substr_count("\n", $this->value); 384 return true; 385 } 386 } else { 387 throw new Exception('Unexpected input at line' . $this->line . 388 ': ' . $this->input[$this->N]); 389 } 390 break; 391 } while (true); 392 } // end function 393 394 395 const CHARACTERCLASSSTART = 2; 396 function yy_r2_1($yy_subpatterns) 397 { 398 399 $this->token = self::NEGATE; 400 } 401 function yy_r2_2($yy_subpatterns) 402 { 403 404 $this->yybegin(self::CHARACTERCLASS); 405 $this->token = self::TEXT; 406 } 407 function yy_r2_3($yy_subpatterns) 408 { 409 410 $this->yybegin(self::CHARACTERCLASS); 411 return true; 412 } 413 414 415 function yylex3() 416 { 417 $tokenMap = array ( 418 1 => 0, 419 2 => 0, 420 3 => 0, 421 4 => 0, 422 5 => 0, 423 6 => 0, 424 7 => 0, 425 8 => 0, 426 9 => 0, 427 ); 428 if ($this->N >= strlen($this->input)) { 429 return false; // end of input 430 } 431 $yy_global_pattern = "/^(\\\\\\\\)|^(\\])|^(\\\\[]\\.\\-\\^])|^(\\\\[frnt]|\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7][0-7][0-7]|\\\\x\\{[0-9a-fA-F]+\\})|^(\\\\[bacedDsSwW0C]|\\\\x\\{[0-9a-fA-F]+\\})|^(-(?!]))|^([^\\-\\\\])|^(\\\\)|^(.)/"; 432 433 do { 434 if (preg_match($yy_global_pattern, substr($this->input, $this->N), $yymatches)) { 435 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns 436 if (!count($yymatches)) { 437 throw new Exception('Error: lexing failed because a rule matched' . 438 'an empty string. Input "' . substr($this->input, 439 $this->N, 5) . '... state CHARACTERCLASS'); 440 } 441 next($yymatches); // skip global match 442 $this->token = key($yymatches); // token number 443 // extract sub-patterns for passing to lex function 444 $yysubmatches = array_slice($yymatches, $this->token, 445 $tokenMap[$this->token]); 446 $this->value = current($yymatches); // token value 447 $r = $this->{'yy_r3_' . $this->token}($yysubmatches); 448 if ($r === null) { 449 $this->N += strlen($this->value); 450 $this->line += substr_count("\n", $this->value); 451 // accept this token 452 return true; 453 } elseif ($r === true) { 454 // we have changed state 455 // process this token in the new state 456 return $this->yylex(); 457 } elseif ($r === false) { 458 $this->N += strlen($this->value); 459 $this->line += substr_count("\n", $this->value); 460 if ($this->N >= strlen($this->input)) { 461 return false; // end of input 462 } 463 // skip this token 464 continue; 465 } else { $yy_yymore_patterns = array( 466 1 => "^(\\])|^(\\\\[]\\.\\-\\^])|^(\\\\[frnt]|\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7][0-7][0-7]|\\\\x\\{[0-9a-fA-F]+\\})|^(\\\\[bacedDsSwW0C]|\\\\x\\{[0-9a-fA-F]+\\})|^(-(?!]))|^([^\\-\\\\])|^(\\\\)|^(.)", 467 2 => "^(\\\\[]\\.\\-\\^])|^(\\\\[frnt]|\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7][0-7][0-7]|\\\\x\\{[0-9a-fA-F]+\\})|^(\\\\[bacedDsSwW0C]|\\\\x\\{[0-9a-fA-F]+\\})|^(-(?!]))|^([^\\-\\\\])|^(\\\\)|^(.)", 468 3 => "^(\\\\[frnt]|\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7][0-7][0-7]|\\\\x\\{[0-9a-fA-F]+\\})|^(\\\\[bacedDsSwW0C]|\\\\x\\{[0-9a-fA-F]+\\})|^(-(?!]))|^([^\\-\\\\])|^(\\\\)|^(.)", 469 4 => "^(\\\\[bacedDsSwW0C]|\\\\x\\{[0-9a-fA-F]+\\})|^(-(?!]))|^([^\\-\\\\])|^(\\\\)|^(.)", 470 5 => "^(-(?!]))|^([^\\-\\\\])|^(\\\\)|^(.)", 471 6 => "^([^\\-\\\\])|^(\\\\)|^(.)", 472 7 => "^(\\\\)|^(.)", 473 8 => "^(.)", 474 9 => "", 475 ); 476 477 // yymore is needed 478 do { 479 if (!strlen($yy_yymore_patterns[$this->token])) { 480 throw new Exception('cannot do yymore for the last token'); 481 } 482 if (preg_match($yy_yymore_patterns[$this->token], 483 substr($this->input, $this->N), $yymatches)) { 484 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns 485 next($yymatches); // skip global match 486 $this->token = key($yymatches); // token number 487 $this->value = current($yymatches); // token value 488 $this->line = substr_count("\n", $this->value); 489 } 490 } while ($this->{'yy_r3_' . $this->token}() !== null); 491 // accept 492 $this->N += strlen($this->value); 493 $this->line += substr_count("\n", $this->value); 494 return true; 495 } 496 } else { 497 throw new Exception('Unexpected input at line' . $this->line . 498 ': ' . $this->input[$this->N]); 499 } 500 break; 501 } while (true); 502 } // end function 503 504 505 const CHARACTERCLASS = 3; 506 function yy_r3_1($yy_subpatterns) 507 { 508 509 $this->token = self::ESCAPEDBACKSLASH; 510 } 511 function yy_r3_2($yy_subpatterns) 512 { 513 514 $this->yybegin(self::INITIAL); 515 $this->token = self::CLOSECHARCLASS; 516 } 517 function yy_r3_3($yy_subpatterns) 518 { 519 520 $this->token = self::CONTROLCHAR; 521 } 522 function yy_r3_4($yy_subpatterns) 523 { 524 525 $this->token = self::TEXT; 526 } 527 function yy_r3_5($yy_subpatterns) 528 { 529 530 $this->token = self::CONTROLCHAR; 531 } 532 function yy_r3_6($yy_subpatterns) 533 { 534 535 $this->token = self::HYPHEN; 536 $this->yybegin(self::RANGE); 537 } 538 function yy_r3_7($yy_subpatterns) 539 { 540 541 $this->token = self::TEXT; 542 } 543 function yy_r3_8($yy_subpatterns) 544 { 545 546 return false; // ignore escaping of normal text 547 } 548 function yy_r3_9($yy_subpatterns) 549 { 550 551 $this->token = self::TEXT; 552 } 553 554 555 function yylex4() 556 { 557 $tokenMap = array ( 558 1 => 0, 559 2 => 0, 560 3 => 0, 561 4 => 0, 562 5 => 0, 563 ); 564 if ($this->N >= strlen($this->input)) { 565 return false; // end of input 566 } 567 $yy_global_pattern = "/^(\\\\\\\\)|^(\\\\\\])|^(\\\\[bacedDsSwW0C]|\\\\x\\{[0-9a-fA-F]+\\})|^([^\\-\\\\])|^(\\\\)/"; 568 569 do { 570 if (preg_match($yy_global_pattern, substr($this->input, $this->N), $yymatches)) { 571 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns 572 if (!count($yymatches)) { 573 throw new Exception('Error: lexing failed because a rule matched' . 574 'an empty string. Input "' . substr($this->input, 575 $this->N, 5) . '... state RANGE'); 576 } 577 next($yymatches); // skip global match 578 $this->token = key($yymatches); // token number 579 // extract sub-patterns for passing to lex function 580 $yysubmatches = array_slice($yymatches, $this->token, 581 $tokenMap[$this->token]); 582 $this->value = current($yymatches); // token value 583 $r = $this->{'yy_r4_' . $this->token}($yysubmatches); 584 if ($r === null) { 585 $this->N += strlen($this->value); 586 $this->line += substr_count("\n", $this->value); 587 // accept this token 588 return true; 589 } elseif ($r === true) { 590 // we have changed state 591 // process this token in the new state 592 return $this->yylex(); 593 } elseif ($r === false) { 594 $this->N += strlen($this->value); 595 $this->line += substr_count("\n", $this->value); 596 if ($this->N >= strlen($this->input)) { 597 return false; // end of input 598 } 599 // skip this token 600 continue; 601 } else { $yy_yymore_patterns = array( 602 1 => "^(\\\\\\])|^(\\\\[bacedDsSwW0C]|\\\\x\\{[0-9a-fA-F]+\\})|^([^\\-\\\\])|^(\\\\)", 603 2 => "^(\\\\[bacedDsSwW0C]|\\\\x\\{[0-9a-fA-F]+\\})|^([^\\-\\\\])|^(\\\\)", 604 3 => "^([^\\-\\\\])|^(\\\\)", 605 4 => "^(\\\\)", 606 5 => "", 607 ); 608 609 // yymore is needed 610 do { 611 if (!strlen($yy_yymore_patterns[$this->token])) { 612 throw new Exception('cannot do yymore for the last token'); 613 } 614 if (preg_match($yy_yymore_patterns[$this->token], 615 substr($this->input, $this->N), $yymatches)) { 616 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns 617 next($yymatches); // skip global match 618 $this->token = key($yymatches); // token number 619 $this->value = current($yymatches); // token value 620 $this->line = substr_count("\n", $this->value); 621 } 622 } while ($this->{'yy_r4_' . $this->token}() !== null); 623 // accept 624 $this->N += strlen($this->value); 625 $this->line += substr_count("\n", $this->value); 626 return true; 627 } 628 } else { 629 throw new Exception('Unexpected input at line' . $this->line . 630 ': ' . $this->input[$this->N]); 631 } 632 break; 633 } while (true); 634 } // end function 635 636 637 const RANGE = 4; 638 function yy_r4_1($yy_subpatterns) 639 { 640 641 $this->token = self::ESCAPEDBACKSLASH; 642 } 643 function yy_r4_2($yy_subpatterns) 644 { 645 646 $this->token = self::TEXT; 647 $this->yybegin(self::CHARACTERCLASS); 648 } 649 function yy_r4_3($yy_subpatterns) 650 { 651 652 $this->token = self::CONTROLCHAR; 653 $this->yybegin(self::CHARACTERCLASS); 654 } 655 function yy_r4_4($yy_subpatterns) 656 { 657 658 $this->token = self::TEXT; 659 $this->yybegin(self::CHARACTERCLASS); 660 } 661 function yy_r4_5($yy_subpatterns) 662 { 663 664 return false; // ignore escaping of normal text 665 } 666 667 668 function yylex5() 669 { 670 $tokenMap = array ( 671 1 => 0, 672 2 => 0, 673 3 => 0, 674 4 => 0, 675 5 => 0, 676 6 => 0, 677 7 => 0, 678 8 => 0, 679 9 => 0, 680 10 => 0, 681 11 => 0, 682 12 => 0, 683 13 => 0, 684 ); 685 if ($this->N >= strlen($this->input)) { 686 return false; // end of input 687 } 688 $yy_global_pattern = "/^([imsxUX]+-[imsxUX]+|[imsxUX]+|-[imsxUX]+)|^(\\:)|^(\\))|^(P\\<[^>]+\\>)|^(\\<\\=)|^(\\<\\!)|^(\\=)|^(\\!)|^(\\>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)/"; 689 690 do { 691 if (preg_match($yy_global_pattern, substr($this->input, $this->N), $yymatches)) { 692 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns 693 if (!count($yymatches)) { 694 throw new Exception('Error: lexing failed because a rule matched' . 695 'an empty string. Input "' . substr($this->input, 696 $this->N, 5) . '... state ASSERTION'); 697 } 698 next($yymatches); // skip global match 699 $this->token = key($yymatches); // token number 700 // extract sub-patterns for passing to lex function 701 $yysubmatches = array_slice($yymatches, $this->token, 702 $tokenMap[$this->token]); 703 $this->value = current($yymatches); // token value 704 $r = $this->{'yy_r5_' . $this->token}($yysubmatches); 705 if ($r === null) { 706 $this->N += strlen($this->value); 707 $this->line += substr_count("\n", $this->value); 708 // accept this token 709 return true; 710 } elseif ($r === true) { 711 // we have changed state 712 // process this token in the new state 713 return $this->yylex(); 714 } elseif ($r === false) { 715 $this->N += strlen($this->value); 716 $this->line += substr_count("\n", $this->value); 717 if ($this->N >= strlen($this->input)) { 718 return false; // end of input 719 } 720 // skip this token 721 continue; 722 } else { $yy_yymore_patterns = array( 723 1 => "^(\\:)|^(\\))|^(P\\<[^>]+\\>)|^(\\<\\=)|^(\\<\\!)|^(\\=)|^(\\!)|^(\\>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)", 724 2 => "^(\\))|^(P\\<[^>]+\\>)|^(\\<\\=)|^(\\<\\!)|^(\\=)|^(\\!)|^(\\>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)", 725 3 => "^(P\\<[^>]+\\>)|^(\\<\\=)|^(\\<\\!)|^(\\=)|^(\\!)|^(\\>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)", 726 4 => "^(\\<\\=)|^(\\<\\!)|^(\\=)|^(\\!)|^(\\>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)", 727 5 => "^(\\<\\!)|^(\\=)|^(\\!)|^(\\>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)", 728 6 => "^(\\=)|^(\\!)|^(\\>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)", 729 7 => "^(\\!)|^(\\>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)", 730 8 => "^(\\>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)", 731 9 => "^(\\(\\?)|^(#[^)]+)|^(R)|^(.)", 732 10 => "^(#[^)]+)|^(R)|^(.)", 733 11 => "^(R)|^(.)", 734 12 => "^(.)", 735 13 => "", 736 ); 737 738 // yymore is needed 739 do { 740 if (!strlen($yy_yymore_patterns[$this->token])) { 741 throw new Exception('cannot do yymore for the last token'); 742 } 743 if (preg_match($yy_yymore_patterns[$this->token], 744 substr($this->input, $this->N), $yymatches)) { 745 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns 746 next($yymatches); // skip global match 747 $this->token = key($yymatches); // token number 748 $this->value = current($yymatches); // token value 749 $this->line = substr_count("\n", $this->value); 750 } 751 } while ($this->{'yy_r5_' . $this->token}() !== null); 752 // accept 753 $this->N += strlen($this->value); 754 $this->line += substr_count("\n", $this->value); 755 return true; 756 } 757 } else { 758 throw new Exception('Unexpected input at line' . $this->line . 759 ': ' . $this->input[$this->N]); 760 } 761 break; 762 } while (true); 763 } // end function 764 765 766 const ASSERTION = 5; 767 function yy_r5_1($yy_subpatterns) 768 { 769 770 $this->token = self::INTERNALOPTIONS; 771 } 772 function yy_r5_2($yy_subpatterns) 773 { 774 775 $this->token = self::COLON; 776 $this->yybegin(self::INITIAL); 777 } 778 function yy_r5_3($yy_subpatterns) 779 { 780 781 $this->token = self::CLOSEPAREN; 782 $this->yybegin(self::INITIAL); 783 } 784 function yy_r5_4($yy_subpatterns) 785 { 786 787 $this->token = self::PATTERNNAME; 788 $this->yybegin(self::INITIAL); 789 } 790 function yy_r5_5($yy_subpatterns) 791 { 792 793 $this->token = self::POSITIVELOOKBEHIND; 794 $this->yybegin(self::INITIAL); 795 } 796 function yy_r5_6($yy_subpatterns) 797 { 798 799 $this->token = self::NEGATIVELOOKBEHIND; 800 $this->yybegin(self::INITIAL); 801 } 802 function yy_r5_7($yy_subpatterns) 803 { 804 805 $this->token = self::POSITIVELOOKAHEAD; 806 $this->yybegin(self::INITIAL); 807 } 808 function yy_r5_8($yy_subpatterns) 809 { 810 811 $this->token = self::NEGATIVELOOKAHEAD; 812 $this->yybegin(self::INITIAL); 813 } 814 function yy_r5_9($yy_subpatterns) 815 { 816 817 $this->token = self::ONCEONLY; 818 $this->yybegin(self::INITIAL); 819 } 820 function yy_r5_10($yy_subpatterns) 821 { 822 823 $this->token = self::OPENASSERTION; 824 } 825 function yy_r5_11($yy_subpatterns) 826 { 827 828 $this->token = self::COMMENT; 829 $this->yybegin(self::INITIAL); 830 } 831 function yy_r5_12($yy_subpatterns) 832 { 833 834 $this->token = self::RECUR; 835 } 836 function yy_r5_13($yy_subpatterns) 837 { 838 839 $this->yybegin(self::INITIAL); 840 return true; 841 } 842 843 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:08:37 2014 | Cross-referenced by PHPXref 0.7.1 |