}
    function yy_r1_5($yy_subpatterns)
    {
        $this->token = CodeGen_PECL_Tools_ProtoParser::SEMICOLON;
    }
    function yy_r1_6($yy_subpatterns)
    {
        $this->token = CodeGen_PECL_Tools_ProtoParser::VOID;
    }
    function yy_r1_7($yy_subpatterns)
    {
        $this->token = CodeGen_PECL_Tools_ProtoParser::BOOL;
    }
    function yy_r1_8($yy_subpatterns)
    {
        $this->token = CodeGen_PECL_Tools_ProtoParser::NUMVAL;
    }
    function yy_r1_9($yy_subpatterns)
    {
        $this->token = CodeGen_PECL_Tools_ProtoParser::STRVAL;
    }
}
$a = new CodeGen_PECL_Tools_ProtoLexer('booler boolboolean boolean bool');
$a->yylex();
var_dump('advance: ' . $a->value);
$a->yylex();
var_dump('advance: ' . $a->value);
$a->yylex();
var_dump('advance: ' . $a->value);
$a->yylex();
var_dump('advance: ' . $a->value);
示例#2
0
 /**
  * Set parameter and return value information from PHP style prototype
  *
  * new (and hopefully final) version using a PHP_LexerGenerator and
  * PHP_ParserGenerator generated prototype parser
  *
  * @param  string  PHP style prototype
  * @param  object  Extension object owning this function
  * @return bool    Success status
  */
 protected function newSetProto2($proto, $extension)
 {
     try {
         $lex = new CodeGen_PECL_Tools_ProtoLexer($proto);
         $parser = new CodeGen_PECL_Tools_ProtoParser($extension, $this);
         while ($lex->yylex()) {
             $parser->doParse($lex->token, $lex->value);
         }
         $parser->doParse(0, 0);
     } catch (Exception $e) {
         return PEAR::raiseError($e->getMessage());
     }
 }