From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZ9kI-00017B-J2 for qemu-devel@nongnu.org; Mon, 07 Sep 2015 23:38:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZ9kF-0007Gy-Cl for qemu-devel@nongnu.org; Mon, 07 Sep 2015 23:38:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36157) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZ9kF-0007GY-67 for qemu-devel@nongnu.org; Mon, 07 Sep 2015 23:38:55 -0400 References: <1441621003-2434-1-git-send-email-armbru@redhat.com> <1441621003-2434-3-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55EE5848.9060409@redhat.com> Date: Mon, 7 Sep 2015 21:38:48 -0600 MIME-Version: 1.0 In-Reply-To: <1441621003-2434-3-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hTuWo5505IqeXnsKd5cuQo3JRn876lvX2" Subject: Re: [Qemu-devel] [PATCH RFC v5 02/32] qapi: New QAPISchema intermediate reperesentation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hTuWo5505IqeXnsKd5cuQo3JRn876lvX2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/07/2015 04:16 AM, Markus Armbruster wrote: > The QAPI code generators work with a syntax tree (nested dictionaries) > plus a few symbol tables (also dictionaries) on the side. >=20 > 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. >=20 > Going forward, I also want less coupling between the back-ends and the > syntax tree, to make messing with the syntax easier. >=20 > Create a bunch of classes to represent QAPI schemata. >=20 > Have the QAPISchema initializer call the parser, then walk the syntax > tree to create the new internal representation, and finally perform > semantic analysis. >=20 > 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. >=20 > Simple unions are lowered to flat unions. Flat unions ands structs > are represented as a more general object type. s/ands/and/ >=20 > Catching name collisions in generated code would be nice. Mark as > TODO. >=20 > We generate array types eagerly, even though most of them aren't used. > Mark as TODO. >=20 > Nothing uses the new intermediate representation just yet, thus no > change to generated files. >=20 > Signed-off-by: Markus Armbruster > Reviewed-by: Eric Blake > Reviewed-by: Daniel P. Berrange > --- > scripts/qapi-commands.py | 2 +- > scripts/qapi-event.py | 2 +- > scripts/qapi-types.py | 2 +- > scripts/qapi-visit.py | 2 +- > scripts/qapi.py | 379 +++++++++++++++++++++++++++++++++= +++++++- > tests/qapi-schema/test-qapi.py | 2 +- > 6 files changed, 375 insertions(+), 14 deletions(-) Still looks okay; the improvements made for pep8 look reasonable. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --hTuWo5505IqeXnsKd5cuQo3JRn876lvX2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV7lhIAAoJEKeha0olJ0Nq+tUH/idNDdwUbr1dTsez4DS2IZvP FMNeMVXNO5kDY3MrE/KFlSxqQQzJWyB3CJ2QDD4dNDy0n9h1z2AsGpvboqBY8X5T vhEFaDAUW+9qHDEMw+pA2n8VQmjKWRlEal2kQq175fZTN8ZI8ZDRwH4NS0kyjYvG Sj+u38SdDYJhC3Il0EdCE/nU89IGpensly8PEICUKxePsabJG6u9G26A+iQQox5x cArqiTxv2mMZ/4cgb3N9nRYM1CEg2Z8fEM31S9+/Rh6mSAPN5NWTepyWXGEwWU7S K1QqIO+AS/Wu+JiA6hpt01SdooD1F1SUZHhL77t09CgvDQgd9LWN+moqaf6Hipc= =8iSZ -----END PGP SIGNATURE----- --hTuWo5505IqeXnsKd5cuQo3JRn876lvX2--