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

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