Пример #1
0
 /**
  * @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;
 }
Пример #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;
 }
Пример #3
0
 /**
  * @param AstNode $astNode
  *
  * @return boolean
  */
 public function postVisit(AstNode $astNode)
 {
     return $astNode->dispatch($this->postVisitDispatcher, $this->visitor);
 }