/** * @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; }
/** * @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; }
/** * @param AstNode $astNode * * @return boolean */ public function postVisit(AstNode $astNode) { return $astNode->dispatch($this->postVisitDispatcher, $this->visitor); }