Source for file Lexer.php
Documentation is available at Lexer.php
require_once dirname (__FILE__ ) . '/Parser.php';
class PHP_LexerGenerator_Regex_Lexer
const MATCHSTART = PHP_LexerGenerator_Regex_Parser ::MATCHSTART;
const MATCHEND = PHP_LexerGenerator_Regex_Parser ::MATCHEND;
const CONTROLCHAR = PHP_LexerGenerator_Regex_Parser ::CONTROLCHAR;
const OPENCHARCLASS = PHP_LexerGenerator_Regex_Parser ::OPENCHARCLASS;
const FULLSTOP = PHP_LexerGenerator_Regex_Parser ::FULLSTOP;
const TEXT = PHP_LexerGenerator_Regex_Parser ::TEXT;
const BACKREFERENCE = PHP_LexerGenerator_Regex_Parser ::BACKREFERENCE;
const OPENASSERTION = PHP_LexerGenerator_Regex_Parser ::OPENASSERTION;
const COULDBEBACKREF = PHP_LexerGenerator_Regex_Parser ::COULDBEBACKREF;
const NEGATE = PHP_LexerGenerator_Regex_Parser ::NEGATE;
const HYPHEN = PHP_LexerGenerator_Regex_Parser ::HYPHEN;
const CLOSECHARCLASS = PHP_LexerGenerator_Regex_Parser ::CLOSECHARCLASS;
const BAR = PHP_LexerGenerator_Regex_Parser ::BAR;
const MULTIPLIER = PHP_LexerGenerator_Regex_Parser ::MULTIPLIER;
const INTERNALOPTIONS = PHP_LexerGenerator_Regex_Parser ::INTERNALOPTIONS;
const COLON = PHP_LexerGenerator_Regex_Parser ::COLON;
const OPENPAREN = PHP_LexerGenerator_Regex_Parser ::OPENPAREN;
const CLOSEPAREN = PHP_LexerGenerator_Regex_Parser ::CLOSEPAREN;
const PATTERNNAME = PHP_LexerGenerator_Regex_Parser ::PATTERNNAME;
const POSITIVELOOKBEHIND = PHP_LexerGenerator_Regex_Parser ::POSITIVELOOKBEHIND;
const NEGATIVELOOKBEHIND = PHP_LexerGenerator_Regex_Parser ::NEGATIVELOOKBEHIND;
const POSITIVELOOKAHEAD = PHP_LexerGenerator_Regex_Parser ::POSITIVELOOKAHEAD;
const NEGATIVELOOKAHEAD = PHP_LexerGenerator_Regex_Parser ::NEGATIVELOOKAHEAD;
const ONCEONLY = PHP_LexerGenerator_Regex_Parser ::ONCEONLY;
const COMMENT = PHP_LexerGenerator_Regex_Parser ::COMMENT;
const RECUR = PHP_LexerGenerator_Regex_Parser ::RECUR;
const ESCAPEDBACKSLASH = PHP_LexerGenerator_Regex_Parser ::ESCAPEDBACKSLASH;
function __construct ($data)
$this->yybegin (self ::INITIAL );
private $_yy_stack = array ();
return $this->{'yylex' . $this->_yy_state}();
function yypushstate ($state)
$this->_yy_state = $state;
$this->_yy_state = array_pop($this->_yy_stack);
$this->_yy_state = $state;
if ($this->N >= strlen($this->input)) {
return false; // end of input
$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])|^(\\\\)/";
if (preg_match($yy_global_pattern, substr($this->input, $this->N), $yymatches)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
if (!count($yymatches)) {
throw new Exception ('Error: lexing failed because a rule matched' .
'an empty string. Input "' . substr($this->input,
$this->N, 5 ) . '... state INITIAL');
next($yymatches); // skip global match
$this->token = key($yymatches); // token number
if ($tokenMap[$this->token]) {
// extract sub-patterns for passing to lex function
$yysubmatches = array_slice($yysubmatches, $this->token + 1 ,
$tokenMap[$this->token]);
$this->value = current($yymatches); // token value
$r = $this->{'yy_r1_' . $this->token}($yysubmatches);
$this->N += strlen($this->value);
// process this token in the new state
} elseif ($r === false ) {
$this->N += strlen($this->value);
if ($this->N >= strlen($this->input)) {
return false; // end of input
} else { $yy_yymore_patterns = array (
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])|^(\\\\)",
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)|^(\\))|^(\\$)|^([*?+]|\\{[0-9]+\\}|\\{[0-9]+,\\}|\\{[0-9]+,[0-9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",
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])|^(\\\\)",
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])|^(\\\\)",
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])|^(\\\\)",
20 => "^(\\\\p\\{\\^C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|^(\\\\p[CLMNPSZ])|^(\\\\)",
21 => "^(\\\\p[CLMNPSZ])|^(\\\\)",
if (!strlen($yy_yymore_patterns[$this->token])) {
throw new Exception ('cannot do yymore for the last token');
substr($this->input, $this->N), $yymatches)) {
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
next($yymatches); // skip global match
$this->token = key($yymatches); // token number
$this->value = current($yymatches); // token value
} while ($this->{'yy_r1_' . $this->token}() !== null );
$this->N += strlen($this->value);
throw new Exception ('Unexpected input at line' . $this->line .
': ' . $this->input[$this->N]);
function yy_r1_1 ($yy_subpatterns)
$this->token = self ::ESCAPEDBACKSLASH;
function yy_r1_2 ($yy_subpatterns)
$this->token = self ::TEXT;
function yy_r1_3 ($yy_subpatterns)
$this->token = self ::CONTROLCHAR;
function yy_r1_4 ($yy_subpatterns)
$this->token = self ::OPENCHARCLASS;
$this->yybegin (self ::CHARACTERCLASSSTART );
function yy_r1_5 ($yy_subpatterns)
$this->token = self ::BAR;
function yy_r1_6 ($yy_subpatterns)
$this->token = self ::TEXT;
function yy_r1_7 ($yy_subpatterns)
$this->token = self ::COULDBEBACKREF;
function yy_r1_8 ($yy_subpatterns)
$this->token = self ::CONTROLCHAR;
function yy_r1_9 ($yy_subpatterns)
$this->token = self ::MATCHSTART;
function yy_r1_10 ($yy_subpatterns)
$this->token = self ::MATCHSTART;
function yy_r1_11 ($yy_subpatterns)
$this->token = self ::CLOSEPAREN;
$this->yybegin (self ::INITIAL );
function yy_r1_12 ($yy_subpatterns)
$this->token = self ::MATCHEND;
function yy_r1_13 ($yy_subpatterns)
$this->token = self ::MULTIPLIER;
function yy_r1_14 ($yy_subpatterns)
$this->token = self ::MATCHEND;
function yy_r1_15 ($yy_subpatterns)
$this->token = self ::OPENASSERTION;
$this->yybegin (self ::ASSERTION );
function yy_r1_16 ($yy_subpatterns)
$this->token = self ::OPENPAREN;
function yy_r1_17 ($yy_subpatterns)
$this->token = self ::FULLSTOP;
function yy_r1_18 ($yy_subpatterns)
$this->token = self ::BACKREFERENCE;
function yy_r1_19 ($yy_subpatterns)
$this->token = self ::CONTROLCHAR;
function yy_r1_20 ($yy_subpatterns)
$this->token = self ::CONTROLCHAR;
function yy_r1_21 ($yy_subpatterns)
$this->token = self ::CONTROLCHAR;
function yy_r1_22 ($yy_subpatterns)
$this->token = self ::CONTROLCHAR;
function yy_r1_23 ($yy_subpatterns)
if ($this->N >= strlen($this->input)) {
return false; // end of input
$yy_global_pattern = "/^(\\^)|^(\\])|^(.)/";
if (preg_match($yy_global_pattern, substr($this->input, $this->N), $yymatches)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
if (!count($yymatches)) {
throw new Exception ('Error: lexing failed because a rule matched' .
'an empty string. Input "' . substr($this->input,
$this->N, 5 ) . '... state CHARACTERCLASSSTART');
next($yymatches); // skip global match
$this->token = key($yymatches); // token number
if ($tokenMap[$this->token]) {
// extract sub-patterns for passing to lex function
$yysubmatches = array_slice($yysubmatches, $this->token + 1 ,
$tokenMap[$this->token]);
$this->value = current($yymatches); // token value
$r = $this->{'yy_r2_' . $this->token}($yysubmatches);
$this->N += strlen($this->value);
// process this token in the new state
} elseif ($r === false ) {
$this->N += strlen($this->value);
if ($this->N >= strlen($this->input)) {
return false; // end of input
} else { $yy_yymore_patterns = array (
if (!strlen($yy_yymore_patterns[$this->token])) {
throw new Exception ('cannot do yymore for the last token');
substr($this->input, $this->N), $yymatches)) {
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
next($yymatches); // skip global match
$this->token = key($yymatches); // token number
$this->value = current($yymatches); // token value
} while ($this->{'yy_r2_' . $this->token}() !== null );
$this->N += strlen($this->value);
throw new Exception ('Unexpected input at line' . $this->line .
': ' . $this->input[$this->N]);
const CHARACTERCLASSSTART = 2;
function yy_r2_1 ($yy_subpatterns)
$this->token = self ::NEGATE;
function yy_r2_2 ($yy_subpatterns)
$this->yybegin (self ::CHARACTERCLASS );
$this->token = self ::TEXT;
function yy_r2_3 ($yy_subpatterns)
$this->yybegin (self ::CHARACTERCLASS );
if ($this->N >= strlen($this->input)) {
return false; // end of input
$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])|^(\\\\[]\\.\\-\\^])|^(-(?!]))|^([^\\-\\\\])|^(\\\\)|^(.)/";
if (preg_match($yy_global_pattern, substr($this->input, $this->N), $yymatches)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
if (!count($yymatches)) {
throw new Exception ('Error: lexing failed because a rule matched' .
'an empty string. Input "' . substr($this->input,
$this->N, 5 ) . '... state CHARACTERCLASS');
next($yymatches); // skip global match
$this->token = key($yymatches); // token number
if ($tokenMap[$this->token]) {
// extract sub-patterns for passing to lex function
$yysubmatches = array_slice($yysubmatches, $this->token + 1 ,
$tokenMap[$this->token]);
$this->value = current($yymatches); // token value
$r = $this->{'yy_r3_' . $this->token}($yysubmatches);
$this->N += strlen($this->value);
// process this token in the new state
} elseif ($r === false ) {
$this->N += strlen($this->value);
if ($this->N >= strlen($this->input)) {
return false; // end of input
} else { $yy_yymore_patterns = array (
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])|^(\\\\[]\\.\\-\\^])|^(-(?!]))|^([^\\-\\\\])|^(\\\\)|^(.)",
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])|^(\\\\[]\\.\\-\\^])|^(-(?!]))|^([^\\-\\\\])|^(\\\\)|^(.)",
3 => "^(\\\\[bacedDsSwW0C]|\\\\x\\{[0-9a-fA-F]+\\}|\\\\[0-7][0-7][0-7])|^(\\\\[0-9][0-9])|^(\\\\[1-9])|^(\\\\[]\\.\\-\\^])|^(-(?!]))|^([^\\-\\\\])|^(\\\\)|^(.)",
4 => "^(\\\\[0-9][0-9])|^(\\\\[1-9])|^(\\\\[]\\.\\-\\^])|^(-(?!]))|^([^\\-\\\\])|^(\\\\)|^(.)",
5 => "^(\\\\[1-9])|^(\\\\[]\\.\\-\\^])|^(-(?!]))|^([^\\-\\\\])|^(\\\\)|^(.)",
6 => "^(\\\\[]\\.\\-\\^])|^(-(?!]))|^([^\\-\\\\])|^(\\\\)|^(.)",
7 => "^(-(?!]))|^([^\\-\\\\])|^(\\\\)|^(.)",
8 => "^([^\\-\\\\])|^(\\\\)|^(.)",
if (!strlen($yy_yymore_patterns[$this->token])) {
throw new Exception ('cannot do yymore for the last token');
substr($this->input, $this->N), $yymatches)) {
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
next($yymatches); // skip global match
$this->token = key($yymatches); // token number
$this->value = current($yymatches); // token value
} while ($this->{'yy_r3_' . $this->token}() !== null );
$this->N += strlen($this->value);
throw new Exception ('Unexpected input at line' . $this->line .
': ' . $this->input[$this->N]);
const CHARACTERCLASS = 3;
function yy_r3_1 ($yy_subpatterns)
$this->token = self ::ESCAPEDBACKSLASH;
function yy_r3_2 ($yy_subpatterns)
$this->yybegin (self ::INITIAL );
$this->token = self ::CLOSECHARCLASS;
function yy_r3_3 ($yy_subpatterns)
$this->token = self ::TEXT;
function yy_r3_4 ($yy_subpatterns)
$this->token = self ::CONTROLCHAR;
function yy_r3_5 ($yy_subpatterns)
$this->token = self ::COULDBEBACKREF;
function yy_r3_6 ($yy_subpatterns)
$this->token = self ::BACKREFERENCE;
function yy_r3_7 ($yy_subpatterns)
$this->token = self ::CONTROLCHAR;
function yy_r3_8 ($yy_subpatterns)
$this->token = self ::HYPHEN;
$this->yybegin (self ::RANGE );
function yy_r3_9 ($yy_subpatterns)
$this->token = self ::TEXT;
function yy_r3_10 ($yy_subpatterns)
return false; // ignore escaping of normal text
function yy_r3_11 ($yy_subpatterns)
$this->token = self ::TEXT;
if ($this->N >= strlen($this->input)) {
return false; // end of input
$yy_global_pattern = "/^(\\\\\\\\)|^(\\\\\\])|^(\\\\[bacedDsSwW0C]|\\\\x\\{[0-9a-fA-F]+\\}|\\\\[0-7][0-7][0-7])|^(\\\\[0-9][0-9])|^(\\\\[1-9])|^([^\\-\\\\])|^(\\\\)/";
if (preg_match($yy_global_pattern, substr($this->input, $this->N), $yymatches)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
if (!count($yymatches)) {
throw new Exception ('Error: lexing failed because a rule matched' .
'an empty string. Input "' . substr($this->input,
$this->N, 5 ) . '... state RANGE');
next($yymatches); // skip global match
$this->token = key($yymatches); // token number
if ($tokenMap[$this->token]) {
// extract sub-patterns for passing to lex function
$yysubmatches = array_slice($yysubmatches, $this->token + 1 ,
$tokenMap[$this->token]);
$this->value = current($yymatches); // token value
$r = $this->{'yy_r4_' . $this->token}($yysubmatches);
$this->N += strlen($this->value);
// process this token in the new state
} elseif ($r === false ) {
$this->N += strlen($this->value);
if ($this->N >= strlen($this->input)) {
return false; // end of input
} else { $yy_yymore_patterns = array (
1 => "^(\\\\\\])|^(\\\\[bacedDsSwW0C]|\\\\x\\{[0-9a-fA-F]+\\}|\\\\[0-7][0-7][0-7])|^(\\\\[0-9][0-9])|^(\\\\[1-9])|^([^\\-\\\\])|^(\\\\)",
2 => "^(\\\\[bacedDsSwW0C]|\\\\x\\{[0-9a-fA-F]+\\}|\\\\[0-7][0-7][0-7])|^(\\\\[0-9][0-9])|^(\\\\[1-9])|^([^\\-\\\\])|^(\\\\)",
3 => "^(\\\\[0-9][0-9])|^(\\\\[1-9])|^([^\\-\\\\])|^(\\\\)",
4 => "^(\\\\[1-9])|^([^\\-\\\\])|^(\\\\)",
5 => "^([^\\-\\\\])|^(\\\\)",
if (!strlen($yy_yymore_patterns[$this->token])) {
throw new Exception ('cannot do yymore for the last token');
substr($this->input, $this->N), $yymatches)) {
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
next($yymatches); // skip global match
$this->token = key($yymatches); // token number
$this->value = current($yymatches); // token value
} while ($this->{'yy_r4_' . $this->token}() !== null );
$this->N += strlen($this->value);
throw new Exception ('Unexpected input at line' . $this->line .
': ' . $this->input[$this->N]);
function yy_r4_1 ($yy_subpatterns)
$this->token = self ::ESCAPEDBACKSLASH;
function yy_r4_2 ($yy_subpatterns)
$this->token = self ::TEXT;
$this->yybegin (self ::CHARACTERCLASS );
function yy_r4_3 ($yy_subpatterns)
$this->token = self ::CONTROLCHAR;
$this->yybegin (self ::CHARACTERCLASS );
function yy_r4_4 ($yy_subpatterns)
$this->token = self ::COULDBEBACKREF;
function yy_r4_5 ($yy_subpatterns)
$this->token = self ::BACKREFERENCE;
function yy_r4_6 ($yy_subpatterns)
$this->token = self ::TEXT;
$this->yybegin (self ::CHARACTERCLASS );
function yy_r4_7 ($yy_subpatterns)
return false; // ignore escaping of normal text
if ($this->N >= strlen($this->input)) {
return false; // end of input
$yy_global_pattern = "/^([imsxUX]+-[imsxUX]+|[imsxUX]+|-[imsxUX]+)|^(:)|^(\\))|^(P<[^>]+>)|^(<=)|^(<!)|^(=)|^(!)|^(>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)/";
if (preg_match($yy_global_pattern, substr($this->input, $this->N), $yymatches)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
if (!count($yymatches)) {
throw new Exception ('Error: lexing failed because a rule matched' .
'an empty string. Input "' . substr($this->input,
$this->N, 5 ) . '... state ASSERTION');
next($yymatches); // skip global match
$this->token = key($yymatches); // token number
if ($tokenMap[$this->token]) {
// extract sub-patterns for passing to lex function
$yysubmatches = array_slice($yysubmatches, $this->token + 1 ,
$tokenMap[$this->token]);
$this->value = current($yymatches); // token value
$r = $this->{'yy_r5_' . $this->token}($yysubmatches);
$this->N += strlen($this->value);
// process this token in the new state
} elseif ($r === false ) {
$this->N += strlen($this->value);
if ($this->N >= strlen($this->input)) {
return false; // end of input
} else { $yy_yymore_patterns = array (
1 => "^(:)|^(\\))|^(P<[^>]+>)|^(<=)|^(<!)|^(=)|^(!)|^(>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)",
2 => "^(\\))|^(P<[^>]+>)|^(<=)|^(<!)|^(=)|^(!)|^(>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)",
3 => "^(P<[^>]+>)|^(<=)|^(<!)|^(=)|^(!)|^(>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)",
4 => "^(<=)|^(<!)|^(=)|^(!)|^(>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)",
5 => "^(<!)|^(=)|^(!)|^(>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)",
6 => "^(=)|^(!)|^(>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)",
7 => "^(!)|^(>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)",
8 => "^(>)|^(\\(\\?)|^(#[^)]+)|^(R)|^(.)",
9 => "^(\\(\\?)|^(#[^)]+)|^(R)|^(.)",
10 => "^(#[^)]+)|^(R)|^(.)",
if (!strlen($yy_yymore_patterns[$this->token])) {
throw new Exception ('cannot do yymore for the last token');
substr($this->input, $this->N), $yymatches)) {
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
next($yymatches); // skip global match
$this->token = key($yymatches); // token number
$this->value = current($yymatches); // token value
} while ($this->{'yy_r5_' . $this->token}() !== null );
$this->N += strlen($this->value);
throw new Exception ('Unexpected input at line' . $this->line .
': ' . $this->input[$this->N]);
function yy_r5_1 ($yy_subpatterns)
$this->token = self ::INTERNALOPTIONS;
function yy_r5_2 ($yy_subpatterns)
$this->token = self ::COLON;
$this->yybegin (self ::INITIAL );
function yy_r5_3 ($yy_subpatterns)
$this->token = self ::CLOSEPAREN;
$this->yybegin (self ::INITIAL );
function yy_r5_4 ($yy_subpatterns)
$this->token = self ::PATTERNNAME;
$this->yybegin (self ::INITIAL );
function yy_r5_5 ($yy_subpatterns)
$this->token = self ::POSITIVELOOKBEHIND;
$this->yybegin (self ::INITIAL );
function yy_r5_6 ($yy_subpatterns)
$this->token = self ::NEGATIVELOOKBEHIND;
$this->yybegin (self ::INITIAL );
function yy_r5_7 ($yy_subpatterns)
$this->token = self ::POSITIVELOOKAHEAD;
$this->yybegin (self ::INITIAL );
function yy_r5_8 ($yy_subpatterns)
$this->token = self ::NEGATIVELOOKAHEAD;
$this->yybegin (self ::INITIAL );
function yy_r5_9 ($yy_subpatterns)
$this->token = self ::ONCEONLY;
$this->yybegin (self ::INITIAL );
function yy_r5_10 ($yy_subpatterns)
$this->token = self ::OPENASSERTION;
function yy_r5_11 ($yy_subpatterns)
$this->token = self ::COMMENT;
$this->yybegin (self ::INITIAL );
function yy_r5_12 ($yy_subpatterns)
$this->token = self ::RECUR;
function yy_r5_13 ($yy_subpatterns)
$this->yybegin (self ::INITIAL );
Documentation generated on Mon, 11 Mar 2019 14:46:12 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|