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

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