public function accept(Ast\Visitor $visitor) { $visitor->visitEnter($this); $visitor->visit($this); $this->sequence->accept($visitor); $visitor->visitLeave($this); }
public function accept(Ast\Visitor $visitor) { if ($this->parameter instanceof Ast) { if ($visitor->visitEnter($this)) { $this->parameter->accept($visitor); $visitor->visitLeave($this); } } else { $visitor->visit($this); } }
/** * Accept visitors, because this element has children, enter and leave are called. * * @param Ast\Visitor $visitor * @return null|void */ public function accept(Ast\Visitor $visitor) { if ($visitor->visitEnter($this)) { foreach ($this->simples as $simple) { /** * @var Simple $simple */ $simple->accept($visitor); } if (isset($this->combinator)) { $this->combinator->accept($visitor); } return $visitor->visitLeave($this); } return NULL; }
/** * Accept visitors, because this element has children, enter and leave are called. * * @param Ast\Visitor $visitor * @return null|void */ public function accept(Ast\Visitor $visitor) { if ($visitor->visitEnter($this)) { /** * @var Sequence $sequence */ foreach ($this as $sequence) { $sequence->accept($visitor); } return $visitor->visitLeave($this); } return NULL; }