Re: Re: The Array type

Stefan Seefeld <[email protected]>
Newsgroups gmane.comp.documentation.synopsis
Message-ID <[email protected]>
Luke Petre wrote:
> It seems like it would be best to do in the Decoder, but I don't think 
> you have enough information at that point.  Thoughts?

you are right, the Decoder is a good place to look into. And you are right
that the other half of the information, i.e. the actual sizes, isn't
available there :-) The real problem is that the AST as generated by occ
is much more expressive than the one maintained by synopsis.
That's one aspect of the work I'm trying to do now on the C++ backend:
making that rich AST accessible to synopsis, and provide a 'more correct'
translation into what is currently called 'AST' (but what's really just
a tree of declarations).

Have a look into Synopsis/Parsers/Cxx/occ/Parser.cc:1790

There a 'PtreeDeclarator' is instantiated with all the information
about the array sizes (i.e. the sizes are real expressions !).
A quick fix would be to see in swalker.cc whether you can get back
that information (via a downcast) and at least extract these expressions
as strings, so the documentation synopsis generates will at least be
a bit more useful.

A real fix is obviously quite a bit more involved. (You are more than
welcome to contribute !)

Regards,
		Stefan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.