public Parser.Events parse()
    {
        int c = 0;
        boolean ret = true;

        try {
            while ((c = in.read()) != -1 && ret)
            {
                this.charsRead += 1;

                ret = this.updateState(c);
                if (ret)
                {
                    updateEvent();
                    ret = updateStrings(c);
                }

                if (ret && this.event_changed)
                {
                    return this.event;
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

        if (!ret)
        {
            System.err.println("Error at position [" + this.charsRead + "] while parsing the input file.");
            while (this.tags.size() != 0)
            {
                System.out.println(this.tags.pop());
            }
            System.out.println(this.current_tag);
        }

        return Parser.Events.ev_NONE;
    }