[ Index ] |
PHP Cross Reference of vtigercrm-6.1.0 |
[Summary view] [Print] [Text view]
1 <?php 2 /* Driver template for the PHP_PHP_LexerGenerator_Regex_rGenerator parser generator. (PHP port of LEMON) 3 */ 4 5 /** 6 * This can be used to store both the string representation of 7 * a token, and any useful meta-data associated with the token. 8 * 9 * meta-data should be stored as an array 10 */ 11 class PHP_LexerGenerator_Regex_yyToken implements ArrayAccess 12 { 13 public $string = ''; 14 public $metadata = array(); 15 16 function __construct($s, $m = array()) 17 { 18 if ($s instanceof PHP_LexerGenerator_Regex_yyToken) { 19 $this->string = $s->string; 20 $this->metadata = $s->metadata; 21 } else { 22 $this->string = (string) $s; 23 if ($m instanceof PHP_LexerGenerator_Regex_yyToken) { 24 $this->metadata = $m->metadata; 25 } elseif (is_array($m)) { 26 $this->metadata = $m; 27 } 28 } 29 } 30 31 function __toString() 32 { 33 return $this->_string; 34 } 35 36 function offsetExists($offset) 37 { 38 return isset($this->metadata[$offset]); 39 } 40 41 function offsetGet($offset) 42 { 43 return $this->metadata[$offset]; 44 } 45 46 function offsetSet($offset, $value) 47 { 48 if ($offset === null) { 49 if (isset($value[0])) { 50 $x = ($value instanceof PHP_LexerGenerator_Regex_yyToken) ? 51 $value->metadata : $value; 52 $this->metadata = array_merge($this->metadata, $x); 53 return; 54 } 55 $offset = count($this->metadata); 56 } 57 if ($value === null) { 58 return; 59 } 60 if ($value instanceof PHP_LexerGenerator_Regex_yyToken) { 61 if ($value->metadata) { 62 $this->metadata[$offset] = $value->metadata; 63 } 64 } elseif ($value) { 65 $this->metadata[$offset] = $value; 66 } 67 } 68 69 function offsetUnset($offset) 70 { 71 unset($this->metadata[$offset]); 72 } 73 } 74 75 /** The following structure represents a single element of the 76 * parser's stack. Information stored includes: 77 * 78 * + The state number for the parser at this level of the stack. 79 * 80 * + The value of the token stored at this level of the stack. 81 * (In other words, the "major" token.) 82 * 83 * + The semantic value stored at this level of the stack. This is 84 * the information used by the action routines in the grammar. 85 * It is sometimes called the "minor" token. 86 */ 87 class PHP_LexerGenerator_Regex_yyStackEntry 88 { 89 public $stateno; /* The state-number */ 90 public $major; /* The major token value. This is the code 91 ** number for the token at this stack level */ 92 public $minor; /* The user-supplied minor token value. This 93 ** is the value of the token */ 94 }; 95 96 // code external to the class is included here 97 #line 2 "LexerGenerator\Regex\Parser.y" 98 99 require_once 'PHP/LexerGenerator/Exception.php'; 100 #line 102 "LexerGenerator\Regex\Parser.php" 101 102 // declare_class is output here 103 #line 5 "LexerGenerator\Regex\Parser.y" 104 class PHP_LexerGenerator_Regex_Parser#line 107 "LexerGenerator\Regex\Parser.php" 105 { 106 /* First off, code is included which follows the "include_class" declaration 107 ** in the input file. */ 108 #line 21 "LexerGenerator\Regex\Parser.y" 109 110 private $_lex; 111 private $_subpatterns; 112 public $result; 113 function __construct($lex) 114 { 115 $this->result = new PHP_LexerGenerator_ParseryyToken(''); 116 $this->_lex = $lex; 117 $this->_subpatterns = 0; 118 } 119 120 function reset() 121 { 122 $this->_subpatterns = 0; 123 $this->result = new PHP_LexerGenerator_ParseryyToken(''); 124 } 125 #line 129 "LexerGenerator\Regex\Parser.php" 126 127 /* Next is all token values, as class constants 128 */ 129 /* 130 ** These constants (all generated automatically by the parser generator) 131 ** specify the various kinds of tokens (terminals) that the parser 132 ** understands. 133 ** 134 ** Each symbol here is a terminal symbol in the grammar. 135 */ 136 const OPENPAREN = 1; 137 const OPENASSERTION = 2; 138 const BAR = 3; 139 const MULTIPLIER = 4; 140 const MATCHSTART = 5; 141 const MATCHEND = 6; 142 const BACKREFERENCE = 7; 143 const COULDBEBACKREF = 8; 144 const OPENCHARCLASS = 9; 145 const CLOSECHARCLASS = 10; 146 const NEGATE = 11; 147 const TEXT = 12; 148 const CONTROLCHAR = 13; 149 const ESCAPEDBACKSLASH = 14; 150 const HYPHEN = 15; 151 const FULLSTOP = 16; 152 const INTERNALOPTIONS = 17; 153 const CLOSEPAREN = 18; 154 const COLON = 19; 155 const POSITIVELOOKAHEAD = 20; 156 const NEGATIVELOOKAHEAD = 21; 157 const POSITIVELOOKBEHIND = 22; 158 const NEGATIVELOOKBEHIND = 23; 159 const PATTERNNAME = 24; 160 const ONCEONLY = 25; 161 const COMMENT = 26; 162 const RECUR = 27; 163 const YY_NO_ACTION = 236; 164 const YY_ACCEPT_ACTION = 235; 165 const YY_ERROR_ACTION = 234; 166 167 /* Next are that tables used to determine what action to take based on the 168 ** current state and lookahead token. These tables are used to implement 169 ** functions that take a state number and lookahead value and return an 170 ** action integer. 171 ** 172 ** Suppose the action integer is N. Then the action is determined as 173 ** follows 174 ** 175 ** 0 <= N < self::YYNSTATE Shift N. That is, 176 ** push the lookahead 177 ** token onto the stack 178 ** and goto state N. 179 ** 180 ** self::YYNSTATE <= N < self::YYNSTATE+self::YYNRULE Reduce by rule N-YYNSTATE. 181 ** 182 ** N == self::YYNSTATE+self::YYNRULE A syntax error has occurred. 183 ** 184 ** N == self::YYNSTATE+self::YYNRULE+1 The parser accepts its 185 ** input. (and concludes parsing) 186 ** 187 ** N == self::YYNSTATE+self::YYNRULE+2 No such action. Denotes unused 188 ** slots in the yy_action[] table. 189 ** 190 ** The action table is constructed as a single large static array $yy_action. 191 ** Given state S and lookahead X, the action is computed as 192 ** 193 ** self::$yy_action[self::$yy_shift_ofst[S] + X ] 194 ** 195 ** If the index value self::$yy_shift_ofst[S]+X is out of range or if the value 196 ** self::$yy_lookahead[self::$yy_shift_ofst[S]+X] is not equal to X or if 197 ** self::$yy_shift_ofst[S] is equal to self::YY_SHIFT_USE_DFLT, it means that 198 ** the action is not in the table and that self::$yy_default[S] should be used instead. 199 ** 200 ** The formula above is for computing the action when the lookahead is 201 ** a terminal symbol. If the lookahead is a non-terminal (as occurs after 202 ** a reduce action) then the static $yy_reduce_ofst array is used in place of 203 ** the static $yy_shift_ofst array and self::YY_REDUCE_USE_DFLT is used in place of 204 ** self::YY_SHIFT_USE_DFLT. 205 ** 206 ** The following are the tables generated in this section: 207 ** 208 ** self::$yy_action A single table containing all actions. 209 ** self::$yy_lookahead A table containing the lookahead for each entry in 210 ** yy_action. Used to detect hash collisions. 211 ** self::$yy_shift_ofst For each state, the offset into self::$yy_action for 212 ** shifting terminals. 213 ** self::$yy_reduce_ofst For each state, the offset into self::$yy_action for 214 ** shifting non-terminals after a reduce. 215 ** self::$yy_default Default action for each state. 216 */ 217 const YY_SZ_ACTTAB = 353; 218 static public $yy_action = array( 219 /* 0 */ 235, 47, 15, 21, 121, 133, 132, 131, 134, 135, 220 /* 10 */ 137, 136, 130, 129, 34, 15, 21, 121, 133, 132, 221 /* 20 */ 131, 134, 135, 137, 136, 130, 129, 90, 15, 21, 222 /* 30 */ 121, 133, 132, 131, 134, 135, 137, 136, 130, 129, 223 /* 40 */ 35, 15, 21, 121, 133, 132, 131, 134, 135, 137, 224 /* 50 */ 136, 130, 129, 39, 15, 21, 121, 133, 132, 131, 225 /* 60 */ 134, 135, 137, 136, 130, 129, 31, 15, 21, 121, 226 /* 70 */ 133, 132, 131, 134, 135, 137, 136, 130, 129, 33, 227 /* 80 */ 15, 21, 121, 133, 132, 131, 134, 135, 137, 136, 228 /* 90 */ 130, 129, 38, 15, 21, 121, 133, 132, 131, 134, 229 /* 100 */ 135, 137, 136, 130, 129, 36, 15, 21, 121, 133, 230 /* 110 */ 132, 131, 134, 135, 137, 136, 130, 129, 37, 15, 231 /* 120 */ 21, 121, 133, 132, 131, 134, 135, 137, 136, 130, 232 /* 130 */ 129, 41, 15, 21, 121, 133, 132, 131, 134, 135, 233 /* 140 */ 137, 136, 130, 129, 40, 15, 21, 121, 133, 132, 234 /* 150 */ 131, 134, 135, 137, 136, 130, 129, 42, 15, 21, 235 /* 160 */ 121, 133, 132, 131, 134, 135, 137, 136, 130, 129, 236 /* 170 */ 30, 15, 21, 121, 133, 132, 131, 134, 135, 137, 237 /* 180 */ 136, 130, 129, 16, 21, 121, 133, 132, 131, 134, 238 /* 190 */ 135, 137, 136, 130, 129, 48, 24, 20, 84, 94, 239 /* 200 */ 96, 101, 74, 75, 73, 72, 71, 77, 70, 60, 240 /* 210 */ 63, 43, 61, 9, 1, 2, 3, 4, 10, 12, 241 /* 220 */ 51, 57, 8, 17, 125, 126, 14, 87, 124, 123, 242 /* 230 */ 18, 114, 115, 45, 44, 59, 116, 46, 13, 8, 243 /* 240 */ 17, 127, 97, 138, 89, 78, 79, 18, 103, 7, 244 /* 250 */ 45, 44, 59, 85, 46, 13, 8, 17, 110, 120, 245 /* 260 */ 109, 107, 78, 79, 18, 32, 119, 45, 44, 59, 246 /* 270 */ 99, 46, 13, 8, 17, 19, 62, 65, 53, 124, 247 /* 280 */ 123, 18, 13, 56, 45, 44, 59, 50, 46, 26, 248 /* 290 */ 64, 76, 66, 67, 68, 69, 88, 66, 67, 68, 249 /* 300 */ 6, 1, 2, 3, 4, 62, 65, 53, 128, 113, 250 /* 310 */ 117, 104, 105, 112, 13, 13, 13, 13, 13, 13, 251 /* 320 */ 13, 13, 11, 5, 13, 28, 81, 106, 100, 58, 252 /* 330 */ 49, 122, 52, 54, 55, 98, 95, 118, 86, 80, 253 /* 340 */ 27, 29, 25, 92, 102, 108, 91, 93, 111, 82, 254 /* 350 */ 83, 22, 23, 255 ); 256 static public $yy_lookahead = array( 257 /* 0 */ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 258 /* 10 */ 39, 40, 41, 42, 30, 31, 32, 33, 34, 35, 259 /* 20 */ 36, 37, 38, 39, 40, 41, 42, 30, 31, 32, 260 /* 30 */ 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 261 /* 40 */ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 262 /* 50 */ 40, 41, 42, 30, 31, 32, 33, 34, 35, 36, 263 /* 60 */ 37, 38, 39, 40, 41, 42, 30, 31, 32, 33, 264 /* 70 */ 34, 35, 36, 37, 38, 39, 40, 41, 42, 30, 265 /* 80 */ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 266 /* 90 */ 41, 42, 30, 31, 32, 33, 34, 35, 36, 37, 267 /* 100 */ 38, 39, 40, 41, 42, 30, 31, 32, 33, 34, 268 /* 110 */ 35, 36, 37, 38, 39, 40, 41, 42, 30, 31, 269 /* 120 */ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 270 /* 130 */ 42, 30, 31, 32, 33, 34, 35, 36, 37, 38, 271 /* 140 */ 39, 40, 41, 42, 30, 31, 32, 33, 34, 35, 272 /* 150 */ 36, 37, 38, 39, 40, 41, 42, 30, 31, 32, 273 /* 160 */ 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 274 /* 170 */ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 275 /* 180 */ 40, 41, 42, 31, 32, 33, 34, 35, 36, 37, 276 /* 190 */ 38, 39, 40, 41, 42, 1, 2, 32, 33, 34, 277 /* 200 */ 35, 36, 37, 38, 39, 40, 41, 42, 12, 13, 278 /* 210 */ 14, 17, 16, 19, 20, 21, 22, 23, 24, 25, 279 /* 220 */ 26, 27, 1, 2, 12, 13, 5, 4, 7, 8, 280 /* 230 */ 9, 12, 13, 12, 13, 14, 4, 16, 3, 1, 281 /* 240 */ 2, 12, 13, 14, 6, 7, 8, 9, 18, 19, 282 /* 250 */ 12, 13, 14, 18, 16, 3, 1, 2, 12, 13, 283 /* 260 */ 14, 6, 7, 8, 9, 15, 4, 12, 13, 14, 284 /* 270 */ 18, 16, 3, 1, 2, 11, 12, 13, 14, 7, 285 /* 280 */ 8, 9, 3, 12, 12, 13, 14, 18, 16, 15, 286 /* 290 */ 10, 4, 12, 13, 14, 10, 18, 12, 13, 14, 287 /* 300 */ 18, 20, 21, 22, 23, 12, 13, 14, 12, 13, 288 /* 310 */ 14, 12, 13, 14, 3, 3, 3, 3, 3, 3, 289 /* 320 */ 3, 3, 36, 37, 3, 15, 4, 4, 4, 18, 290 /* 330 */ 18, 18, 18, 18, 18, 18, 18, 4, 4, 18, 291 /* 340 */ 15, 15, 15, 4, 4, 4, 18, 4, 4, 4, 292 /* 350 */ 4, 43, 43, 293 ); 294 const YY_SHIFT_USE_DFLT = -1; 295 const YY_SHIFT_MAX = 70; 296 static public $yy_shift_ofst = array( 297 /* 0 */ 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 298 /* 10 */ 221, 221, 221, 221, 272, 255, 238, 194, 264, 293, 299 /* 20 */ 196, 196, 280, 285, 281, 299, 229, 246, 296, 212, 300 /* 30 */ 252, 316, 219, 314, 313, 315, 312, 269, 235, 311, 301 /* 40 */ 318, 317, 321, 230, 333, 232, 262, 279, 271, 322, 302 /* 50 */ 287, 278, 223, 250, 345, 340, 282, 328, 341, 344, 303 /* 60 */ 343, 339, 327, 324, 323, 310, 325, 274, 326, 346, 304 /* 70 */ 334, 305 ); 306 const YY_REDUCE_USE_DFLT = -30; 307 const YY_REDUCE_MAX = 19; 308 static public $yy_reduce_ofst = array( 309 /* 0 */ -29, 127, 114, 101, 140, 88, 10, -16, 23, 36, 310 /* 10 */ 49, 75, 62, -3, 152, 165, 165, 286, 309, 308, 311 ); 312 static public $yyExpectedTokens = array( 313 /* 0 */ array(1, 2, 5, 7, 8, 9, 12, 13, 14, 16, ), 314 /* 1 */ array(1, 2, 5, 7, 8, 9, 12, 13, 14, 16, ), 315 /* 2 */ array(1, 2, 5, 7, 8, 9, 12, 13, 14, 16, ), 316 /* 3 */ array(1, 2, 5, 7, 8, 9, 12, 13, 14, 16, ), 317 /* 4 */ array(1, 2, 5, 7, 8, 9, 12, 13, 14, 16, ), 318 /* 5 */ array(1, 2, 5, 7, 8, 9, 12, 13, 14, 16, ), 319 /* 6 */ array(1, 2, 5, 7, 8, 9, 12, 13, 14, 16, ), 320 /* 7 */ array(1, 2, 5, 7, 8, 9, 12, 13, 14, 16, ), 321 /* 8 */ array(1, 2, 5, 7, 8, 9, 12, 13, 14, 16, ), 322 /* 9 */ array(1, 2, 5, 7, 8, 9, 12, 13, 14, 16, ), 323 /* 10 */ array(1, 2, 5, 7, 8, 9, 12, 13, 14, 16, ), 324 /* 11 */ array(1, 2, 5, 7, 8, 9, 12, 13, 14, 16, ), 325 /* 12 */ array(1, 2, 5, 7, 8, 9, 12, 13, 14, 16, ), 326 /* 13 */ array(1, 2, 5, 7, 8, 9, 12, 13, 14, 16, ), 327 /* 14 */ array(1, 2, 7, 8, 9, 12, 13, 14, 16, ), 328 /* 15 */ array(1, 2, 6, 7, 8, 9, 12, 13, 14, 16, ), 329 /* 16 */ array(1, 2, 6, 7, 8, 9, 12, 13, 14, 16, ), 330 /* 17 */ array(1, 2, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, ), 331 /* 18 */ array(11, 12, 13, 14, ), 332 /* 19 */ array(12, 13, 14, ), 333 /* 20 */ array(12, 13, 14, 16, ), 334 /* 21 */ array(12, 13, 14, 16, ), 335 /* 22 */ array(10, 12, 13, 14, ), 336 /* 23 */ array(10, 12, 13, 14, ), 337 /* 24 */ array(20, 21, 22, 23, ), 338 /* 25 */ array(12, 13, 14, ), 339 /* 26 */ array(12, 13, 14, ), 340 /* 27 */ array(12, 13, 14, ), 341 /* 28 */ array(12, 13, 14, ), 342 /* 29 */ array(12, 13, ), 343 /* 30 */ array(3, 18, ), 344 /* 31 */ array(3, 18, ), 345 /* 32 */ array(12, 13, ), 346 /* 33 */ array(3, 18, ), 347 /* 34 */ array(3, 18, ), 348 /* 35 */ array(3, 18, ), 349 /* 36 */ array(3, 18, ), 350 /* 37 */ array(3, 18, ), 351 /* 38 */ array(3, 18, ), 352 /* 39 */ array(3, 18, ), 353 /* 40 */ array(3, 18, ), 354 /* 41 */ array(3, 18, ), 355 /* 42 */ array(3, 18, ), 356 /* 43 */ array(18, 19, ), 357 /* 44 */ array(4, ), 358 /* 45 */ array(4, ), 359 /* 46 */ array(4, ), 360 /* 47 */ array(3, ), 361 /* 48 */ array(12, ), 362 /* 49 */ array(4, ), 363 /* 50 */ array(4, ), 364 /* 51 */ array(18, ), 365 /* 52 */ array(4, ), 366 /* 53 */ array(15, ), 367 /* 54 */ array(4, ), 368 /* 55 */ array(4, ), 369 /* 56 */ array(18, ), 370 /* 57 */ array(18, ), 371 /* 58 */ array(4, ), 372 /* 59 */ array(4, ), 373 /* 60 */ array(4, ), 374 /* 61 */ array(4, ), 375 /* 62 */ array(15, ), 376 /* 63 */ array(4, ), 377 /* 64 */ array(4, ), 378 /* 65 */ array(15, ), 379 /* 66 */ array(15, ), 380 /* 67 */ array(15, ), 381 /* 68 */ array(15, ), 382 /* 69 */ array(4, ), 383 /* 70 */ array(4, ), 384 /* 71 */ array(), 385 /* 72 */ array(), 386 /* 73 */ array(), 387 /* 74 */ array(), 388 /* 75 */ array(), 389 /* 76 */ array(), 390 /* 77 */ array(), 391 /* 78 */ array(), 392 /* 79 */ array(), 393 /* 80 */ array(), 394 /* 81 */ array(), 395 /* 82 */ array(), 396 /* 83 */ array(), 397 /* 84 */ array(), 398 /* 85 */ array(), 399 /* 86 */ array(), 400 /* 87 */ array(), 401 /* 88 */ array(), 402 /* 89 */ array(), 403 /* 90 */ array(), 404 /* 91 */ array(), 405 /* 92 */ array(), 406 /* 93 */ array(), 407 /* 94 */ array(), 408 /* 95 */ array(), 409 /* 96 */ array(), 410 /* 97 */ array(), 411 /* 98 */ array(), 412 /* 99 */ array(), 413 /* 100 */ array(), 414 /* 101 */ array(), 415 /* 102 */ array(), 416 /* 103 */ array(), 417 /* 104 */ array(), 418 /* 105 */ array(), 419 /* 106 */ array(), 420 /* 107 */ array(), 421 /* 108 */ array(), 422 /* 109 */ array(), 423 /* 110 */ array(), 424 /* 111 */ array(), 425 /* 112 */ array(), 426 /* 113 */ array(), 427 /* 114 */ array(), 428 /* 115 */ array(), 429 /* 116 */ array(), 430 /* 117 */ array(), 431 /* 118 */ array(), 432 /* 119 */ array(), 433 /* 120 */ array(), 434 /* 121 */ array(), 435 /* 122 */ array(), 436 /* 123 */ array(), 437 /* 124 */ array(), 438 /* 125 */ array(), 439 /* 126 */ array(), 440 /* 127 */ array(), 441 /* 128 */ array(), 442 /* 129 */ array(), 443 /* 130 */ array(), 444 /* 131 */ array(), 445 /* 132 */ array(), 446 /* 133 */ array(), 447 /* 134 */ array(), 448 /* 135 */ array(), 449 /* 136 */ array(), 450 /* 137 */ array(), 451 /* 138 */ array(), 452 ); 453 static public $yy_default = array( 454 /* 0 */ 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 455 /* 10 */ 234, 234, 234, 234, 234, 143, 141, 234, 234, 234, 456 /* 20 */ 158, 145, 234, 234, 234, 234, 234, 234, 234, 234, 457 /* 30 */ 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 458 /* 40 */ 234, 234, 234, 234, 201, 197, 199, 139, 234, 219, 459 /* 50 */ 221, 234, 227, 177, 218, 215, 234, 234, 229, 203, 460 /* 60 */ 209, 207, 175, 211, 172, 176, 188, 186, 187, 171, 461 /* 70 */ 205, 167, 166, 165, 163, 164, 222, 168, 169, 170, 462 /* 80 */ 223, 220, 217, 173, 159, 231, 206, 228, 232, 140, 463 /* 90 */ 144, 233, 208, 210, 160, 224, 161, 189, 225, 226, 464 /* 100 */ 212, 162, 216, 213, 183, 184, 174, 142, 230, 195, 465 /* 110 */ 196, 204, 185, 180, 181, 178, 198, 179, 202, 200, 466 /* 120 */ 194, 146, 214, 157, 156, 193, 190, 192, 182, 155, 467 /* 130 */ 154, 149, 148, 147, 150, 151, 153, 152, 191, 468 ); 469 /* The next thing included is series of defines which control 470 ** various aspects of the generated parser. 471 ** self::YYNOCODE is a number which corresponds 472 ** to no legal terminal or nonterminal number. This 473 ** number is used to fill in empty slots of the hash 474 ** table. 475 ** self::YYFALLBACK If defined, this indicates that one or more tokens 476 ** have fall-back values which should be used if the 477 ** original value of the token will not parse. 478 ** self::YYSTACKDEPTH is the maximum depth of the parser's stack. 479 ** self::YYNSTATE the combined number of states. 480 ** self::YYNRULE the number of rules in the grammar 481 ** self::YYERRORSYMBOL is the code number of the error symbol. If not 482 ** defined, then do no error processing. 483 */ 484 const YYNOCODE = 45; 485 const YYSTACKDEPTH = 100; 486 const YYNSTATE = 139; 487 const YYNRULE = 95; 488 const YYERRORSYMBOL = 28; 489 const YYERRSYMDT = 'yy0'; 490 const YYFALLBACK = 0; 491 /** The next table maps tokens into fallback tokens. If a construct 492 * like the following: 493 * 494 * %fallback ID X Y Z. 495 * 496 * appears in the grammer, then ID becomes a fallback token for X, Y, 497 * and Z. Whenever one of the tokens X, Y, or Z is input to the parser 498 * but it does not parse, the type of the token is changed to ID and 499 * the parse is retried before an error is thrown. 500 */ 501 static public $yyFallback = array( 502 ); 503 /** 504 * Turn parser tracing on by giving a stream to which to write the trace 505 * and a prompt to preface each trace message. Tracing is turned off 506 * by making either argument NULL 507 * 508 * Inputs: 509 * 510 * - A stream resource to which trace output should be written. 511 * If NULL, then tracing is turned off. 512 * - A prefix string written at the beginning of every 513 * line of trace output. If NULL, then tracing is 514 * turned off. 515 * 516 * Outputs: 517 * 518 * - None. 519 * @param resource 520 * @param string 521 */ 522 static function Trace($TraceFILE, $zTracePrompt) 523 { 524 if (!$TraceFILE) { 525 $zTracePrompt = 0; 526 } elseif (!$zTracePrompt) { 527 $TraceFILE = 0; 528 } 529 self::$yyTraceFILE = $TraceFILE; 530 self::$yyTracePrompt = $zTracePrompt; 531 } 532 533 /** 534 * Output debug information to output (php://output stream) 535 */ 536 static function PrintTrace() 537 { 538 self::$yyTraceFILE = fopen('php://output', 'w'); 539 self::$yyTracePrompt = ''; 540 } 541 542 /** 543 * @var resource|0 544 */ 545 static public $yyTraceFILE; 546 /** 547 * String to prepend to debug output 548 * @var string|0 549 */ 550 static public $yyTracePrompt; 551 /** 552 * @var int 553 */ 554 public $yyidx; /* Index of top element in stack */ 555 /** 556 * @var int 557 */ 558 public $yyerrcnt; /* Shifts left before out of the error */ 559 /** 560 * @var array 561 */ 562 public $yystack = array(); /* The parser's stack */ 563 564 /** 565 * For tracing shifts, the names of all terminals and nonterminals 566 * are required. The following table supplies these names 567 * @var array 568 */ 569 static public $yyTokenName = array( 570 '$', 'OPENPAREN', 'OPENASSERTION', 'BAR', 571 'MULTIPLIER', 'MATCHSTART', 'MATCHEND', 'BACKREFERENCE', 572 'COULDBEBACKREF', 'OPENCHARCLASS', 'CLOSECHARCLASS', 'NEGATE', 573 'TEXT', 'CONTROLCHAR', 'ESCAPEDBACKSLASH', 'HYPHEN', 574 'FULLSTOP', 'INTERNALOPTIONS', 'CLOSEPAREN', 'COLON', 575 'POSITIVELOOKAHEAD', 'NEGATIVELOOKAHEAD', 'POSITIVELOOKBEHIND', 'NEGATIVELOOKBEHIND', 576 'PATTERNNAME', 'ONCEONLY', 'COMMENT', 'RECUR', 577 'error', 'start', 'pattern', 'basic_pattern', 578 'basic_text', 'character_class', 'assertion', 'grouping', 579 'lookahead', 'lookbehind', 'subpattern', 'onceonly', 580 'comment', 'recur', 'conditional', 'character_class_contents', 581 ); 582 583 /** 584 * For tracing reduce actions, the names of all rules are required. 585 * @var array 586 */ 587 static public $yyRuleName = array( 588 /* 0 */ "start ::= pattern", 589 /* 1 */ "pattern ::= MATCHSTART basic_pattern MATCHEND", 590 /* 2 */ "pattern ::= MATCHSTART basic_pattern", 591 /* 3 */ "pattern ::= basic_pattern MATCHEND", 592 /* 4 */ "pattern ::= basic_pattern", 593 /* 5 */ "pattern ::= pattern BAR pattern", 594 /* 6 */ "basic_pattern ::= basic_text", 595 /* 7 */ "basic_pattern ::= character_class", 596 /* 8 */ "basic_pattern ::= assertion", 597 /* 9 */ "basic_pattern ::= grouping", 598 /* 10 */ "basic_pattern ::= lookahead", 599 /* 11 */ "basic_pattern ::= lookbehind", 600 /* 12 */ "basic_pattern ::= subpattern", 601 /* 13 */ "basic_pattern ::= onceonly", 602 /* 14 */ "basic_pattern ::= comment", 603 /* 15 */ "basic_pattern ::= recur", 604 /* 16 */ "basic_pattern ::= conditional", 605 /* 17 */ "basic_pattern ::= BACKREFERENCE", 606 /* 18 */ "basic_pattern ::= COULDBEBACKREF", 607 /* 19 */ "basic_pattern ::= basic_pattern basic_text", 608 /* 20 */ "basic_pattern ::= basic_pattern character_class", 609 /* 21 */ "basic_pattern ::= basic_pattern assertion", 610 /* 22 */ "basic_pattern ::= basic_pattern grouping", 611 /* 23 */ "basic_pattern ::= basic_pattern lookahead", 612 /* 24 */ "basic_pattern ::= basic_pattern lookbehind", 613 /* 25 */ "basic_pattern ::= basic_pattern subpattern", 614 /* 26 */ "basic_pattern ::= basic_pattern onceonly", 615 /* 27 */ "basic_pattern ::= basic_pattern comment", 616 /* 28 */ "basic_pattern ::= basic_pattern recur", 617 /* 29 */ "basic_pattern ::= basic_pattern conditional", 618 /* 30 */ "basic_pattern ::= basic_pattern BACKREFERENCE", 619 /* 31 */ "basic_pattern ::= basic_pattern COULDBEBACKREF", 620 /* 32 */ "character_class ::= OPENCHARCLASS character_class_contents CLOSECHARCLASS", 621 /* 33 */ "character_class ::= OPENCHARCLASS NEGATE character_class_contents CLOSECHARCLASS", 622 /* 34 */ "character_class ::= OPENCHARCLASS character_class_contents CLOSECHARCLASS MULTIPLIER", 623 /* 35 */ "character_class ::= OPENCHARCLASS NEGATE character_class_contents CLOSECHARCLASS MULTIPLIER", 624 /* 36 */ "character_class_contents ::= TEXT", 625 /* 37 */ "character_class_contents ::= CONTROLCHAR", 626 /* 38 */ "character_class_contents ::= ESCAPEDBACKSLASH", 627 /* 39 */ "character_class_contents ::= ESCAPEDBACKSLASH HYPHEN CONTROLCHAR", 628 /* 40 */ "character_class_contents ::= CONTROLCHAR HYPHEN ESCAPEDBACKSLASH", 629 /* 41 */ "character_class_contents ::= CONTROLCHAR HYPHEN CONTROLCHAR", 630 /* 42 */ "character_class_contents ::= ESCAPEDBACKSLASH HYPHEN TEXT", 631 /* 43 */ "character_class_contents ::= CONTROLCHAR HYPHEN TEXT", 632 /* 44 */ "character_class_contents ::= TEXT HYPHEN TEXT", 633 /* 45 */ "character_class_contents ::= TEXT HYPHEN CONTROLCHAR", 634 /* 46 */ "character_class_contents ::= TEXT HYPHEN ESCAPEDBACKSLASH", 635 /* 47 */ "character_class_contents ::= character_class_contents CONTROLCHAR", 636 /* 48 */ "character_class_contents ::= character_class_contents ESCAPEDBACKSLASH", 637 /* 49 */ "character_class_contents ::= character_class_contents TEXT", 638 /* 50 */ "character_class_contents ::= character_class_contents CONTROLCHAR HYPHEN CONTROLCHAR", 639 /* 51 */ "character_class_contents ::= character_class_contents ESCAPEDBACKSLASH HYPHEN CONTROLCHAR", 640 /* 52 */ "character_class_contents ::= character_class_contents CONTROLCHAR HYPHEN ESCAPEDBACKSLASH", 641 /* 53 */ "character_class_contents ::= character_class_contents CONTROLCHAR HYPHEN TEXT", 642 /* 54 */ "character_class_contents ::= character_class_contents ESCAPEDBACKSLASH HYPHEN TEXT", 643 /* 55 */ "character_class_contents ::= character_class_contents TEXT HYPHEN CONTROLCHAR", 644 /* 56 */ "character_class_contents ::= character_class_contents TEXT HYPHEN ESCAPEDBACKSLASH", 645 /* 57 */ "character_class_contents ::= character_class_contents TEXT HYPHEN TEXT", 646 /* 58 */ "basic_text ::= TEXT", 647 /* 59 */ "basic_text ::= TEXT MULTIPLIER", 648 /* 60 */ "basic_text ::= FULLSTOP", 649 /* 61 */ "basic_text ::= FULLSTOP MULTIPLIER", 650 /* 62 */ "basic_text ::= CONTROLCHAR", 651 /* 63 */ "basic_text ::= CONTROLCHAR MULTIPLIER", 652 /* 64 */ "basic_text ::= ESCAPEDBACKSLASH", 653 /* 65 */ "basic_text ::= ESCAPEDBACKSLASH MULTIPLIER", 654 /* 66 */ "basic_text ::= basic_text TEXT", 655 /* 67 */ "basic_text ::= basic_text TEXT MULTIPLIER", 656 /* 68 */ "basic_text ::= basic_text FULLSTOP", 657 /* 69 */ "basic_text ::= basic_text FULLSTOP MULTIPLIER", 658 /* 70 */ "basic_text ::= basic_text CONTROLCHAR", 659 /* 71 */ "basic_text ::= basic_text CONTROLCHAR MULTIPLIER", 660 /* 72 */ "basic_text ::= basic_text ESCAPEDBACKSLASH", 661 /* 73 */ "basic_text ::= basic_text ESCAPEDBACKSLASH MULTIPLIER", 662 /* 74 */ "assertion ::= OPENASSERTION INTERNALOPTIONS CLOSEPAREN", 663 /* 75 */ "assertion ::= OPENASSERTION INTERNALOPTIONS COLON pattern CLOSEPAREN", 664 /* 76 */ "grouping ::= OPENASSERTION COLON pattern CLOSEPAREN", 665 /* 77 */ "grouping ::= OPENASSERTION COLON pattern CLOSEPAREN MULTIPLIER", 666 /* 78 */ "conditional ::= OPENASSERTION OPENPAREN TEXT CLOSEPAREN pattern CLOSEPAREN MULTIPLIER", 667 /* 79 */ "conditional ::= OPENASSERTION OPENPAREN TEXT CLOSEPAREN pattern CLOSEPAREN", 668 /* 80 */ "conditional ::= OPENASSERTION lookahead pattern CLOSEPAREN", 669 /* 81 */ "conditional ::= OPENASSERTION lookahead pattern CLOSEPAREN MULTIPLIER", 670 /* 82 */ "conditional ::= OPENASSERTION lookbehind pattern CLOSEPAREN", 671 /* 83 */ "conditional ::= OPENASSERTION lookbehind pattern CLOSEPAREN MULTIPLIER", 672 /* 84 */ "lookahead ::= OPENASSERTION POSITIVELOOKAHEAD pattern CLOSEPAREN", 673 /* 85 */ "lookahead ::= OPENASSERTION NEGATIVELOOKAHEAD pattern CLOSEPAREN", 674 /* 86 */ "lookbehind ::= OPENASSERTION POSITIVELOOKBEHIND pattern CLOSEPAREN", 675 /* 87 */ "lookbehind ::= OPENASSERTION NEGATIVELOOKBEHIND pattern CLOSEPAREN", 676 /* 88 */ "subpattern ::= OPENASSERTION PATTERNNAME pattern CLOSEPAREN", 677 /* 89 */ "subpattern ::= OPENASSERTION PATTERNNAME pattern CLOSEPAREN MULTIPLIER", 678 /* 90 */ "subpattern ::= OPENPAREN pattern CLOSEPAREN", 679 /* 91 */ "subpattern ::= OPENPAREN pattern CLOSEPAREN MULTIPLIER", 680 /* 92 */ "onceonly ::= OPENASSERTION ONCEONLY pattern CLOSEPAREN", 681 /* 93 */ "comment ::= OPENASSERTION COMMENT CLOSEPAREN", 682 /* 94 */ "recur ::= OPENASSERTION RECUR CLOSEPAREN", 683 ); 684 685 /** 686 * This function returns the symbolic name associated with a token 687 * value. 688 * @param int 689 * @return string 690 */ 691 function tokenName($tokenType) 692 { 693 if ($tokenType === 0) { 694 return 'End of Input'; 695 } 696 if ($tokenType > 0 && $tokenType < count(self::$yyTokenName)) { 697 return self::$yyTokenName[$tokenType]; 698 } else { 699 return "Unknown"; 700 } 701 } 702 703 /** 704 * The following function deletes the value associated with a 705 * symbol. The symbol can be either a terminal or nonterminal. 706 * @param int the symbol code 707 * @param mixed the symbol's value 708 */ 709 static function yy_destructor($yymajor, $yypminor) 710 { 711 switch ($yymajor) { 712 /* Here is inserted the actions which take place when a 713 ** terminal or non-terminal is destroyed. This can happen 714 ** when the symbol is popped from the stack during a 715 ** reduce or during error processing or when a parser is 716 ** being destroyed before it is finished parsing. 717 ** 718 ** Note: during a reduce, the only symbols destroyed are those 719 ** which appear on the RHS of the rule, but which are not used 720 ** inside the C code. 721 */ 722 default: break; /* If no destructor action specified: do nothing */ 723 } 724 } 725 726 /** 727 * Pop the parser's stack once. 728 * 729 * If there is a destructor routine associated with the token which 730 * is popped from the stack, then call it. 731 * 732 * Return the major token number for the symbol popped. 733 * @param PHP_LexerGenerator_Regex_yyParser 734 * @return int 735 */ 736 function yy_pop_parser_stack() 737 { 738 if (!count($this->yystack)) { 739 return; 740 } 741 $yytos = array_pop($this->yystack); 742 if (self::$yyTraceFILE && $this->yyidx >= 0) { 743 fwrite(self::$yyTraceFILE, 744 self::$yyTracePrompt . 'Popping ' . self::$yyTokenName[$yytos->major] . 745 "\n"); 746 } 747 $yymajor = $yytos->major; 748 self::yy_destructor($yymajor, $yytos->minor); 749 $this->yyidx--; 750 return $yymajor; 751 } 752 753 /** 754 * Deallocate and destroy a parser. Destructors are all called for 755 * all stack elements before shutting the parser down. 756 */ 757 function __destruct() 758 { 759 while ($this->yyidx >= 0) { 760 $this->yy_pop_parser_stack(); 761 } 762 if (is_resource(self::$yyTraceFILE)) { 763 fclose(self::$yyTraceFILE); 764 } 765 } 766 767 /** 768 * Based on the current state and parser stack, get a list of all 769 * possible lookahead tokens 770 * @param int 771 * @return array 772 */ 773 function yy_get_expected_tokens($token) 774 { 775 $state = $this->yystack[$this->yyidx]->stateno; 776 $expected = self::$yyExpectedTokens[$state]; 777 if (in_array($token, self::$yyExpectedTokens[$state], true)) { 778 return $expected; 779 } 780 $stack = $this->yystack; 781 $yyidx = $this->yyidx; 782 do { 783 $yyact = $this->yy_find_shift_action($token); 784 if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { 785 // reduce action 786 $done = 0; 787 do { 788 if ($done++ == 100) { 789 $this->yyidx = $yyidx; 790 $this->yystack = $stack; 791 // too much recursion prevents proper detection 792 // so give up 793 return array_unique($expected); 794 } 795 $yyruleno = $yyact - self::YYNSTATE; 796 $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs']; 797 $nextstate = $this->yy_find_reduce_action( 798 $this->yystack[$this->yyidx]->stateno, 799 self::$yyRuleInfo[$yyruleno]['lhs']); 800 if (isset(self::$yyExpectedTokens[$nextstate])) { 801 $expected += self::$yyExpectedTokens[$nextstate]; 802 if (in_array($token, 803 self::$yyExpectedTokens[$nextstate], true)) { 804 $this->yyidx = $yyidx; 805 $this->yystack = $stack; 806 return array_unique($expected); 807 } 808 } 809 if ($nextstate < self::YYNSTATE) { 810 // we need to shift a non-terminal 811 $this->yyidx++; 812 $x = new PHP_LexerGenerator_Regex_yyStackEntry; 813 $x->stateno = $nextstate; 814 $x->major = self::$yyRuleInfo[$yyruleno]['lhs']; 815 $this->yystack[$this->yyidx] = $x; 816 continue 2; 817 } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { 818 $this->yyidx = $yyidx; 819 $this->yystack = $stack; 820 // the last token was just ignored, we can't accept 821 // by ignoring input, this is in essence ignoring a 822 // syntax error! 823 return array_unique($expected); 824 } elseif ($nextstate === self::YY_NO_ACTION) { 825 $this->yyidx = $yyidx; 826 $this->yystack = $stack; 827 // input accepted, but not shifted (I guess) 828 return $expected; 829 } else { 830 $yyact = $nextstate; 831 } 832 } while (true); 833 } 834 break; 835 } while (true); 836 return array_unique($expected); 837 } 838 839 /** 840 * Based on the parser state and current parser stack, determine whether 841 * the lookahead token is possible. 842 * 843 * The parser will convert the token value to an error token if not. This 844 * catches some unusual edge cases where the parser would fail. 845 * @param int 846 * @return bool 847 */ 848 function yy_is_expected_token($token) 849 { 850 if ($token === 0) { 851 return true; // 0 is not part of this 852 } 853 $state = $this->yystack[$this->yyidx]->stateno; 854 if (in_array($token, self::$yyExpectedTokens[$state], true)) { 855 return true; 856 } 857 $stack = $this->yystack; 858 $yyidx = $this->yyidx; 859 do { 860 $yyact = $this->yy_find_shift_action($token); 861 if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { 862 // reduce action 863 $done = 0; 864 do { 865 if ($done++ == 100) { 866 $this->yyidx = $yyidx; 867 $this->yystack = $stack; 868 // too much recursion prevents proper detection 869 // so give up 870 return true; 871 } 872 $yyruleno = $yyact - self::YYNSTATE; 873 $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs']; 874 $nextstate = $this->yy_find_reduce_action( 875 $this->yystack[$this->yyidx]->stateno, 876 self::$yyRuleInfo[$yyruleno]['lhs']); 877 if (isset(self::$yyExpectedTokens[$nextstate]) && 878 in_array($token, self::$yyExpectedTokens[$nextstate], true)) { 879 $this->yyidx = $yyidx; 880 $this->yystack = $stack; 881 return true; 882 } 883 if ($nextstate < self::YYNSTATE) { 884 // we need to shift a non-terminal 885 $this->yyidx++; 886 $x = new PHP_LexerGenerator_Regex_yyStackEntry; 887 $x->stateno = $nextstate; 888 $x->major = self::$yyRuleInfo[$yyruleno]['lhs']; 889 $this->yystack[$this->yyidx] = $x; 890 continue 2; 891 } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { 892 $this->yyidx = $yyidx; 893 $this->yystack = $stack; 894 if (!$token) { 895 // end of input: this is valid 896 return true; 897 } 898 // the last token was just ignored, we can't accept 899 // by ignoring input, this is in essence ignoring a 900 // syntax error! 901 return false; 902 } elseif ($nextstate === self::YY_NO_ACTION) { 903 $this->yyidx = $yyidx; 904 $this->yystack = $stack; 905 // input accepted, but not shifted (I guess) 906 return true; 907 } else { 908 $yyact = $nextstate; 909 } 910 } while (true); 911 } 912 break; 913 } while (true); 914 return true; 915 } 916 917 /** 918 * Find the appropriate action for a parser given the terminal 919 * look-ahead token iLookAhead. 920 * 921 * If the look-ahead token is YYNOCODE, then check to see if the action is 922 * independent of the look-ahead. If it is, return the action, otherwise 923 * return YY_NO_ACTION. 924 * @param int The look-ahead token 925 */ 926 function yy_find_shift_action($iLookAhead) 927 { 928 $stateno = $this->yystack[$this->yyidx]->stateno; 929 930 /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */ 931 if (!isset(self::$yy_shift_ofst[$stateno])) { 932 // no shift actions 933 return self::$yy_default[$stateno]; 934 } 935 $i = self::$yy_shift_ofst[$stateno]; 936 if ($i === self::YY_SHIFT_USE_DFLT) { 937 return self::$yy_default[$stateno]; 938 } 939 if ($iLookAhead == self::YYNOCODE) { 940 return self::YY_NO_ACTION; 941 } 942 $i += $iLookAhead; 943 if ($i < 0 || $i >= self::YY_SZ_ACTTAB || 944 self::$yy_lookahead[$i] != $iLookAhead) { 945 if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) 946 && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) { 947 if (self::$yyTraceFILE) { 948 fwrite(self::$yyTraceFILE, self::$yyTracePrompt . "FALLBACK " . 949 self::$yyTokenName[$iLookAhead] . " => " . 950 self::$yyTokenName[$iFallback] . "\n"); 951 } 952 return $this->yy_find_shift_action($iFallback); 953 } 954 return self::$yy_default[$stateno]; 955 } else { 956 return self::$yy_action[$i]; 957 } 958 } 959 960 /** 961 * Find the appropriate action for a parser given the non-terminal 962 * look-ahead token $iLookAhead. 963 * 964 * If the look-ahead token is self::YYNOCODE, then check to see if the action is 965 * independent of the look-ahead. If it is, return the action, otherwise 966 * return self::YY_NO_ACTION. 967 * @param int Current state number 968 * @param int The look-ahead token 969 */ 970 function yy_find_reduce_action($stateno, $iLookAhead) 971 { 972 /* $stateno = $this->yystack[$this->yyidx]->stateno; */ 973 974 if (!isset(self::$yy_reduce_ofst[$stateno])) { 975 return self::$yy_default[$stateno]; 976 } 977 $i = self::$yy_reduce_ofst[$stateno]; 978 if ($i == self::YY_REDUCE_USE_DFLT) { 979 return self::$yy_default[$stateno]; 980 } 981 if ($iLookAhead == self::YYNOCODE) { 982 return self::YY_NO_ACTION; 983 } 984 $i += $iLookAhead; 985 if ($i < 0 || $i >= self::YY_SZ_ACTTAB || 986 self::$yy_lookahead[$i] != $iLookAhead) { 987 return self::$yy_default[$stateno]; 988 } else { 989 return self::$yy_action[$i]; 990 } 991 } 992 993 /** 994 * Perform a shift action. 995 * @param int The new state to shift in 996 * @param int The major token to shift in 997 * @param mixed the minor token to shift in 998 */ 999 function yy_shift($yyNewState, $yyMajor, $yypMinor) 1000 { 1001 $this->yyidx++; 1002 if ($this->yyidx >= self::YYSTACKDEPTH) { 1003 $this->yyidx--; 1004 if (self::$yyTraceFILE) { 1005 fprintf(self::$yyTraceFILE, "%sStack Overflow!\n", self::$yyTracePrompt); 1006 } 1007 while ($this->yyidx >= 0) { 1008 $this->yy_pop_parser_stack(); 1009 } 1010 /* Here code is inserted which will execute if the parser 1011 ** stack ever overflows */ 1012 return; 1013 } 1014 $yytos = new PHP_LexerGenerator_Regex_yyStackEntry; 1015 $yytos->stateno = $yyNewState; 1016 $yytos->major = $yyMajor; 1017 $yytos->minor = $yypMinor; 1018 array_push($this->yystack, $yytos); 1019 if (self::$yyTraceFILE && $this->yyidx > 0) { 1020 fprintf(self::$yyTraceFILE, "%sShift %d\n", self::$yyTracePrompt, 1021 $yyNewState); 1022 fprintf(self::$yyTraceFILE, "%sStack:", self::$yyTracePrompt); 1023 for($i = 1; $i <= $this->yyidx; $i++) { 1024 fprintf(self::$yyTraceFILE, " %s", 1025 self::$yyTokenName[$this->yystack[$i]->major]); 1026 } 1027 fwrite(self::$yyTraceFILE,"\n"); 1028 } 1029 } 1030 1031 /** 1032 * The following table contains information about every rule that 1033 * is used during the reduce. 1034 * 1035 * <pre> 1036 * array( 1037 * array( 1038 * int $lhs; Symbol on the left-hand side of the rule 1039 * int $nrhs; Number of right-hand side symbols in the rule 1040 * ),... 1041 * ); 1042 * </pre> 1043 */ 1044 static public $yyRuleInfo = array( 1045 array( 'lhs' => 29, 'rhs' => 1 ), 1046 array( 'lhs' => 30, 'rhs' => 3 ), 1047 array( 'lhs' => 30, 'rhs' => 2 ), 1048 array( 'lhs' => 30, 'rhs' => 2 ), 1049 array( 'lhs' => 30, 'rhs' => 1 ), 1050 array( 'lhs' => 30, 'rhs' => 3 ), 1051 array( 'lhs' => 31, 'rhs' => 1 ), 1052 array( 'lhs' => 31, 'rhs' => 1 ), 1053 array( 'lhs' => 31, 'rhs' => 1 ), 1054 array( 'lhs' => 31, 'rhs' => 1 ), 1055 array( 'lhs' => 31, 'rhs' => 1 ), 1056 array( 'lhs' => 31, 'rhs' => 1 ), 1057 array( 'lhs' => 31, 'rhs' => 1 ), 1058 array( 'lhs' => 31, 'rhs' => 1 ), 1059 array( 'lhs' => 31, 'rhs' => 1 ), 1060 array( 'lhs' => 31, 'rhs' => 1 ), 1061 array( 'lhs' => 31, 'rhs' => 1 ), 1062 array( 'lhs' => 31, 'rhs' => 1 ), 1063 array( 'lhs' => 31, 'rhs' => 1 ), 1064 array( 'lhs' => 31, 'rhs' => 2 ), 1065 array( 'lhs' => 31, 'rhs' => 2 ), 1066 array( 'lhs' => 31, 'rhs' => 2 ), 1067 array( 'lhs' => 31, 'rhs' => 2 ), 1068 array( 'lhs' => 31, 'rhs' => 2 ), 1069 array( 'lhs' => 31, 'rhs' => 2 ), 1070 array( 'lhs' => 31, 'rhs' => 2 ), 1071 array( 'lhs' => 31, 'rhs' => 2 ), 1072 array( 'lhs' => 31, 'rhs' => 2 ), 1073 array( 'lhs' => 31, 'rhs' => 2 ), 1074 array( 'lhs' => 31, 'rhs' => 2 ), 1075 array( 'lhs' => 31, 'rhs' => 2 ), 1076 array( 'lhs' => 31, 'rhs' => 2 ), 1077 array( 'lhs' => 33, 'rhs' => 3 ), 1078 array( 'lhs' => 33, 'rhs' => 4 ), 1079 array( 'lhs' => 33, 'rhs' => 4 ), 1080 array( 'lhs' => 33, 'rhs' => 5 ), 1081 array( 'lhs' => 43, 'rhs' => 1 ), 1082 array( 'lhs' => 43, 'rhs' => 1 ), 1083 array( 'lhs' => 43, 'rhs' => 1 ), 1084 array( 'lhs' => 43, 'rhs' => 3 ), 1085 array( 'lhs' => 43, 'rhs' => 3 ), 1086 array( 'lhs' => 43, 'rhs' => 3 ), 1087 array( 'lhs' => 43, 'rhs' => 3 ), 1088 array( 'lhs' => 43, 'rhs' => 3 ), 1089 array( 'lhs' => 43, 'rhs' => 3 ), 1090 array( 'lhs' => 43, 'rhs' => 3 ), 1091 array( 'lhs' => 43, 'rhs' => 3 ), 1092 array( 'lhs' => 43, 'rhs' => 2 ), 1093 array( 'lhs' => 43, 'rhs' => 2 ), 1094 array( 'lhs' => 43, 'rhs' => 2 ), 1095 array( 'lhs' => 43, 'rhs' => 4 ), 1096 array( 'lhs' => 43, 'rhs' => 4 ), 1097 array( 'lhs' => 43, 'rhs' => 4 ), 1098 array( 'lhs' => 43, 'rhs' => 4 ), 1099 array( 'lhs' => 43, 'rhs' => 4 ), 1100 array( 'lhs' => 43, 'rhs' => 4 ), 1101 array( 'lhs' => 43, 'rhs' => 4 ), 1102 array( 'lhs' => 43, 'rhs' => 4 ), 1103 array( 'lhs' => 32, 'rhs' => 1 ), 1104 array( 'lhs' => 32, 'rhs' => 2 ), 1105 array( 'lhs' => 32, 'rhs' => 1 ), 1106 array( 'lhs' => 32, 'rhs' => 2 ), 1107 array( 'lhs' => 32, 'rhs' => 1 ), 1108 array( 'lhs' => 32, 'rhs' => 2 ), 1109 array( 'lhs' => 32, 'rhs' => 1 ), 1110 array( 'lhs' => 32, 'rhs' => 2 ), 1111 array( 'lhs' => 32, 'rhs' => 2 ), 1112 array( 'lhs' => 32, 'rhs' => 3 ), 1113 array( 'lhs' => 32, 'rhs' => 2 ), 1114 array( 'lhs' => 32, 'rhs' => 3 ), 1115 array( 'lhs' => 32, 'rhs' => 2 ), 1116 array( 'lhs' => 32, 'rhs' => 3 ), 1117 array( 'lhs' => 32, 'rhs' => 2 ), 1118 array( 'lhs' => 32, 'rhs' => 3 ), 1119 array( 'lhs' => 34, 'rhs' => 3 ), 1120 array( 'lhs' => 34, 'rhs' => 5 ), 1121 array( 'lhs' => 35, 'rhs' => 4 ), 1122 array( 'lhs' => 35, 'rhs' => 5 ), 1123 array( 'lhs' => 42, 'rhs' => 7 ), 1124 array( 'lhs' => 42, 'rhs' => 6 ), 1125 array( 'lhs' => 42, 'rhs' => 4 ), 1126 array( 'lhs' => 42, 'rhs' => 5 ), 1127 array( 'lhs' => 42, 'rhs' => 4 ), 1128 array( 'lhs' => 42, 'rhs' => 5 ), 1129 array( 'lhs' => 36, 'rhs' => 4 ), 1130 array( 'lhs' => 36, 'rhs' => 4 ), 1131 array( 'lhs' => 37, 'rhs' => 4 ), 1132 array( 'lhs' => 37, 'rhs' => 4 ), 1133 array( 'lhs' => 38, 'rhs' => 4 ), 1134 array( 'lhs' => 38, 'rhs' => 5 ), 1135 array( 'lhs' => 38, 'rhs' => 3 ), 1136 array( 'lhs' => 38, 'rhs' => 4 ), 1137 array( 'lhs' => 39, 'rhs' => 4 ), 1138 array( 'lhs' => 40, 'rhs' => 3 ), 1139 array( 'lhs' => 41, 'rhs' => 3 ), 1140 ); 1141 1142 /** 1143 * The following table contains a mapping of reduce action to method name 1144 * that handles the reduction. 1145 * 1146 * If a rule is not set, it has no handler. 1147 */ 1148 static public $yyReduceMap = array( 1149 0 => 0, 1150 1 => 1, 1151 2 => 2, 1152 3 => 3, 1153 4 => 4, 1154 6 => 4, 1155 7 => 4, 1156 9 => 4, 1157 10 => 4, 1158 12 => 4, 1159 13 => 4, 1160 14 => 4, 1161 15 => 4, 1162 16 => 4, 1163 5 => 5, 1164 17 => 17, 1165 18 => 18, 1166 19 => 19, 1167 20 => 19, 1168 22 => 19, 1169 23 => 19, 1170 25 => 19, 1171 26 => 19, 1172 27 => 19, 1173 28 => 19, 1174 29 => 19, 1175 30 => 30, 1176 31 => 31, 1177 32 => 32, 1178 33 => 33, 1179 34 => 34, 1180 35 => 35, 1181 36 => 36, 1182 58 => 36, 1183 60 => 36, 1184 37 => 37, 1185 62 => 37, 1186 38 => 38, 1187 64 => 38, 1188 39 => 39, 1189 40 => 40, 1190 41 => 41, 1191 42 => 42, 1192 43 => 43, 1193 44 => 44, 1194 45 => 45, 1195 46 => 46, 1196 47 => 47, 1197 70 => 47, 1198 48 => 48, 1199 72 => 48, 1200 49 => 49, 1201 66 => 49, 1202 68 => 49, 1203 50 => 50, 1204 51 => 51, 1205 52 => 52, 1206 53 => 53, 1207 54 => 54, 1208 55 => 55, 1209 56 => 56, 1210 57 => 57, 1211 59 => 59, 1212 61 => 59, 1213 63 => 63, 1214 65 => 65, 1215 67 => 67, 1216 69 => 67, 1217 71 => 71, 1218 73 => 73, 1219 74 => 74, 1220 75 => 75, 1221 76 => 76, 1222 77 => 77, 1223 78 => 78, 1224 79 => 79, 1225 80 => 80, 1226 81 => 81, 1227 82 => 82, 1228 86 => 82, 1229 83 => 83, 1230 84 => 84, 1231 85 => 85, 1232 87 => 87, 1233 88 => 88, 1234 89 => 89, 1235 90 => 90, 1236 91 => 91, 1237 92 => 92, 1238 93 => 93, 1239 94 => 94, 1240 ); 1241 /* Beginning here are the reduction cases. A typical example 1242 ** follows: 1243 ** #line <lineno> <grammarfile> 1244 ** function yy_r0($yymsp){ ... } // User supplied code 1245 ** #line <lineno> <thisfile> 1246 */ 1247 #line 42 "LexerGenerator\Regex\Parser.y" 1248 function yy_r0(){ 1249 $this->yystack[$this->yyidx + 0]->minor->string = str_replace('"', '\\"', $this->yystack[$this->yyidx + 0]->minor->string); 1250 $x = $this->yystack[$this->yyidx + 0]->minor->metadata; 1251 $x['subpatterns'] = $this->_subpatterns; 1252 $this->yystack[$this->yyidx + 0]->minor->metadata = $x; 1253 $this->_subpatterns = 0; 1254 $this->result = $this->yystack[$this->yyidx + 0]->minor; 1255 } 1256 #line 1262 "LexerGenerator\Regex\Parser.php" 1257 #line 51 "LexerGenerator\Regex\Parser.y" 1258 function yy_r1(){ 1259 throw new PHP_LexerGenerator_Exception('Cannot include start match "' . 1260 $this->yystack[$this->yyidx + -2]->minor . '" or end match "' . $this->yystack[$this->yyidx + 0]->minor . '"'); 1261 } 1262 #line 1268 "LexerGenerator\Regex\Parser.php" 1263 #line 55 "LexerGenerator\Regex\Parser.y" 1264 function yy_r2(){ 1265 throw new PHP_LexerGenerator_Exception('Cannot include start match "' . 1266 B . '"'); 1267 } 1268 #line 1274 "LexerGenerator\Regex\Parser.php" 1269 #line 59 "LexerGenerator\Regex\Parser.y" 1270 function yy_r3(){ 1271 throw new PHP_LexerGenerator_Exception('Cannot include end match "' . $this->yystack[$this->yyidx + 0]->minor . '"'); 1272 } 1273 #line 1279 "LexerGenerator\Regex\Parser.php" 1274 #line 62 "LexerGenerator\Regex\Parser.y" 1275 function yy_r4(){$this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } 1276 #line 1282 "LexerGenerator\Regex\Parser.php" 1277 #line 63 "LexerGenerator\Regex\Parser.y" 1278 function yy_r5(){ 1279 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -2]->minor->string . '|' . $this->yystack[$this->yyidx + 0]->minor->string, array( 1280 'pattern' => $this->yystack[$this->yyidx + -2]->minor['pattern'] . '|' . $this->yystack[$this->yyidx + 0]->minor['pattern'])); 1281 } 1282 #line 1288 "LexerGenerator\Regex\Parser.php" 1283 #line 79 "LexerGenerator\Regex\Parser.y" 1284 function yy_r17(){ 1285 if (((int) substr($this->yystack[$this->yyidx + 0]->minor, 1)) > $this->_subpatterns) { 1286 throw new PHP_LexerGenerator_Exception('Back-reference refers to non-existent ' . 1287 'sub-pattern ' . substr($this->yystack[$this->yyidx + 0]->minor, 1)); 1288 } 1289 $this->yystack[$this->yyidx + 0]->minor = substr($this->yystack[$this->yyidx + 0]->minor, 1); 1290 // adjust back-reference for containing () 1291 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('\\\\' . ($this->yystack[$this->yyidx + 0]->minor + 1), array( 1292 'pattern' => '\\' . $this->yystack[$this->yyidx + 0]->minor)); 1293 } 1294 #line 1300 "LexerGenerator\Regex\Parser.php" 1295 #line 89 "LexerGenerator\Regex\Parser.y" 1296 function yy_r18(){ 1297 if (((int) substr($this->yystack[$this->yyidx + 0]->minor, 1)) > $this->_subpatterns) { 1298 throw new PHP_LexerGenerator_Exception($this->yystack[$this->yyidx + 0]->minor . ' will be interpreted as an invalid' . 1299 ' back-reference, use "\\0' . substr($this->yystack[$this->yyidx + 0]->minor, 1) . ' for octal'); 1300 } 1301 $this->yystack[$this->yyidx + 0]->minor = substr($this->yystack[$this->yyidx + 0]->minor, 1); 1302 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('\\\\' . ($this->yystack[$this->yyidx + 0]->minor + 1), array( 1303 'pattern' => '\\' . $this->yystack[$this->yyidx + 0]->minor)); 1304 } 1305 #line 1311 "LexerGenerator\Regex\Parser.php" 1306 #line 98 "LexerGenerator\Regex\Parser.y" 1307 function yy_r19(){ 1308 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -1]->minor->string . $this->yystack[$this->yyidx + 0]->minor->string, array( 1309 'pattern' => $this->yystack[$this->yyidx + -1]->minor['pattern'] . $this->yystack[$this->yyidx + 0]->minor['pattern'])); 1310 } 1311 #line 1317 "LexerGenerator\Regex\Parser.php" 1312 #line 136 "LexerGenerator\Regex\Parser.y" 1313 function yy_r30(){ 1314 if (((int) substr($this->yystack[$this->yyidx + 0]->minor, 1)) > $this->_subpatterns) { 1315 throw new PHP_LexerGenerator_Exception('Back-reference refers to non-existent ' . 1316 'sub-pattern ' . substr($this->yystack[$this->yyidx + 0]->minor, 1)); 1317 } 1318 $this->yystack[$this->yyidx + 0]->minor = substr($this->yystack[$this->yyidx + 0]->minor, 1); 1319 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -1]->minor->string . '\\\\' . ($this->yystack[$this->yyidx + 0]->minor + 1), array( 1320 'pattern' => $this->yystack[$this->yyidx + -1]->minor['pattern'] . '\\' . $this->yystack[$this->yyidx + 0]->minor)); 1321 } 1322 #line 1328 "LexerGenerator\Regex\Parser.php" 1323 #line 145 "LexerGenerator\Regex\Parser.y" 1324 function yy_r31(){ 1325 if (((int) substr($this->yystack[$this->yyidx + 0]->minor, 1)) > $this->_subpatterns) { 1326 throw new PHP_LexerGenerator_Exception($this->yystack[$this->yyidx + 0]->minor . ' will be interpreted as an invalid' . 1327 ' back-reference, use "\\0' . substr($this->yystack[$this->yyidx + 0]->minor, 1) . ' for octal'); 1328 } 1329 $this->yystack[$this->yyidx + 0]->minor = substr($this->yystack[$this->yyidx + 0]->minor, 1); 1330 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -1]->minor->string . '\\\\' . ($this->yystack[$this->yyidx + 0]->minor + 1), array( 1331 'pattern' => $this->yystack[$this->yyidx + -1]->minor['pattern'] . '\\' . $this->yystack[$this->yyidx + 0]->minor)); 1332 } 1333 #line 1339 "LexerGenerator\Regex\Parser.php" 1334 #line 155 "LexerGenerator\Regex\Parser.y" 1335 function yy_r32(){ 1336 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('[' . $this->yystack[$this->yyidx + -1]->minor->string . ']', array( 1337 'pattern' => '[' . $this->yystack[$this->yyidx + -1]->minor['pattern'] . ']')); 1338 } 1339 #line 1345 "LexerGenerator\Regex\Parser.php" 1340 #line 159 "LexerGenerator\Regex\Parser.y" 1341 function yy_r33(){ 1342 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('[^' . $this->yystack[$this->yyidx + -1]->minor->string . ']', array( 1343 'pattern' => '[^' . $this->yystack[$this->yyidx + -1]->minor['pattern'] . ']')); 1344 } 1345 #line 1351 "LexerGenerator\Regex\Parser.php" 1346 #line 163 "LexerGenerator\Regex\Parser.y" 1347 function yy_r34(){ 1348 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('[' . $this->yystack[$this->yyidx + -2]->minor->string . ']' . $this->yystack[$this->yyidx + 0]->minor, array( 1349 'pattern' => '[' . $this->yystack[$this->yyidx + -2]->minor['pattern'] . ']' . $this->yystack[$this->yyidx + 0]->minor)); 1350 } 1351 #line 1357 "LexerGenerator\Regex\Parser.php" 1352 #line 167 "LexerGenerator\Regex\Parser.y" 1353 function yy_r35(){ 1354 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('[^' . $this->yystack[$this->yyidx + -2]->minor->string . ']' . $this->yystack[$this->yyidx + 0]->minor, array( 1355 'pattern' => '[^' . $this->yystack[$this->yyidx + -2]->minor['pattern'] . ']' . $this->yystack[$this->yyidx + 0]->minor)); 1356 } 1357 #line 1363 "LexerGenerator\Regex\Parser.php" 1358 #line 172 "LexerGenerator\Regex\Parser.y" 1359 function yy_r36(){ 1360 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + 0]->minor, array( 1361 'pattern' => $this->yystack[$this->yyidx + 0]->minor)); 1362 } 1363 #line 1369 "LexerGenerator\Regex\Parser.php" 1364 #line 176 "LexerGenerator\Regex\Parser.y" 1365 function yy_r37(){ 1366 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('\\' . $this->yystack[$this->yyidx + 0]->minor, array( 1367 'pattern' => $this->yystack[$this->yyidx + 0]->minor)); 1368 } 1369 #line 1375 "LexerGenerator\Regex\Parser.php" 1370 #line 180 "LexerGenerator\Regex\Parser.y" 1371 function yy_r38(){ 1372 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('\\\\' . $this->yystack[$this->yyidx + 0]->minor, array( 1373 'pattern' => $this->yystack[$this->yyidx + 0]->minor)); 1374 } 1375 #line 1381 "LexerGenerator\Regex\Parser.php" 1376 #line 184 "LexerGenerator\Regex\Parser.y" 1377 function yy_r39(){ 1378 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('\\\\' . $this->yystack[$this->yyidx + -2]->minor . '-\\' . $this->yystack[$this->yyidx + 0]->minor, array( 1379 'pattern' => $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor)); 1380 } 1381 #line 1387 "LexerGenerator\Regex\Parser.php" 1382 #line 188 "LexerGenerator\Regex\Parser.y" 1383 function yy_r40(){ 1384 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('\\' . $this->yystack[$this->yyidx + -2]->minor . '-\\\\' . $this->yystack[$this->yyidx + 0]->minor, array( 1385 'pattern' => $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor)); 1386 } 1387 #line 1393 "LexerGenerator\Regex\Parser.php" 1388 #line 192 "LexerGenerator\Regex\Parser.y" 1389 function yy_r41(){ 1390 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('\\' . $this->yystack[$this->yyidx + -2]->minor . '-\\' . $this->yystack[$this->yyidx + 0]->minor, array( 1391 'pattern' => $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor)); 1392 } 1393 #line 1399 "LexerGenerator\Regex\Parser.php" 1394 #line 196 "LexerGenerator\Regex\Parser.y" 1395 function yy_r42(){ 1396 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('\\\\' . $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor, array( 1397 'pattern' => $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor)); 1398 } 1399 #line 1405 "LexerGenerator\Regex\Parser.php" 1400 #line 200 "LexerGenerator\Regex\Parser.y" 1401 function yy_r43(){ 1402 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('\\' . $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor, array( 1403 'pattern' => $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor)); 1404 } 1405 #line 1411 "LexerGenerator\Regex\Parser.php" 1406 #line 204 "LexerGenerator\Regex\Parser.y" 1407 function yy_r44(){ 1408 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor, array( 1409 'pattern' => $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor)); 1410 } 1411 #line 1417 "LexerGenerator\Regex\Parser.php" 1412 #line 208 "LexerGenerator\Regex\Parser.y" 1413 function yy_r45(){ 1414 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -2]->minor . '-\\' . $this->yystack[$this->yyidx + 0]->minor, array( 1415 'pattern' => $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor)); 1416 } 1417 #line 1423 "LexerGenerator\Regex\Parser.php" 1418 #line 212 "LexerGenerator\Regex\Parser.y" 1419 function yy_r46(){ 1420 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -2]->minor . '-\\\\' . $this->yystack[$this->yyidx + 0]->minor, array( 1421 'pattern' => $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor)); 1422 } 1423 #line 1429 "LexerGenerator\Regex\Parser.php" 1424 #line 216 "LexerGenerator\Regex\Parser.y" 1425 function yy_r47(){ 1426 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -1]->minor->string . '\\' . $this->yystack[$this->yyidx + 0]->minor, array( 1427 'pattern' => $this->yystack[$this->yyidx + -1]->minor['pattern'] . $this->yystack[$this->yyidx + 0]->minor)); 1428 } 1429 #line 1435 "LexerGenerator\Regex\Parser.php" 1430 #line 220 "LexerGenerator\Regex\Parser.y" 1431 function yy_r48(){ 1432 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -1]->minor->string . '\\\\' . $this->yystack[$this->yyidx + 0]->minor, array( 1433 'pattern' => $this->yystack[$this->yyidx + -1]->minor['pattern'] . $this->yystack[$this->yyidx + 0]->minor)); 1434 } 1435 #line 1441 "LexerGenerator\Regex\Parser.php" 1436 #line 224 "LexerGenerator\Regex\Parser.y" 1437 function yy_r49(){ 1438 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -1]->minor->string . $this->yystack[$this->yyidx + 0]->minor, array( 1439 'pattern' => $this->yystack[$this->yyidx + -1]->minor['pattern'] . $this->yystack[$this->yyidx + 0]->minor)); 1440 } 1441 #line 1447 "LexerGenerator\Regex\Parser.php" 1442 #line 228 "LexerGenerator\Regex\Parser.y" 1443 function yy_r50(){ 1444 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -3]->minor->string . '\\' . $this->yystack[$this->yyidx + -2]->minor . '-\\' . $this->yystack[$this->yyidx + 0]->minor, array( 1445 'pattern' => $this->yystack[$this->yyidx + -3]->minor['pattern'] . $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor)); 1446 } 1447 #line 1453 "LexerGenerator\Regex\Parser.php" 1448 #line 232 "LexerGenerator\Regex\Parser.y" 1449 function yy_r51(){ 1450 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -3]->minor->string . '\\\\' . $this->yystack[$this->yyidx + -2]->minor . '-\\' . $this->yystack[$this->yyidx + 0]->minor, array( 1451 'pattern' => $this->yystack[$this->yyidx + -3]->minor['pattern'] . $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor)); 1452 } 1453 #line 1459 "LexerGenerator\Regex\Parser.php" 1454 #line 236 "LexerGenerator\Regex\Parser.y" 1455 function yy_r52(){ 1456 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -3]->minor->string . '\\' . $this->yystack[$this->yyidx + -2]->minor . '-\\\\' . $this->yystack[$this->yyidx + 0]->minor, array( 1457 'pattern' => $this->yystack[$this->yyidx + -3]->minor['pattern'] . $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor)); 1458 } 1459 #line 1465 "LexerGenerator\Regex\Parser.php" 1460 #line 240 "LexerGenerator\Regex\Parser.y" 1461 function yy_r53(){ 1462 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -3]->minor->string . '\\' . $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor, array( 1463 'pattern' => $this->yystack[$this->yyidx + -3]->minor['pattern'] . $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor)); 1464 } 1465 #line 1471 "LexerGenerator\Regex\Parser.php" 1466 #line 244 "LexerGenerator\Regex\Parser.y" 1467 function yy_r54(){ 1468 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -3]->minor->string . '\\\\' . $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor, array( 1469 'pattern' => $this->yystack[$this->yyidx + -3]->minor['pattern'] . $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor)); 1470 } 1471 #line 1477 "LexerGenerator\Regex\Parser.php" 1472 #line 248 "LexerGenerator\Regex\Parser.y" 1473 function yy_r55(){ 1474 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -3]->minor->string . $this->yystack[$this->yyidx + -2]->minor . '-\\' . $this->yystack[$this->yyidx + 0]->minor, array( 1475 'pattern' => $this->yystack[$this->yyidx + -3]->minor['pattern'] . $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor)); 1476 } 1477 #line 1483 "LexerGenerator\Regex\Parser.php" 1478 #line 252 "LexerGenerator\Regex\Parser.y" 1479 function yy_r56(){ 1480 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -3]->minor->string . $this->yystack[$this->yyidx + -2]->minor . '-\\\\' . $this->yystack[$this->yyidx + 0]->minor, array( 1481 'pattern' => $this->yystack[$this->yyidx + -3]->minor['pattern'] . $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor)); 1482 } 1483 #line 1489 "LexerGenerator\Regex\Parser.php" 1484 #line 256 "LexerGenerator\Regex\Parser.y" 1485 function yy_r57(){ 1486 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -3]->minor->string . $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor, array( 1487 'pattern' => $this->yystack[$this->yyidx + -3]->minor['pattern'] . $this->yystack[$this->yyidx + -2]->minor . '-' . $this->yystack[$this->yyidx + 0]->minor)); 1488 } 1489 #line 1495 "LexerGenerator\Regex\Parser.php" 1490 #line 265 "LexerGenerator\Regex\Parser.y" 1491 function yy_r59(){ 1492 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + 0]->minor, array( 1493 'pattern' => $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + 0]->minor)); 1494 } 1495 #line 1501 "LexerGenerator\Regex\Parser.php" 1496 #line 281 "LexerGenerator\Regex\Parser.y" 1497 function yy_r63(){ 1498 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('\\' . $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + 0]->minor, array( 1499 'pattern' => $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + 0]->minor)); 1500 } 1501 #line 1507 "LexerGenerator\Regex\Parser.php" 1502 #line 289 "LexerGenerator\Regex\Parser.y" 1503 function yy_r65(){ 1504 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('\\\\' . $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + 0]->minor, array( 1505 'pattern' => $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + 0]->minor)); 1506 } 1507 #line 1513 "LexerGenerator\Regex\Parser.php" 1508 #line 297 "LexerGenerator\Regex\Parser.y" 1509 function yy_r67(){ 1510 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -2]->minor->string . $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + 0]->minor, array( 1511 'pattern' => $this->yystack[$this->yyidx + -2]->minor['pattern'] . $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + 0]->minor)); 1512 } 1513 #line 1519 "LexerGenerator\Regex\Parser.php" 1514 #line 313 "LexerGenerator\Regex\Parser.y" 1515 function yy_r71(){ 1516 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -2]->minor->string . '\\' . $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + 0]->minor, array( 1517 'pattern' => $this->yystack[$this->yyidx + -2]->minor['pattern'] . $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + 0]->minor)); 1518 } 1519 #line 1525 "LexerGenerator\Regex\Parser.php" 1520 #line 321 "LexerGenerator\Regex\Parser.y" 1521 function yy_r73(){ 1522 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken($this->yystack[$this->yyidx + -2]->minor->string . '\\\\' . $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + 0]->minor, array( 1523 'pattern' => $this->yystack[$this->yyidx + -2]->minor['pattern'] . $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + 0]->minor)); 1524 } 1525 #line 1531 "LexerGenerator\Regex\Parser.php" 1526 #line 326 "LexerGenerator\Regex\Parser.y" 1527 function yy_r74(){ 1528 throw new PHP_LexerGenerator_Exception('Error: cannot set preg options directly with "' . 1529 $this->yystack[$this->yyidx + -2]->minor . $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + 0]->minor . '"'); 1530 } 1531 #line 1537 "LexerGenerator\Regex\Parser.php" 1532 #line 330 "LexerGenerator\Regex\Parser.y" 1533 function yy_r75(){ 1534 throw new PHP_LexerGenerator_Exception('Error: cannot set preg options directly with "' . 1535 $this->yystack[$this->yyidx + -4]->minor . $this->yystack[$this->yyidx + -3]->minor . $this->yystack[$this->yyidx + -2]->minor . $this->yystack[$this->yyidx + -1]->minor['pattern'] . $this->yystack[$this->yyidx + 0]->minor . '"'); 1536 } 1537 #line 1543 "LexerGenerator\Regex\Parser.php" 1538 #line 335 "LexerGenerator\Regex\Parser.y" 1539 function yy_r76(){ 1540 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('(?:' . $this->yystack[$this->yyidx + -1]->minor->string . ')', array( 1541 'pattern' => '(?:' . $this->yystack[$this->yyidx + -1]->minor['pattern'] . ')')); 1542 } 1543 #line 1549 "LexerGenerator\Regex\Parser.php" 1544 #line 339 "LexerGenerator\Regex\Parser.y" 1545 function yy_r77(){ 1546 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('(?:' . $this->yystack[$this->yyidx + -2]->minor->string . ')' . $this->yystack[$this->yyidx + 0]->minor, array( 1547 'pattern' => '(?:' . $this->yystack[$this->yyidx + -2]->minor['pattern'] . ')' . $this->yystack[$this->yyidx + 0]->minor)); 1548 } 1549 #line 1555 "LexerGenerator\Regex\Parser.php" 1550 #line 344 "LexerGenerator\Regex\Parser.y" 1551 function yy_r78(){ 1552 if ($this->yystack[$this->yyidx + -4]->minor != 'R') { 1553 if (!preg_match('/[1-9][0-9]*/', $this->yystack[$this->yyidx + -4]->minor)) { 1554 throw new PHP_LexerGenerator_Exception('Invalid sub-pattern conditional: "(?(' . $this->yystack[$this->yyidx + -4]->minor . ')"'); 1555 } 1556 if ($this->yystack[$this->yyidx + -4]->minor > $this->_subpatterns) { 1557 throw new PHP_LexerGenerator_Exception('sub-pattern conditional . "' . $this->yystack[$this->yyidx + -4]->minor . '" refers to non-existent sub-pattern'); 1558 } 1559 } 1560 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('(?(' . $this->yystack[$this->yyidx + -4]->minor . ')' . $this->yystack[$this->yyidx + -2]->minor->string . ')' . $this->yystack[$this->yyidx + 0]->minor, array( 1561 'pattern' => '(?(' . $this->yystack[$this->yyidx + -4]->minor . ')' . $this->yystack[$this->yyidx + -2]->minor['pattern'] . ')' . $this->yystack[$this->yyidx + 0]->minor)); 1562 } 1563 #line 1569 "LexerGenerator\Regex\Parser.php" 1564 #line 356 "LexerGenerator\Regex\Parser.y" 1565 function yy_r79(){ 1566 if ($this->yystack[$this->yyidx + -3]->minor != 'R') { 1567 if (!preg_match('/[1-9][0-9]*/', $this->yystack[$this->yyidx + -3]->minor)) { 1568 throw new PHP_LexerGenerator_Exception('Invalid sub-pattern conditional: "(?(' . $this->yystack[$this->yyidx + -3]->minor . ')"'); 1569 } 1570 if ($this->yystack[$this->yyidx + -3]->minor > $this->_subpatterns) { 1571 throw new PHP_LexerGenerator_Exception('sub-pattern conditional . "' . $this->yystack[$this->yyidx + -3]->minor . '" refers to non-existent sub-pattern'); 1572 } 1573 } 1574 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('(?(' . $this->yystack[$this->yyidx + -3]->minor . ')' . $this->yystack[$this->yyidx + -1]->minor->string . ')', array( 1575 'pattern' => '(?(' . $this->yystack[$this->yyidx + -3]->minor . ')' . $this->yystack[$this->yyidx + -1]->minor['pattern'] . ')')); 1576 } 1577 #line 1583 "LexerGenerator\Regex\Parser.php" 1578 #line 368 "LexerGenerator\Regex\Parser.y" 1579 function yy_r80(){ 1580 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('(?' . $this->yystack[$this->yyidx + -2]->minor->string . $this->yystack[$this->yyidx + -1]->minor->string . ')', array( 1581 'pattern' => '(?' . $this->yystack[$this->yyidx + -2]->minor['pattern'] . $this->yystack[$this->yyidx + -1]->minor['pattern'] . ')')); 1582 } 1583 #line 1589 "LexerGenerator\Regex\Parser.php" 1584 #line 372 "LexerGenerator\Regex\Parser.y" 1585 function yy_r81(){ 1586 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('(?' . $this->yystack[$this->yyidx + -3]->minor->string . $this->yystack[$this->yyidx + -2]->minor->string . ')' . $this->yystack[$this->yyidx + 0]->minor, array( 1587 'pattern' => '(?' . $this->yystack[$this->yyidx + -3]->minor['pattern'] . $this->yystack[$this->yyidx + -2]->minor['pattern'] . ')' . $this->yystack[$this->yyidx + 0]->minor)); 1588 } 1589 #line 1595 "LexerGenerator\Regex\Parser.php" 1590 #line 376 "LexerGenerator\Regex\Parser.y" 1591 function yy_r82(){ 1592 throw new PHP_LexerGenerator_Exception('Look-behind assertions cannot be used: "(?<=' . 1593 $this->yystack[$this->yyidx + -1]->minor['pattern'] . ')'); 1594 } 1595 #line 1601 "LexerGenerator\Regex\Parser.php" 1596 #line 380 "LexerGenerator\Regex\Parser.y" 1597 function yy_r83(){ 1598 throw new PHP_LexerGenerator_Exception('Look-behind assertions cannot be used: "(?<=' . 1599 $this->yystack[$this->yyidx + -2]->minor['pattern'] . ')'); 1600 } 1601 #line 1607 "LexerGenerator\Regex\Parser.php" 1602 #line 385 "LexerGenerator\Regex\Parser.y" 1603 function yy_r84(){ 1604 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('(?=' . $this->yystack[$this->yyidx + -1]->minor->string . ')', array( 1605 'pattern '=> '(?=' . $this->yystack[$this->yyidx + -1]->minor['pattern'] . ')')); 1606 } 1607 #line 1613 "LexerGenerator\Regex\Parser.php" 1608 #line 389 "LexerGenerator\Regex\Parser.y" 1609 function yy_r85(){ 1610 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('(?!' . $this->yystack[$this->yyidx + -1]->minor->string . ')', array( 1611 'pattern' => '(?!' . $this->yystack[$this->yyidx + -1]->minor['pattern'] . ')')); 1612 } 1613 #line 1619 "LexerGenerator\Regex\Parser.php" 1614 #line 398 "LexerGenerator\Regex\Parser.y" 1615 function yy_r87(){ 1616 throw new PHP_LexerGenerator_Exception('Look-behind assertions cannot be used: "(?<!' . 1617 $this->yystack[$this->yyidx + -1]->minor['pattern'] . ')'); 1618 } 1619 #line 1625 "LexerGenerator\Regex\Parser.php" 1620 #line 403 "LexerGenerator\Regex\Parser.y" 1621 function yy_r88(){ 1622 throw new PHP_LexerGenerator_Exception('Cannot use named sub-patterns: "(' . 1623 $this->yystack[$this->yyidx + -2]->minor['pattern'] . ')'); 1624 } 1625 #line 1631 "LexerGenerator\Regex\Parser.php" 1626 #line 407 "LexerGenerator\Regex\Parser.y" 1627 function yy_r89(){ 1628 throw new PHP_LexerGenerator_Exception('Cannot use named sub-patterns: "(' . 1629 $this->yystack[$this->yyidx + -3]->minor['pattern'] . ')'); 1630 } 1631 #line 1637 "LexerGenerator\Regex\Parser.php" 1632 #line 411 "LexerGenerator\Regex\Parser.y" 1633 function yy_r90(){ 1634 $this->_subpatterns++; 1635 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('(' . $this->yystack[$this->yyidx + -1]->minor->string . ')', array( 1636 'pattern' => '(' . $this->yystack[$this->yyidx + -1]->minor['pattern'] . ')')); 1637 } 1638 #line 1644 "LexerGenerator\Regex\Parser.php" 1639 #line 416 "LexerGenerator\Regex\Parser.y" 1640 function yy_r91(){ 1641 $this->_subpatterns++; 1642 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('(' . $this->yystack[$this->yyidx + -2]->minor->string . ')' . $this->yystack[$this->yyidx + 0]->minor, array( 1643 'pattern' => '(' . $this->yystack[$this->yyidx + -2]->minor['pattern'] . ')' . $this->yystack[$this->yyidx + 0]->minor)); 1644 } 1645 #line 1651 "LexerGenerator\Regex\Parser.php" 1646 #line 422 "LexerGenerator\Regex\Parser.y" 1647 function yy_r92(){ 1648 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('(?>' . $this->yystack[$this->yyidx + -1]->minor->string . ')', array( 1649 'pattern' => '(?>' . $this->yystack[$this->yyidx + -1]->minor['pattern'] . ')')); 1650 } 1651 #line 1657 "LexerGenerator\Regex\Parser.php" 1652 #line 427 "LexerGenerator\Regex\Parser.y" 1653 function yy_r93(){ 1654 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('(' . $this->yystack[$this->yyidx + -1]->minor->string . ')', array( 1655 'pattern' => '(' . $this->yystack[$this->yyidx + -1]->minor['pattern'] . ')')); 1656 } 1657 #line 1663 "LexerGenerator\Regex\Parser.php" 1658 #line 432 "LexerGenerator\Regex\Parser.y" 1659 function yy_r94(){ 1660 $this->_retvalue = new PHP_LexerGenerator_ParseryyToken('(?R)', array( 1661 'pattern' => '(?R)')); 1662 } 1663 #line 1669 "LexerGenerator\Regex\Parser.php" 1664 1665 /** 1666 * placeholder for the left hand side in a reduce operation. 1667 * 1668 * For a parser with a rule like this: 1669 * <pre> 1670 * rule(A) ::= B. { A = 1; } 1671 * </pre> 1672 * 1673 * The parser will translate to something like: 1674 * 1675 * <code> 1676 * function yy_r0(){$this->_retvalue = 1;} 1677 * </code> 1678 */ 1679 private $_retvalue; 1680 1681 /** 1682 * Perform a reduce action and the shift that must immediately 1683 * follow the reduce. 1684 * 1685 * For a rule such as: 1686 * 1687 * <pre> 1688 * A ::= B blah C. { dosomething(); } 1689 * </pre> 1690 * 1691 * This function will first call the action, if any, ("dosomething();" in our 1692 * example), and then it will pop three states from the stack, 1693 * one for each entry on the right-hand side of the expression 1694 * (B, blah, and C in our example rule), and then push the result of the action 1695 * back on to the stack with the resulting state reduced to (as described in the .out 1696 * file) 1697 * @param int Number of the rule by which to reduce 1698 */ 1699 function yy_reduce($yyruleno) 1700 { 1701 //int $yygoto; /* The next state */ 1702 //int $yyact; /* The next action */ 1703 //mixed $yygotominor; /* The LHS of the rule reduced */ 1704 //PHP_LexerGenerator_Regex_yyStackEntry $yymsp; /* The top of the parser's stack */ 1705 //int $yysize; /* Amount to pop the stack */ 1706 $yymsp = $this->yystack[$this->yyidx]; 1707 if (self::$yyTraceFILE && $yyruleno >= 0 1708 && $yyruleno < count(self::$yyRuleName)) { 1709 fprintf(self::$yyTraceFILE, "%sReduce (%d) [%s].\n", 1710 self::$yyTracePrompt, $yyruleno, 1711 self::$yyRuleName[$yyruleno]); 1712 } 1713 1714 $this->_retvalue = $yy_lefthand_side = null; 1715 if (array_key_exists($yyruleno, self::$yyReduceMap)) { 1716 // call the action 1717 $this->_retvalue = null; 1718 $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}(); 1719 $yy_lefthand_side = $this->_retvalue; 1720 } 1721 $yygoto = self::$yyRuleInfo[$yyruleno]['lhs']; 1722 $yysize = self::$yyRuleInfo[$yyruleno]['rhs']; 1723 $this->yyidx -= $yysize; 1724 for($i = $yysize; $i; $i--) { 1725 // pop all of the right-hand side parameters 1726 array_pop($this->yystack); 1727 } 1728 $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto); 1729 if ($yyact < self::YYNSTATE) { 1730 /* If we are not debugging and the reduce action popped at least 1731 ** one element off the stack, then we can push the new element back 1732 ** onto the stack here, and skip the stack overflow test in yy_shift(). 1733 ** That gives a significant speed improvement. */ 1734 if (!self::$yyTraceFILE && $yysize) { 1735 $this->yyidx++; 1736 $x = new PHP_LexerGenerator_Regex_yyStackEntry; 1737 $x->stateno = $yyact; 1738 $x->major = $yygoto; 1739 $x->minor = $yy_lefthand_side; 1740 $this->yystack[$this->yyidx] = $x; 1741 } else { 1742 $this->yy_shift($yyact, $yygoto, $yy_lefthand_side); 1743 } 1744 } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) { 1745 $this->yy_accept(); 1746 } 1747 } 1748 1749 /** 1750 * The following code executes when the parse fails 1751 * 1752 * Code from %parse_fail is inserted here 1753 */ 1754 function yy_parse_failed() 1755 { 1756 if (self::$yyTraceFILE) { 1757 fprintf(self::$yyTraceFILE, "%sFail!\n", self::$yyTracePrompt); 1758 } 1759 while ($this->yyidx >= 0) { 1760 $this->yy_pop_parser_stack(); 1761 } 1762 /* Here code is inserted which will be executed whenever the 1763 ** parser fails */ 1764 } 1765 1766 /** 1767 * The following code executes when a syntax error first occurs. 1768 * 1769 * %syntax_error code is inserted here 1770 * @param int The major type of the error token 1771 * @param mixed The minor type of the error token 1772 */ 1773 function yy_syntax_error($yymajor, $TOKEN) 1774 { 1775 #line 6 "LexerGenerator\Regex\Parser.y" 1776 1777 /* ?><?php */ 1778 // we need to add auto-escaping of all stuff that needs it for result. 1779 // and then validate the original regex only 1780 echo "Syntax Error on line " . $this->_lex->line . ": token '" . 1781 $this->_lex->value . "' while parsing rule:"; 1782 foreach ($this->yystack as $entry) { 1783 echo $this->tokenName($entry->major) . ' '; 1784 } 1785 foreach ($this->yy_get_expected_tokens($yymajor) as $token) { 1786 $expect[] = self::$yyTokenName[$token]; 1787 } 1788 throw new Exception('Unexpected ' . $this->tokenName($yymajor) . '(' . $TOKEN 1789 . '), expected one of: ' . implode(',', $expect)); 1790 #line 1797 "LexerGenerator\Regex\Parser.php" 1791 } 1792 1793 /** 1794 * The following is executed when the parser accepts 1795 * 1796 * %parse_accept code is inserted here 1797 */ 1798 function yy_accept() 1799 { 1800 if (self::$yyTraceFILE) { 1801 fprintf(self::$yyTraceFILE, "%sAccept!\n", self::$yyTracePrompt); 1802 } 1803 while ($this->yyidx >= 0) { 1804 $stack = $this->yy_pop_parser_stack(); 1805 } 1806 /* Here code is inserted which will be executed whenever the 1807 ** parser accepts */ 1808 } 1809 1810 /** 1811 * The main parser program. 1812 * 1813 * The first argument is the major token number. The second is 1814 * the token value string as scanned from the input. 1815 * 1816 * @param int the token number 1817 * @param mixed the token value 1818 * @param mixed any extra arguments that should be passed to handlers 1819 */ 1820 function doParse($yymajor, $yytokenvalue) 1821 { 1822 // $yyact; /* The parser action. */ 1823 // $yyendofinput; /* True if we are at the end of input */ 1824 $yyerrorhit = 0; /* True if yymajor has invoked an error */ 1825 1826 /* (re)initialize the parser, if necessary */ 1827 if ($this->yyidx === null || $this->yyidx < 0) { 1828 /* if ($yymajor == 0) return; // not sure why this was here... */ 1829 $this->yyidx = 0; 1830 $this->yyerrcnt = -1; 1831 $x = new PHP_LexerGenerator_Regex_yyStackEntry; 1832 $x->stateno = 0; 1833 $x->major = 0; 1834 $this->yystack = array(); 1835 array_push($this->yystack, $x); 1836 } 1837 $yyendofinput = ($yymajor==0); 1838 1839 if (self::$yyTraceFILE) { 1840 fprintf(self::$yyTraceFILE, "%sInput %s\n", 1841 self::$yyTracePrompt, self::$yyTokenName[$yymajor]); 1842 } 1843 1844 do { 1845 $yyact = $this->yy_find_shift_action($yymajor); 1846 if ($yymajor < self::YYERRORSYMBOL && 1847 !$this->yy_is_expected_token($yymajor)) { 1848 // force a syntax error 1849 $yyact = self::YY_ERROR_ACTION; 1850 } 1851 if ($yyact < self::YYNSTATE) { 1852 $this->yy_shift($yyact, $yymajor, $yytokenvalue); 1853 $this->yyerrcnt--; 1854 if ($yyendofinput && $this->yyidx >= 0) { 1855 $yymajor = 0; 1856 } else { 1857 $yymajor = self::YYNOCODE; 1858 } 1859 } elseif ($yyact < self::YYNSTATE + self::YYNRULE) { 1860 $this->yy_reduce($yyact - self::YYNSTATE); 1861 } elseif ($yyact == self::YY_ERROR_ACTION) { 1862 if (self::$yyTraceFILE) { 1863 fprintf(self::$yyTraceFILE, "%sSyntax Error!\n", 1864 self::$yyTracePrompt); 1865 } 1866 if (self::YYERRORSYMBOL) { 1867 /* A syntax error has occurred. 1868 ** The response to an error depends upon whether or not the 1869 ** grammar defines an error token "ERROR". 1870 ** 1871 ** This is what we do if the grammar does define ERROR: 1872 ** 1873 ** * Call the %syntax_error function. 1874 ** 1875 ** * Begin popping the stack until we enter a state where 1876 ** it is legal to shift the error symbol, then shift 1877 ** the error symbol. 1878 ** 1879 ** * Set the error count to three. 1880 ** 1881 ** * Begin accepting and shifting new tokens. No new error 1882 ** processing will occur until three tokens have been 1883 ** shifted successfully. 1884 ** 1885 */ 1886 if ($this->yyerrcnt < 0) { 1887 $this->yy_syntax_error($yymajor, $yytokenvalue); 1888 } 1889 $yymx = $this->yystack[$this->yyidx]->major; 1890 if ($yymx == self::YYERRORSYMBOL || $yyerrorhit ){ 1891 if (self::$yyTraceFILE) { 1892 fprintf(self::$yyTraceFILE, "%sDiscard input token %s\n", 1893 self::$yyTracePrompt, self::$yyTokenName[$yymajor]); 1894 } 1895 $this->yy_destructor($yymajor, $yytokenvalue); 1896 $yymajor = self::YYNOCODE; 1897 } else { 1898 while ($this->yyidx >= 0 && 1899 $yymx != self::YYERRORSYMBOL && 1900 ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE 1901 ){ 1902 $this->yy_pop_parser_stack(); 1903 } 1904 if ($this->yyidx < 0 || $yymajor==0) { 1905 $this->yy_destructor($yymajor, $yytokenvalue); 1906 $this->yy_parse_failed(); 1907 $yymajor = self::YYNOCODE; 1908 } elseif ($yymx != self::YYERRORSYMBOL) { 1909 $u2 = 0; 1910 $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2); 1911 } 1912 } 1913 $this->yyerrcnt = 3; 1914 $yyerrorhit = 1; 1915 } else { 1916 /* YYERRORSYMBOL is not defined */ 1917 /* This is what we do if the grammar does not define ERROR: 1918 ** 1919 ** * Report an error message, and throw away the input token. 1920 ** 1921 ** * If the input token is $, then fail the parse. 1922 ** 1923 ** As before, subsequent error messages are suppressed until 1924 ** three input tokens have been successfully shifted. 1925 */ 1926 if ($this->yyerrcnt <= 0) { 1927 $this->yy_syntax_error($yymajor, $yytokenvalue); 1928 } 1929 $this->yyerrcnt = 3; 1930 $this->yy_destructor($yymajor, $yytokenvalue); 1931 if ($yyendofinput) { 1932 $this->yy_parse_failed(); 1933 } 1934 $yymajor = self::YYNOCODE; 1935 } 1936 } else { 1937 $this->yy_accept(); 1938 $yymajor = self::YYNOCODE; 1939 } 1940 } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0); 1941 } 1942 }
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 |