qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC v3 04/32] qapi: New QAPISchemaVisitor


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH RFC v3 04/32] qapi: New QAPISchemaVisitor
Date: Wed, 05 Aug 2015 08:24:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eric Blake <address@hidden> 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 <address@hidden>
>> Reviewed-by: Eric Blake <address@hidden>
>> ---
>>  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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]