On 10/15/20 12:52 PM, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Move the generating function to the IfCond class.
> (avoid cluttering and potential missuse of global functions, allow
> access to private members etc)
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> scripts/qapi/common.py | 22 ++++++++++------------
> scripts/qapi/gen.py | 6 ++----
> scripts/qapi/introspect.py | 6 ++----
> scripts/qapi/types.py | 22 ++++++++++------------
> scripts/qapi/visit.py | 14 ++++++--------
> 5 files changed, 30 insertions(+), 40 deletions(-)
>
Seems straightforward enough, though I guess your 'Ifcond' object
becomes something more of a code generator class than a pure abstract
representation by absorbing C generation functions, yeah?
I didn't bother doing a visitor or other fancy design, as it's easy to iterate later if needed, imho.