private function push(int $newState)
    {
        array_push($this->stateStack, $this->state);
        $this->state = $newState;

        if ($this->state !== self::STATE_ROOT) {
            array_push($this->valueStack, $this->value);
        }
        $this->value = [];
    }