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

Source for file Lexer.php

Documentation is available at Lexer.php

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

Documentation generated on Sun, 02 Jul 2006 08:51:22 -0400 by phpDocumentor 1.3.0