Code Duplication    Length = 3-5 lines in 2 locations

src/Lalr/Generator.php 2 locations

@@ 254-258 (lines=5) @@
251
                    }
252
                }
253
254
                for ($x = $p->items; $x !== null; $x = $x->next) {
255
                    if ($x->isTailItem() && $x->isHeadItem()) {
256
                        $x->look->or($this->follow[$x->item[-1]->code]);
257
                    }
258
                }
259
            }
260
        } while ($changed);
261
@@ 508-510 (lines=3) @@
505
        foreach ($st->shifts as $t) {
506
            if (!$t->through->isTerminal) {
507
                $this->follow[$t->through->code] = clone $this->blank;
508
                for ($x = $t->items; $x !== null && !$x->isHeadItem(); $x = $x->next) {
509
                    $this->computeFirst($this->follow[$t->through->code], $x->item);
510
                }
511
            }
512
        }
513
        for ($x = $st->items; $x !== null; $x = $x->next) {