2026-09-26: Grammar compiler: turns a grammar, a JSON schema or a structural tag,
together with a tokenizer, into a CompiledGrammar, which holds the grammar and
computes, per parser state, the token masks the matcher uses to fill the logit bitmask.
2026-09-26: Earley parser for grammar matching. EarleyParser holds the Earley
items, advances them one byte at a time (advance), expands rule references
(predict, predict_fsm), completes finished rules (complete), reports the
acceptable next bytes (accept), and pushes or rolls back steps for the matcher.
2026-09-26: The grammar representation and its front end: the expression and rule
data (GrammarExpr, GrammarData), GrammarBuilder, the EBNF lexer and parser
(parse_ebnf), the normalising and optimising passes (functor), and the EBNF
printer.
2026-09-26: JSON Schema to EBNF conversion. json_schema_to_ebnf parses the schema
into a JsonValue, resolves it into a SchemaSpec (parser*), and emits the EBNF
rules (converter, gen_*); json_schema_to_grammar parses that EBNF into
GrammarData.
2026-09-26: Support code for the grammar crate: UTF-8, Latin-1 and hex decoding
(encoding), escape handling for grammar literals (escape), union and intersection
of sorted integer sets (int_set), the CSR Compact2DArray, UnionFindSet, and
hash-combine helpers (hash).
2026-09-26: Tokenizer metadata for the grammar matcher: TokenizerInfo (the decoded
vocabulary), VocabType (Raw, ByteFallback, ByteLevel), decode_token and the
byte-level character maps, and detect_metadata_from_hf, which reads the vocabulary
type and prefix-space flag from the text of a tokenizer.json.
A single legacy structural-tag item: begin, a JSON schema
string, and end. Port of the public StructuralTagItem struct
from include/xgrammar/grammar.h.