Exemplo n.º 1
0
 function inject(self $ts)
 {
     if ($ts->isEmpty()) {
         return;
     }
     if ($this->current instanceof NodeEnd) {
         $this->jump($this->last->previous);
     }
     $a = $this->isEmpty() ? $this->first : $this->current;
     $b = $ts->first->next;
     $e = $ts->last->previous;
     $f = $this->isEmpty() ? $this->last : $this->current->next;
     self::link($a, $b);
     self::link($e, $f);
 }
Exemplo n.º 2
0
 protected final function error(TokenStream $ts)
 {
     if ($this->errorLevel === Error::ENABLED) {
         return new Error($this->expected(), $ts->current(), $ts->last());
     }
 }