How zserge/jsmn works
JSMN is a minimal, header-only C JSON tokenizer. A caller initializes parser state, passes a JSON buffer and caller-owned token array to the parse API, and receives token counts or errors; tokens reference positions in the original input rather than copying values. The header documents incremental parsing and count-only sizing with a NULL token array. The source excerpt is partial, so internal parsing detail is limited to the visible string, primitive, and container routines.
Main entry points: jsmn.h Parser API
Components 7
Other components
- C caller
- Parser API
jsmn.h - Parser state
jsmn.h - Token scanning
jsmn.h - JSON buffer
- Token array
- Count or error
Connections 10
- C caller → Parser API: calls init
- Parser API → Parser state: initializes
- C caller → Parser API: calls parse
- C caller → JSON buffer: supplies JSON
- C caller → Token array: supplies capacity
- Parser API → Parser state: uses state
- Parser API → Token scanning: scans input
- Token scanning → JSON buffer: reads buffer
- Token scanning → Token array: writes tokens
- Parser API → Count or error: returns count or error