From da2a57d9209f36c5439c1051a97f2af4a5faa0dc Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Mon, 14 Jul 2025 16:40:09 +0200 Subject: parse an scan work in stream mode --- readme.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'readme.md') diff --git a/readme.md b/readme.md index 83650cf..69268e4 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,36 @@ # mp -parsing and repl in awk. +Parsing and repl in awk. + +## Representation of JSON in awk + +Rely on multi-dimensional sparse arrays. In fine this is just +an array of strings indexed by strings. + +The JSON types are: true, false, + +Key elements: +- T: true type +- F: false type +- N: null type +- s: string type +- n: number type +- a: array type +- o: object type +- k: key (object only) +- v: value (array and object) +- t: type (one of T, F, N, s, n, a, o) +- l: length (number of array values, or object key-value pairs). +- [0-9]+: index of key or value + +## I/O + +Use string encoded, line oriented protocols. Each command or response fits on a +single line. Newlines in string values must be escaped. Use an optional session +id at begin of command and response to allow to multiplex several peer sessions +on the same stream. + +- Command: + [number] command_name args... +- Response: + [number] data ... -- cgit v1.2.3