Esempio n. 1
0
 public function accept(Ast\Visitor $visitor)
 {
     $visitor->visitEnter($this);
     $visitor->visit($this);
     $this->sequence->accept($visitor);
     $visitor->visitLeave($this);
 }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
 /**
  * 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;
 }
Esempio n. 4
0
 /**
  * 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;
 }