From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMs87-0007xU-Jy for qemu-devel@nongnu.org; Wed, 05 Aug 2015 02:24:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMs84-0003nH-Eo for qemu-devel@nongnu.org; Wed, 05 Aug 2015 02:24:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMs84-0003n7-9T for qemu-devel@nongnu.org; Wed, 05 Aug 2015 02:24:44 -0400 From: Markus Armbruster References: <1438703896-12553-1-git-send-email-armbru@redhat.com> <1438703896-12553-5-git-send-email-armbru@redhat.com> <55C13C19.2000609@redhat.com> Date: Wed, 05 Aug 2015 08:24:41 +0200 In-Reply-To: <55C13C19.2000609@redhat.com> (Eric Blake's message of "Tue, 4 Aug 2015 16:26:33 -0600") Message-ID: <87egjiuuae.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH RFC v3 04/32] qapi: New QAPISchemaVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, berto@igalia.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Eric Blake writes: > On 08/04/2015 09:57 AM, Markus Armbruster wrote: >> The visitor will help keeping the code generation code simple and >> reasonably separated from QAPISchema details. >> >> Signed-off-by: Markus Armbruster >> Reviewed-by: Eric Blake >> --- >> scripts/qapi.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 46 insertions(+) >> >> diff --git a/scripts/qapi.py b/scripts/qapi.py >> index 3c596c3..019d22c 100644 >> --- a/scripts/qapi.py >> +++ b/scripts/qapi.py >> @@ -771,6 +771,29 @@ class QAPISchemaEntity(object): >> return c_name(self.name) >> def check(self, schema): >> pass >> + def visit(self, visitor): >> + pass >> + >> +class QAPISchemaVisitor(object): >> + def visit_begin(self): >> + pass > > Don't know if you wanted to hoist from later patches, and write this as: > > def visit_begin(self, schema): > >> @@ -1166,6 +1206,12 @@ class QAPISchema(object): >> for ent in self.entity_dict.values(): >> ent.check(self) >> >> + def visit(self, visitor): >> + visitor.visit_begin() > > and this as > > visitor.visit_begin(self) > > up front, for less churn later on. Not the end of the world to leave it > as is, so my R-b stands either way. I ran out of time. Perhaps I can still try in the next iteration.