From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcDxJ-0000Ag-AL for qemu-devel@nongnu.org; Wed, 16 Sep 2015 10:45:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcDxF-0003eX-Uu for qemu-devel@nongnu.org; Wed, 16 Sep 2015 10:45:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcDxF-0003eA-Qg for qemu-devel@nongnu.org; Wed, 16 Sep 2015 10:45:01 -0400 Date: Wed, 16 Sep 2015 15:44:56 +0100 From: "Daniel P. Berrange" Message-ID: <20150916144456.GG21184@redhat.com> References: <1442401589-24189-1-git-send-email-armbru@redhat.com> <1442401589-24189-3-git-send-email-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1442401589-24189-3-git-send-email-armbru@redhat.com> Subject: Re: [Qemu-devel] [PATCH v8 02/26] qapi: New QAPISchema intermediate reperesentation Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com On Wed, Sep 16, 2015 at 01:06:05PM +0200, Markus Armbruster wrote: > The QAPI code generators work with a syntax tree (nested dictionaries) > plus a few symbol tables (also dictionaries) on the side. > > They have clearly outgrown these simple data structures. There's lots > of rummaging around in dictionaries, and information is recomputed on > the fly. For the work I'm going to do, I want more clearly defined > and more convenient interfaces. > > Going forward, I also want less coupling between the back-ends and the > syntax tree, to make messing with the syntax easier. > > Create a bunch of classes to represent QAPI schemata. > > Have the QAPISchema initializer call the parser, then walk the syntax > tree to create the new internal representation, and finally perform > semantic analysis. > > Shortcut: the semantic analysis still relies on existing check_exprs() > to do the actual semantic checking. All this code needs to move into > the classes. Mark as TODO. > > Simple unions are lowered to flat unions. Flat unions and structs are > represented as a more general object type. > > Catching name collisions in generated code would be nice. Mark as > TODO. > > We generate array types eagerly, even though most of them aren't used. > Mark as TODO. > > Nothing uses the new intermediate representation just yet, thus no > change to generated files. > > Signed-off-by: Markus Armbruster > --- > scripts/qapi-commands.py | 2 +- > scripts/qapi-event.py | 2 +- > scripts/qapi-types.py | 2 +- > scripts/qapi-visit.py | 2 +- > scripts/qapi.py | 381 ++++++++++++++++++++++++++++++++++++++++- > tests/qapi-schema/test-qapi.py | 2 +- > 6 files changed, 377 insertions(+), 14 deletions(-) Reviewed-by: Daniel P. Berrange Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|