protected function eof() {
        if ($this->scanner->current() === false) {
            // fprintf(STDOUT, "EOF");
            $this->flushBuffer();
            $this->events->eof();
            $this->carryOn = false;
            return true;
        }
        return false;
    }