Ejemplo n.º 1
0
 protected static function parse(&$source)
 {
     global $yydebug;
     if (!self::$tokenizer) {
         self::$tokenizer = new phpParserTokenizer();
     }
     self::$tokenizer->setSource($source);
     self::$tokenizer->debug = $yydebug;
     return yyparse();
 }
Ejemplo n.º 2
0
 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;
     }
 }