Parser
Recursive-descent parser for PDF objects (ISO 32000-1 §7.3).
Drives a Lexer one token at a time. Handles the tricky one-token lookahead needed to distinguish "N G obj" headers, "N G R" references, and bare numbers inside arrays — see readArray for the gory details.
Pass a resolver (typically the owning io.github.yuroyami.kitepdf.PdfDocument) when parsing in a context where indirect references in stream dictionaries must be resolved on the fly — most importantly when /Length is an indirect reference, which MuPDF's pdf_stream_length() handles via pdf_dict_get_int64().