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

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