public function expect($type)
    {
        $node = $this->current();
        if (!$this->is($type)) {
            if (is_array($type)) {
                $type = implode(' or ', $type);
            }
            $actual = sprintf('<%s:%s>', $node->getType(), $node->getValue());
            throw new \LogicException(sprintf('Syntax Error: %s expected %s given', $type, $actual));
        }
        $this->next();

        return $node;
    }