Source for file ProtoLexer.php
Documentation is available at ProtoLexer.php
class CodeGen_PECL_Tools_ProtoLexer
function __construct ($data)
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->count >= strlen($this->data)) {
return false; // end of input
$yy_global_pattern = "/^([ \t\n]+)|^(\\()|^(\\))|^(\\[)|^(\\])|^(=)|^(,)|^(;)|^(\\.\\.\\.)|^([&@])|^([_a-zA-Z][_a-zA-Z0-9]*)|^(\"[^\"]*\"|'[^']*')|^([0-9]*(\\.[0-9]+)?([eE][+-]?[0-9]+)?)|^([+-]?[0-9]+)|^(0x[0-9a-fA-F]+)/";
if (preg_match($yy_global_pattern, substr($this->data, $this->count), $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->data,
$this->count, 5 ) . '... state 1');
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->count += strlen($this->value);
// process this token in the new state
} elseif ($r === false ) {
$this->count += strlen($this->value);
if ($this->count >= strlen($this->data)) {
return false; // end of input
} else { $yy_yymore_patterns = array (
1 => "^(\\()|^(\\))|^(\\[)|^(\\])|^(=)|^(,)|^(;)|^(\\.\\.\\.)|^([&@])|^([_a-zA-Z][_a-zA-Z0-9]*)|^(\"[^\"]*\"|'[^']*')|^([0-9]*(\\.[0-9]+)?([eE][+-]?[0-9]+)?)|^([+-]?[0-9]+)|^(0x[0-9a-fA-F]+)",
2 => "^(\\))|^(\\[)|^(\\])|^(=)|^(,)|^(;)|^(\\.\\.\\.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-9a-fA-F]+)",
9 => "^([&@])|^([_a-zA-Z][_a-zA-Z0-9]*)|^(\"[^\"]*\"|'[^']*')|^([0-9]*(\\.[0-9]+)?([eE][+-]?[0-9]+)?)|^([+-]?[0-9]+)|^(0x[0-9a-fA-F]+)",
10 => "^([_a-zA-Z][_a-zA-Z0-9]*)|^(\"[^\"]*\"|'[^']*')|^([0-9]*(\\.[0-9]+)?([eE][+-]?[0-9]+)?)|^([+-]?[0-9]+)|^(0x[0-9a-fA-F]+)",
11 => "^(\"[^\"]*\"|'[^']*')|^([0-9]*(\\.[0-9]+)?([eE][+-]?[0-9]+)?)|^([+-]?[0-9]+)|^(0x[0-9a-fA-F]+)",
12 => "^([0-9]*(\\.[0-9]+)?([eE][+-]?[0-9]+)?)|^([+-]?[0-9]+)|^(0x[0-9a-fA-F]+)",
13 => "^([+-]?[0-9]+)|^(0x[0-9a-fA-F]+)",
16 => "^(0x[0-9a-fA-F]+)",
if (!strlen($yy_yymore_patterns[$this->token])) {
throw new Exception ('cannot do yymore for the last token');
substr($this->data, $this->count), $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->count += strlen($this->value);
throw new Exception ('Unexpected input at line' . $this->line .
': ' . $this->data[$this->count]);
function yy_r1_1 ($yy_subpatterns)
function yy_r1_2 ($yy_subpatterns)
$this->token = CodeGen_PECL_Tools_ProtoParser ::PAR_OPEN;
function yy_r1_3 ($yy_subpatterns)
$this->token = CodeGen_PECL_Tools_ProtoParser ::PAR_CLOSE;
function yy_r1_4 ($yy_subpatterns)
$this->token = CodeGen_PECL_Tools_ProtoParser ::SQUARE_OPEN;
function yy_r1_5 ($yy_subpatterns)
$this->token = CodeGen_PECL_Tools_ProtoParser ::SQUARE_CLOSE;
function yy_r1_6 ($yy_subpatterns)
$this->token = CodeGen_PECL_Tools_ProtoParser ::EQ;
function yy_r1_7 ($yy_subpatterns)
$this->token = CodeGen_PECL_Tools_ProtoParser ::COMMA;
function yy_r1_8 ($yy_subpatterns)
$this->token = CodeGen_PECL_Tools_ProtoParser ::SEMICOLON;
function yy_r1_9 ($yy_subpatterns)
$this->token = CodeGen_PECL_Tools_ProtoParser ::ELLIPSE;
function yy_r1_10 ($yy_subpatterns)
$this->token = CodeGen_PECL_Tools_ProtoParser ::AMPERSAND;
function yy_r1_11 ($yy_subpatterns)
$this->token = CodeGen_PECL_Tools_ProtoParser ::VOID;
$this->token = CodeGen_PECL_Tools_ProtoParser ::BOOL;
$this->token = CodeGen_PECL_Tools_ProtoParser ::INT;
$this->token = CodeGen_PECL_Tools_ProtoParser ::FLOAT;
$this->token = CodeGen_PECL_Tools_ProtoParser ::STRING;
$this->token = CodeGen_PECL_Tools_ProtoParser ::ARRAY_;
$this->token = CodeGen_PECL_Tools_ProtoParser ::CLASS_;
$this->token = CodeGen_PECL_Tools_ProtoParser ::RESOURCE;
$this->token = CodeGen_PECL_Tools_ProtoParser ::MIXED;
$this->token = CodeGen_PECL_Tools_ProtoParser ::CALLBACK;
$this->token = CodeGen_PECL_Tools_ProtoParser ::STREAM;
$this->token = CodeGen_PECL_Tools_ProtoParser ::TRUE_;
$this->token = CodeGen_PECL_Tools_ProtoParser ::FALSE_;
$this->token = CodeGen_PECL_Tools_ProtoParser ::NULL_;
$this->token = CodeGen_PECL_Tools_ProtoParser ::NAME;
function yy_r1_12 ($yy_subpatterns)
$this->token = CodeGen_PECL_Tools_ProtoParser ::STRVAL;
function yy_r1_13 ($yy_subpatterns)
$this->token = CodeGen_PECL_Tools_ProtoParser ::NUMVAL;
function yy_r1_16 ($yy_subpatterns)
$this->token = CodeGen_PECL_Tools_ProtoParser ::NUMVAL;
function yy_r1_17 ($yy_subpatterns)
$this->token = CodeGen_PECL_Tools_ProtoParser ::NUMVAL;
Documentation generated on Mon, 11 Mar 2019 14:44:25 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|