[Xcb] python generator again
Thomas Hunger
hto at arcor.de
Mon Jun 4 14:56:12 PDT 2007
Hello,
reading Jameys last post (thanks Jamey!) showed me that I had some
wrong ideas in my head, so I started over again. The new version
generates code which compiles and works for simple examples. Checking
for symbols says that XSL and Python generate the same
function-symbols.
What I am missing is a way to compare if both APIs (XSL-generated and
Python-generated) are exactly the same (i.e. do all functions have
the same signature). Does anyone know how to do this?
Anyway, the new code can be accessed like this:
$ git remote add htom git://htom.de/libxcb.git
$ git fetch htom
$ git checkout -b pygen refs/remotes/htom/pygen
= Brief technical overview =
The generator works in 3 major steps:
1) reading the XML description and building a Tree of
objects in parallel. Elements that are references later on
via a ref="" or type="" are registered in a type-registry.
2) A fill() function fills out implicit fields. E.g. the "length"
member in request which is not given explicitly in the
description. It also resolves type="" and ref="" references.
3) A generate function outputs all neccessary code. It uses some
helper functions to generate more complex functions like e.g.
the request implementations.
A lot of the variable names are quite bad (e.g. fill()) and unclear. I
will improve on this.
Unfortunally I already know of two major changes which I need to
implement at least parts of the server side XCB.
Tom
More information about the Xcb
mailing list