On Tue, 2012-06-19 at 00:49 +0100, Philip Herron wrote:
Hey
I am working on my gsoc on pxd generation and i was wondering in places like:
PyObject * gcc_Function_repr(struct PyGccFunction * self)
You get the identifiers for things using IDENTIFIER_POINTER and then
format things into
result = gcc_python_string_from_format("gcc.Function('%s')",
name);
In my code i have to write code to get the identifier out of this
format which to me seems a little awkward if we were to make available
the identifiers non-formatted would be quite nice. Even just a
supporting python code parsing them out for you would this kind of
code be useful to the plugin or leaving things as is the preferred
method.
If you have:
fn
a gcc.Function, you should be able to get at the declaration (a
gcc.FunctionDecl) via:
fn.decl
(this "decl" attribute is implemented in generate-function-c.py).
You should then be able to directly look up the name as:
fn.decl.name
which ought to be a str (this "name" attribute is implemented in
generate-tree-c.py).
Hope this is helpful
Dave