public function shift(TreeNodeInterface $node, int $stateIndex): void
    {
        $item = new StackItem();
        $item->state = $stateIndex;
        $item->node = $node;

        if ($this->actions) {
            $this->actions->applyToNode($node);
        }

        $this->items[] = $item;
        $this->stateIndex = $stateIndex;
        $this->stateRow = $this->table->getRow($stateIndex);
    }