qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/11] json parser (v2)
@ 2009-10-17 13:36 Anthony Liguori
  2009-10-17 13:36 ` [Qemu-devel] [PATCH 01/11] Add append method to qstring and empty constructor Anthony Liguori
                   ` (11 more replies)
  0 siblings, 12 replies; 28+ messages in thread
From: Anthony Liguori @ 2009-10-17 13:36 UTC (permalink / raw)
  To: qemu-devel

I fat-fingered the git send-email command the first time so here's the second
iteration.

This series introduces a json parsing framework.  The parser is a recursive
decent parser and implements the full json spec except for the null keyword.  We
need to decide how we want to model null in order to support this.

In addition, we implement an extension to allow single quote strings.  This
is very useful for defining dictionaries in C.

The parser has a full test suite and introduces a boolean and float type.

It also supports varargs parsing.  Here's an example of how that works:

  QObject *obj;

  obj = qobject_from_jsonf("{'id': %d, {'locked': %i, 'file': %s}}",
                           NULL,
                           bs->id, bs->locked, bs->file);

The parser also can embed full qobjects with the '%p' format.

To do streaming parsing, we need a lexer that can tokenize the input.  We then
just need a simple counter to look for balanced {'s and ['s.  The lexer can
just be a regular expression so it's pretty straight forward.

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2009-10-23 19:36 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-17 13:36 [Qemu-devel] [PATCH 0/11] json parser (v2) Anthony Liguori
2009-10-17 13:36 ` [Qemu-devel] [PATCH 01/11] Add append method to qstring and empty constructor Anthony Liguori
2009-10-18 21:36   ` Luiz Capitulino
2009-10-23 19:33     ` Jamie Lokier
2009-10-17 13:36 ` [Qemu-devel] [PATCH 02/11] Add support for qfloat Anthony Liguori
2009-10-18 22:21   ` Luiz Capitulino
2009-10-19 14:18     ` Anthony Liguori
2009-10-22  8:49       ` Amit Shah
2009-10-22 14:01         ` Anthony Liguori
2009-10-22 14:05           ` Amit Shah
2009-10-23 19:25           ` Jamie Lokier
2009-10-23 19:36             ` Daniel P. Berrange
2009-10-17 13:36 ` [Qemu-devel] [PATCH 03/11] Add a test case " Anthony Liguori
2009-10-17 14:00   ` Edgar E. Iglesias
2009-10-17 16:21     ` Anthony Liguori
2009-10-17 13:36 ` [Qemu-devel] [PATCH 04/11] Add json->qobject parser Anthony Liguori
2009-10-23 17:45   ` Luiz Capitulino
2009-10-17 13:36 ` [Qemu-devel] [PATCH 05/11] Add unit test for json parser Anthony Liguori
2009-10-17 13:36 ` [Qemu-devel] [PATCH 06/11] qobject: add QBool type Anthony Liguori
2009-10-18 21:50   ` Luiz Capitulino
2009-10-19 14:17     ` Anthony Liguori
2009-10-19 14:21       ` Luiz Capitulino
2009-10-17 13:36 ` [Qemu-devel] [PATCH 07/11] qjson: Use QBool for true/false keywords Anthony Liguori
2009-10-17 13:36 ` [Qemu-devel] [PATCH 08/11] qjson: add %i for parsing bools Anthony Liguori
2009-10-17 13:36 ` [Qemu-devel] [PATCH 09/11] qjson: add unit test for varargs bool parsing Anthony Liguori
2009-10-17 13:36 ` [Qemu-devel] [PATCH 10/11] qjson: add vararg format for embedded qobjects Anthony Liguori
2009-10-17 13:36 ` [Qemu-devel] [PATCH 11/11] qjson: add unit test to check %p format Anthony Liguori
2009-10-18 21:34 ` [Qemu-devel] [PATCH 0/11] json parser (v2) Luiz Capitulino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).