From: Rob Taylor <rob.taylor@codethink.co.uk>
To: Josh Triplett <josh@freedesktop.org>
Cc: Josh Triplett <josht@linux.vnet.ibm.com>, linux-sparse@vger.kernel.org
Subject: Re: [PATCH] c2xml
Date: Thu, 28 Jun 2007 12:00:59 +0100 [thread overview]
Message-ID: <468394EB.5070608@codethink.co.uk> (raw)
In-Reply-To: <46834AE1.8010107@freedesktop.org>
Josh Triplett wrote:
> Josh Triplett wrote:
>> On Wed, 2007-06-27 at 14:51 +0100, Rob Taylor wrote:
>>> Here's something I've hacked up for my work on gobject-introspection
>>> [1]. It basically dumps the parse tree for a given file as simplistic
>>> xml, suitable for further transformation by something else (in my case,
>>> some python).
>>>
>>> I'd expect this to also be useful for code navigation in editors and c
>>> refactoring tools, but I've really only focused on my needs for c api
>>> description.
>>>
>>> There are 3 patches here. The first introduces a field in the symbol
>>> struct for the end position of the symbol. I've added this in my case
>>> for documentation generation, but again I think it'd be useful in other
>>> cases. The next introduces a sparse_keep_tokens, which parses a file,
>>> but doesn't free the tokens after parsing. The final one adds c2xml and
>>> the DTD for the xml format. It builds conditionally on whether libxml2
>>> is available.
>>>
>>> All feedback appreciated!
>> Wow. Very nice. I can already think of several other uses for this.
> [...]
>> * Please consider including information from the context and
>> address space attributes.
>
> Actually, don't worry about that one; we can always add it later, and I'd love
> to see this get merged as soon as possible.
Yes, I was about to say I deliberately left this out as I don't need it
for my use case, but it shouldn't be difficult to add if the need arises
for it.
>> * Rather than the current base-type and base-type-builtin
>> mechanism, you might consider having designated IDs for the base
>> types and using those in base-type. You could even output the
>> builtin types if you want. I don't know if this makes things
>> easier or harder for consumers of the output; what do you think?
>
> On second thought, ignore this. We can always change it later, but having a
> special syntax for the base types makes sense to me. Anything that cares
> about types will need to understand the base types.
Agreed.
>> * I don't know if sparse_keep_symbols seems like the right API.
>> Sparse's approach to memory management (or lack thereof) bugs me
>> a bit. More importantly, though, it makes the hierarchy of
>> functions sparse(), then __sparse(), then sparse_keep_symbols(),
>> which seems strange. I don't know a better solution offhand,
>> though; don't worry too much about addressing this.
>
> Ignore this too. The API you propose will work fine for now, and I don't want
> to hold up merging the patch on trying to think of the perfect API for
> something not directly related to the point of your patch.
Heh, yeah, sorting out memory management is quite a scary prospect :) I
think we'd basically need to go for some sort of reference counting
scheme, but that'd need some very careful work to deal with potential
cycles.
>> Thanks again for this work; it looks great, and highly useful.
Thanks!
Rob
Rob
next prev parent reply other threads:[~2007-06-28 10:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-27 13:51 [PATCH] c2xml Rob Taylor
2007-06-27 18:49 ` Josh Triplett
2007-06-28 5:45 ` Josh Triplett
2007-06-28 11:00 ` Rob Taylor [this message]
2007-07-02 12:32 ` Rob Taylor
2007-07-13 15:50 ` Rob Taylor
2007-07-13 17:55 ` Josh Triplett
2007-07-14 6:24 ` Josh Triplett
2007-07-14 23:54 ` Rob Taylor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=468394EB.5070608@codethink.co.uk \
--to=rob.taylor@codethink.co.uk \
--cc=josh@freedesktop.org \
--cc=josht@linux.vnet.ibm.com \
--cc=linux-sparse@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.