[Rock-dev] Documentation hints for typelib types
Sylvain Joyeux
sylvain.joyeux at dfki.de
Mon Jan 16 10:58:38 CET 2012
On 01/16/2012 10:24 AM, Alexander Duda wrote:
> I had a quick look on the Internet and it would be great if we could
> extend typelib to read the C/C++ attributes from the gcc-xml.
>
> EXAMPLE:
> #define _doc_(STRING) __attribute((gccxml(STRING)))
>
> struct Test
> {
> _doc_("Distance to the wall [m]") double distance;
> }
>
> The result would be a per field based documentation for typelib types.
>
> puts frame.image._doc_
>
> What do you think?
I'm CC-ing rock-dev since this is obviously something that is of wider
interest (original mail in full below)
I thought about it during the week-end. A doc-based system would be
possible: GCCXML tells us on what file / line the fields / types are
defined, so we would parse the lines before that definition line and
extract meta-data from there.
This would be quite a bit of work, since we would need to have:
* global meta-data. I.e. "Angle.value is an angle"
* local meta-data, I.e. "the fields of Vector3 in
RigidBodyState.position is a position" (could be used for
something else in other contexts)
Not trivial, and I personally think that we have more important things
on our plate right now ... Unless you have a very capable student
available for that of course ;-)
In general, what we *could* start discussing is a normalization of some
of this metadata (probably should have a look into other systems for
that ...)
On 01/16/2012 10:24 AM, Alexander Duda wrote:
> Hi Sylvain,
>
> I had a quick look on the Internet and it would be great if we could
> extend typelib to read the C/C++ attributes from the gcc-xml.
>
> EXAMPLE:
> #define _doc_(STRING) __attribute((gccxml(STRING)))
>
> struct Test
> {
> _doc_("Distance to the wall [m]") double distance;
> }
>
> The result would be a per field based documentation for typelib types.
>
> puts frame.image._doc_
>
> What do you think?
>
> Alex
>
> C++ Meta Information
> GCC-XML has added a new attribute to the legal set of C/C++ attributes.
> The attribute is used to attach meta information to C/C++ source code,
> which will then appear in the XML output. The syntax for declaring an
> attribute is as follows:
> * __attribute((gccxml(<string>,<string>, ...))): Here<string> is
> a quoted string. There must be at least one argument to the
> 'gccxml' attribute, but there is no upper limit to the total
> number of arguments. Each argument is verified to be a string -
> if a non-string argument is found, the attribute is ignored.
>
>
--
Sylvain Joyeux (Dr.Ing.)
Space & Security Robotics
!!! Achtung, neue Telefonnummer!!!
Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany
Phone: +49 (0)421 178-454136
Fax: +49 (0)421 218-454150
E-Mail: robotik at dfki.de
Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.: DE 148646973
Steuernummer: 19/673/0060/3
-----------------------------------------------------------------------
More information about the Rock-dev
mailing list