class JsonParser {

    public void parse(Reader reader) throws JsonException {
        pushbackReader = new PushbackReader(reader);
        eventHandler.reset();
        stack.clear();
        char c;
        while ((c = next()) != END_OF_STREAM) {
            if (c == '{') {
                readObject();
            } else if (c == '[') {
                readArray();
            } else {
                throw new JsonException(String.format("Syntax error. Unexpected '%s'. Must be '{'.", c));
            }
            c = assertNextIs(",]}");
            if (c != END_OF_STREAM) {
                pushBack(c);
            }
        }
        if (!stack.isEmpty()) {
            throw new JsonException("Syntax error. Missing one or more close bracket(s).");
        }
    }

    public  JsonParser();
    protected  JsonParser(JsonHandler eventHandler);

}