/**
  * @param AstNode $node
  * @return DoubleDispatcher|null
  */
 private function getDispatcher(AstNode $node)
 {
     $builder = new VisitorMethodDispatcherBuilder();
     $builder->setDispatcherType($this->visitors);
     $node->configureDoubleDispatcher($builder);
     $dispatcher = $builder->build();
     return $dispatcher;
 }
Beispiel #2
0
 /**
  * @param $visitor
  * @param AstNode $node
  *
  * @return DispatchingVisitor
  */
 private function createDispatchingVisitor($visitor, AstNode $node)
 {
     $builder = new DispatchingVisitorBuilder();
     $node->configureDoubleDispatcher($builder);
     $builder->setVisitor($visitor);
     $dispatcher = $builder->build();
     return $dispatcher;
 }