예제 #1
0
파일: phpParser.php 프로젝트: hnw/phpbugs
 protected static function parse(&$source)
 {
     global $yydebug;
     if (!self::$tokenizer) {
         self::$tokenizer = new phpParserTokenizer();
     }
     self::$tokenizer->setSource($source);
     self::$tokenizer->debug = $yydebug;
     return yyparse();
 }
예제 #2
0
파일: php425.php 프로젝트: hnw/php425
 protected function &migrate(&$source, $format)
 {
     switch ($format) {
         case 'nodes':
             return phpParser::toNodes($source);
         case 'string':
             return phpParser::toString($source);
         case 'terminals':
             return phpParser::toTerminals($source);
         case 'tokens':
             return phpParser::toTokens($source);
         case 'tree':
             return phpParser::toTree($source);
         default:
             return false;
     }
 }