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

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