original_string: public function getAst(Node\Node $b, $path = '')
      {
          $ret = array(
              'type' => str_replace('Zicht\Tool\Script\Node\\', '', get_class($b))
          );
          if ($b instanceof Node\Branch) {
              if (count($b->nodes)) {
                  $ret['nodes'] = array();
  
                  foreach ($b->nodes as $n) {
                      if (null === $n) {
                          $ret['nodes'][] = $n;
                      } else {
                          if (!$n instanceof Node\Node) {
                              throw new \InvalidArgumentException("Invalid child node in " . Util::toPhp($path));
                          }
                          $ret['nodes'][] = $this->getAst($n);
                      }
                  }
              }
          }
  
          return $ret;
      }
code: public function getAst(Node\Node $b, $path = '')
      {
          $ret = array(
              'type' => str_replace('Zicht\Tool\Script\Node\\', '', get_class($b))
          );
          if ($b instanceof Node\Branch) {
              if (count($b->nodes)) {
                  $ret['nodes'] = array();
  
                  foreach ($b->nodes as $n) {
                      if (null === $n) {
                          $ret['nodes'][] = $n;
                      } else {
                          if (!$n instanceof Node\Node) {
                              throw new \InvalidArgumentException("Invalid child node in " . Util::toPhp($path));
                          }
                          $ret['nodes'][] = $this->getAst($n);
                      }
                  }
              }
          }
  
          return $ret;
      }
code_tokens: public function getAst ( Node \ Node $ b , $ path = '' ) { $ ret = array ( 'type' => str_replace ( 'Zicht\Tool\Script\Node\\' , '' , get_class ( $ b ) ) ) ; if ( $ b instanceof Node \ Branch ) { if ( count ( $ b -> nodes ) ) { $ ret [ 'nodes' ] = array ( ) ; foreach ( $ b -> nodes as $ n ) { if ( null === $ n ) { $ ret [ 'nodes' ] [ ] = $ n ; } else { if ( ! $ n instanceof Node \ Node ) { throw new \ InvalidArgumentException ( "Invalid child node in " . Util :: toPhp ( $ path ) ) ; } $ ret [ 'nodes' ] [ ] = $ this -> getAst ( $ n ) ; } } } } return $ ret ; }
docstring: Returns the AST for a specified node as an array representation
  
  @param Node\Node $b
  @param string $path
  @return array
docstring_tokens: Returns the AST for a specified node as an array representation