public function closeOpenTokens() {
        $lastToken = $this->last();
        while (count($this->openedTokens) > 0) {
            $lastOpenToken = array_pop($this->openedTokens);
            $this->tokens[] = new Token($lastOpenToken . AbstractBlockRule::CLOSE, $lastToken->getPosition());
        }
    }