Source for file Lexer.php
Documentation is available at Lexer.php
require_once 'PHP/LexerGenerator/Regex/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)
function reset ($data, $line)
// passed in from parent parser
$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 = '/\G(\\\\\\\\)|\G([^[\\\\^$.|()?*+{}]+)|\G(\\\\[][{}*.^$|?()+])|\G(\\[)|\G(\\|)|\G(\\\\[frnt]|\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7][0-7][0-7]|\\\\x\\{[0-9a-fA-F]+\\})|\G(\\\\[0-9][0-9])|\G(\\\\[abBGcedDsSwW0C]|\\\\c\\\\)|\G(\\^)|\G(\\\\A)|\G(\\))|\G(\\$)|\G(\\*\\?|\\+\\?|[*?+]|\\{[0-9]+\\}|\\{[0-9]+,\\}|\\{[0-9]+,[0-9]+\\})|\G(\\\\[zZ])|\G(\\(\\?)|\G(\\()|\G(\\.)|\G(\\\\[1-9])|\G(\\\\p\\{\\^?..?\\}|\\\\P\\{..?\\}|\\\\X)|\G(\\\\p\\{C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p\\{\\^C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p[CLMNPSZ])|\G(\\\\)/';
if (preg_match($yy_global_pattern,$this->input, $yymatches, null , $this->N)) {
$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
$yy_yymore_patterns = array (
1 => array (0 , "\G([^[\\\\^$.|()?*+{}]+)|\G(\\\\[][{}*.^$|?()+])|\G(\\[)|\G(\\|)|\G(\\\\[frnt]|\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7][0-7][0-7]|\\\\x\\{[0-9a-fA-F]+\\})|\G(\\\\[0-9][0-9])|\G(\\\\[abBGcedDsSwW0C]|\\\\c\\\\)|\G(\\^)|\G(\\\\A)|\G(\\))|\G(\\$)|\G(\\*\\?|\\+\\?|[*?+]|\\{[0-9]+\\}|\\{[0-9]+,\\}|\\{[0-9]+,[0-9]+\\})|\G(\\\\[zZ])|\G(\\(\\?)|\G(\\()|\G(\\.)|\G(\\\\[1-9])|\G(\\\\p\\{\\^?..?\\}|\\\\P\\{..?\\}|\\\\X)|\G(\\\\p\\{C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p\\{\\^C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p[CLMNPSZ])|\G(\\\\)"),
2 => array (0 , "\G(\\\\[][{}*.^$|?()+])|\G(\\[)|\G(\\|)|\G(\\\\[frnt]|\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7][0-7][0-7]|\\\\x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cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p\\{\\^C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p[CLMNPSZ])|\G(\\\\)"),
15 => array (0 , "\G(\\()|\G(\\.)|\G(\\\\[1-9])|\G(\\\\p\\{\\^?..?\\}|\\\\P\\{..?\\}|\\\\X)|\G(\\\\p\\{C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p\\{\\^C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p[CLMNPSZ])|\G(\\\\)"),
16 => array (0 , "\G(\\.)|\G(\\\\[1-9])|\G(\\\\p\\{\\^?..?\\}|\\\\P\\{..?\\}|\\\\X)|\G(\\\\p\\{C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p\\{\\^C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p[CLMNPSZ])|\G(\\\\)"),
17 => array (0 , "\G(\\\\[1-9])|\G(\\\\p\\{\\^?..?\\}|\\\\P\\{..?\\}|\\\\X)|\G(\\\\p\\{C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p\\{\\^C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p[CLMNPSZ])|\G(\\\\)"),
18 => array (0 , "\G(\\\\p\\{\\^?..?\\}|\\\\P\\{..?\\}|\\\\X)|\G(\\\\p\\{C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p\\{\\^C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p[CLMNPSZ])|\G(\\\\)"),
19 => array (0 , "\G(\\\\p\\{C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p\\{\\^C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p[CLMNPSZ])|\G(\\\\)"),
20 => array (0 , "\G(\\\\p\\{\\^C[cfnos]?|L[lmotu]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?\\})|\G(\\\\p[CLMNPSZ])|\G(\\\\)"),
21 => array (0 , "\G(\\\\p[CLMNPSZ])|\G(\\\\)"),
22 => array (0 , "\G(\\\\)"),
if (!strlen($yy_yymore_patterns[$this->token][1 ])) {
throw new Exception ('cannot do yymore for the last token');
if (preg_match('/' . $yy_yymore_patterns[$this->token][1 ] . '/',
$this->input, $yymatches, null , $this->N)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
next($yymatches); // skip global match
$this->token += key($yymatches) + $yy_yymore_patterns[$this->token][0 ]; // token number
$this->value = current($yymatches); // token value
if ($tokenMap[$this->token]) {
// extract sub-patterns for passing to lex function
$yysubmatches = array_slice($yysubmatches, $this->token + 1 ,
$tokenMap[$this->token]);
$r = $this->{'yy_r1_' . $this->token}($yysubmatches);
} while ($r !== null && !is_bool($r));
// 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
$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 = '/\G(\\^)|\G(\\])|\G(.)/';
if (preg_match($yy_global_pattern,$this->input, $yymatches, null , $this->N)) {
$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
$yy_yymore_patterns = array (
1 => array (0 , "\G(\\])|\G(.)"),
if (!strlen($yy_yymore_patterns[$this->token][1 ])) {
throw new Exception ('cannot do yymore for the last token');
if (preg_match('/' . $yy_yymore_patterns[$this->token][1 ] . '/',
$this->input, $yymatches, null , $this->N)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
next($yymatches); // skip global match
$this->token += key($yymatches) + $yy_yymore_patterns[$this->token][0 ]; // token number
$this->value = current($yymatches); // token value
if ($tokenMap[$this->token]) {
// extract sub-patterns for passing to lex function
$yysubmatches = array_slice($yysubmatches, $this->token + 1 ,
$tokenMap[$this->token]);
$r = $this->{'yy_r2_' . $this->token}($yysubmatches);
} while ($r !== null && !is_bool($r));
// 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
$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 = '/\G(\\\\\\\\)|\G(\\])|\G(\\\\[frnt]|\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7][0-7][0-7]|\\\\x\\{[0-9a-fA-F]+\\})|\G(\\\\[bacedDsSwW0C]|\\\\c\\\\|\\\\x\\{[0-9a-fA-F]+\\}|\\\\[0-7][0-7][0-7]|\\\\x[0-9a-fA-F][0-9a-fA-F]?)|\G(\\\\[0-9][0-9])|\G(\\\\[1-9])|\G(\\\\[]\.\-\^])|\G(-(?!]))|\G([^\-\\\\])|\G(\\\\)|\G(.)/';
if (preg_match($yy_global_pattern,$this->input, $yymatches, null , $this->N)) {
$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
$yy_yymore_patterns = array (
1 => array (0 , "\G(\\])|\G(\\\\[frnt]|\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7][0-7][0-7]|\\\\x\\{[0-9a-fA-F]+\\})|\G(\\\\[bacedDsSwW0C]|\\\\c\\\\|\\\\x\\{[0-9a-fA-F]+\\}|\\\\[0-7][0-7][0-7]|\\\\x[0-9a-fA-F][0-9a-fA-F]?)|\G(\\\\[0-9][0-9])|\G(\\\\[1-9])|\G(\\\\[]\.\-\^])|\G(-(?!]))|\G([^\-\\\\])|\G(\\\\)|\G(.)"),
2 => array (0 , "\G(\\\\[frnt]|\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7][0-7][0-7]|\\\\x\\{[0-9a-fA-F]+\\})|\G(\\\\[bacedDsSwW0C]|\\\\c\\\\|\\\\x\\{[0-9a-fA-F]+\\}|\\\\[0-7][0-7][0-7]|\\\\x[0-9a-fA-F][0-9a-fA-F]?)|\G(\\\\[0-9][0-9])|\G(\\\\[1-9])|\G(\\\\[]\.\-\^])|\G(-(?!]))|\G([^\-\\\\])|\G(\\\\)|\G(.)"),
3 => array (0 , "\G(\\\\[bacedDsSwW0C]|\\\\c\\\\|\\\\x\\{[0-9a-fA-F]+\\}|\\\\[0-7][0-7][0-7]|\\\\x[0-9a-fA-F][0-9a-fA-F]?)|\G(\\\\[0-9][0-9])|\G(\\\\[1-9])|\G(\\\\[]\.\-\^])|\G(-(?!]))|\G([^\-\\\\])|\G(\\\\)|\G(.)"),
4 => array (0 , "\G(\\\\[0-9][0-9])|\G(\\\\[1-9])|\G(\\\\[]\.\-\^])|\G(-(?!]))|\G([^\-\\\\])|\G(\\\\)|\G(.)"),
5 => array (0 , "\G(\\\\[1-9])|\G(\\\\[]\.\-\^])|\G(-(?!]))|\G([^\-\\\\])|\G(\\\\)|\G(.)"),
6 => array (0 , "\G(\\\\[]\.\-\^])|\G(-(?!]))|\G([^\-\\\\])|\G(\\\\)|\G(.)"),
7 => array (0 , "\G(-(?!]))|\G([^\-\\\\])|\G(\\\\)|\G(.)"),
8 => array (0 , "\G([^\-\\\\])|\G(\\\\)|\G(.)"),
9 => array (0 , "\G(\\\\)|\G(.)"),
if (!strlen($yy_yymore_patterns[$this->token][1 ])) {
throw new Exception ('cannot do yymore for the last token');
if (preg_match('/' . $yy_yymore_patterns[$this->token][1 ] . '/',
$this->input, $yymatches, null , $this->N)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
next($yymatches); // skip global match
$this->token += key($yymatches) + $yy_yymore_patterns[$this->token][0 ]; // token number
$this->value = current($yymatches); // token value
if ($tokenMap[$this->token]) {
// extract sub-patterns for passing to lex function
$yysubmatches = array_slice($yysubmatches, $this->token + 1 ,
$tokenMap[$this->token]);
$r = $this->{'yy_r3_' . $this->token}($yysubmatches);
} while ($r !== null && !is_bool($r));
// 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
$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 ::TEXT;
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 ::TEXT;
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 = '/\G(\\\\\\\\)|\G(\\\\\\])|\G(\\\\[bacedDsSwW0C]|\\\\c\\\\|\\\\x\\{[0-9a-fA-F]+\\}|\\\\[0-7][0-7][0-7]|\\\\x[0-9a-fA-F][0-9a-fA-F]?)|\G(\\\\[0-9][0-9])|\G(\\\\[1-9])|\G([^\-\\\\])|\G(\\\\)/';
if (preg_match($yy_global_pattern,$this->input, $yymatches, null , $this->N)) {
$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
$yy_yymore_patterns = array (
1 => array (0 , "\G(\\\\\\])|\G(\\\\[bacedDsSwW0C]|\\\\c\\\\|\\\\x\\{[0-9a-fA-F]+\\}|\\\\[0-7][0-7][0-7]|\\\\x[0-9a-fA-F][0-9a-fA-F]?)|\G(\\\\[0-9][0-9])|\G(\\\\[1-9])|\G([^\-\\\\])|\G(\\\\)"),
2 => array (0 , "\G(\\\\[bacedDsSwW0C]|\\\\c\\\\|\\\\x\\{[0-9a-fA-F]+\\}|\\\\[0-7][0-7][0-7]|\\\\x[0-9a-fA-F][0-9a-fA-F]?)|\G(\\\\[0-9][0-9])|\G(\\\\[1-9])|\G([^\-\\\\])|\G(\\\\)"),
3 => array (0 , "\G(\\\\[0-9][0-9])|\G(\\\\[1-9])|\G([^\-\\\\])|\G(\\\\)"),
4 => array (0 , "\G(\\\\[1-9])|\G([^\-\\\\])|\G(\\\\)"),
5 => array (0 , "\G([^\-\\\\])|\G(\\\\)"),
6 => array (0 , "\G(\\\\)"),
if (!strlen($yy_yymore_patterns[$this->token][1 ])) {
throw new Exception ('cannot do yymore for the last token');
if (preg_match('/' . $yy_yymore_patterns[$this->token][1 ] . '/',
$this->input, $yymatches, null , $this->N)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
next($yymatches); // skip global match
$this->token += key($yymatches) + $yy_yymore_patterns[$this->token][0 ]; // token number
$this->value = current($yymatches); // token value
if ($tokenMap[$this->token]) {
// extract sub-patterns for passing to lex function
$yysubmatches = array_slice($yysubmatches, $this->token + 1 ,
$tokenMap[$this->token]);
$r = $this->{'yy_r4_' . $this->token}($yysubmatches);
} while ($r !== null && !is_bool($r));
// 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
$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 ::TEXT;
$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 = '/\G([imsxUX]+-[imsxUX]+|[imsxUX]+|-[imsxUX]+)|\G(:)|\G(\\))|\G(P<[^>]+>)|\G(<=)|\G(<!)|\G(=)|\G(!)|\G(>)|\G(\\(\\?)|\G(#[^)]+)|\G(R)|\G(.)/';
if (preg_match($yy_global_pattern,$this->input, $yymatches, null , $this->N)) {
$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
$yy_yymore_patterns = array (
1 => array (0 , "\G(:)|\G(\\))|\G(P<[^>]+>)|\G(<=)|\G(<!)|\G(=)|\G(!)|\G(>)|\G(\\(\\?)|\G(#[^)]+)|\G(R)|\G(.)"),
2 => array (0 , "\G(\\))|\G(P<[^>]+>)|\G(<=)|\G(<!)|\G(=)|\G(!)|\G(>)|\G(\\(\\?)|\G(#[^)]+)|\G(R)|\G(.)"),
3 => array (0 , "\G(P<[^>]+>)|\G(<=)|\G(<!)|\G(=)|\G(!)|\G(>)|\G(\\(\\?)|\G(#[^)]+)|\G(R)|\G(.)"),
4 => array (0 , "\G(<=)|\G(<!)|\G(=)|\G(!)|\G(>)|\G(\\(\\?)|\G(#[^)]+)|\G(R)|\G(.)"),
5 => array (0 , "\G(<!)|\G(=)|\G(!)|\G(>)|\G(\\(\\?)|\G(#[^)]+)|\G(R)|\G(.)"),
6 => array (0 , "\G(=)|\G(!)|\G(>)|\G(\\(\\?)|\G(#[^)]+)|\G(R)|\G(.)"),
7 => array (0 , "\G(!)|\G(>)|\G(\\(\\?)|\G(#[^)]+)|\G(R)|\G(.)"),
8 => array (0 , "\G(>)|\G(\\(\\?)|\G(#[^)]+)|\G(R)|\G(.)"),
9 => array (0 , "\G(\\(\\?)|\G(#[^)]+)|\G(R)|\G(.)"),
10 => array (0 , "\G(#[^)]+)|\G(R)|\G(.)"),
11 => array (0 , "\G(R)|\G(.)"),
if (!strlen($yy_yymore_patterns[$this->token][1 ])) {
throw new Exception ('cannot do yymore for the last token');
if (preg_match('/' . $yy_yymore_patterns[$this->token][1 ] . '/',
$this->input, $yymatches, null , $this->N)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
next($yymatches); // skip global match
$this->token += key($yymatches) + $yy_yymore_patterns[$this->token][0 ]; // token number
$this->value = current($yymatches); // token value
if ($tokenMap[$this->token]) {
// extract sub-patterns for passing to lex function
$yysubmatches = array_slice($yysubmatches, $this->token + 1 ,
$tokenMap[$this->token]);
$r = $this->{'yy_r5_' . $this->token}($yysubmatches);
} while ($r !== null && !is_bool($r));
// 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
$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 15:40:40 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|