コード例 #1
0
ファイル: XHPASTTree.php プロジェクト: rwray/libphutil
 public function __construct(array $tree, array $stream, $source)
 {
     $this->setTreeType('XHP');
     $this->setNodeConstants(xhp_parser_node_constants());
     $this->setTokenConstants(xhpast_parser_token_constants());
     parent::__construct($tree, $stream, $source);
 }
コード例 #2
0
ファイル: XHPASTNode.php プロジェクト: rmoorman/libphutil
 protected function getTypeIDFromTypeName($type_name)
 {
     static $node_types;
     if (empty($node_types)) {
         $node_types = xhp_parser_node_constants();
         $node_types = array_flip($node_types);
     }
     if (empty($node_types[$type_name])) {
         throw new Exception("Unknown XHPAST Node type name '{$type_name}'!");
     }
     return $node_types[$type_name];
 }