PHP_LexerGenerator
[ class tree: PHP_LexerGenerator ] [ index: PHP_LexerGenerator ] [ all elements ]

Source for file Parser.php

Documentation is available at Parser.php

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

Documentation generated on Mon, 11 Mar 2019 14:46:15 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.