[cfe-dev] Headers from C++ standard
Manuel Klimek via cfe-dev
cfe-dev at lists.llvm.org
Tue May 10 02:22:10 PDT 2016
On Mon, May 9, 2016 at 7:14 PM Richard Smith via cfe-dev <
cfe-dev at lists.llvm.org> wrote:
> The below is the sort of thing I'd suggest. You'll probably need some
> manual massaging to get the extraction exactly right, though.
>
Would you be generally open to the idea of having the standard maintain a
more parsable form of the definitions, and including them back into the tex
file? Or do you think that will increase the amount of maintenance work too
much?
> Also, the synopses do not typically include class definitions, just a
> "class X;" style declaration, so if that's a problem for you then you'll
> need to do a bit more work to extract those too.
>
Generally, we need all symbols users might want to use, and which headers
they are defined in.
> On 9 May 2016 8:51 a.m., "Kim Gräsman" <cfe-dev at lists.llvm.org> wrote:
>
>> Hi Eric,
>>
>> On Mon, May 9, 2016 at 3:30 PM, Eric Liu via cfe-dev
>> <cfe-dev at lists.llvm.org> wrote:
>> >
>> > As an alternative, we are thinking about parsing header synopses from
>> C++
>> > standard. So, we are wondering if there are existing syntax-correct
>> header
>> > synopses in the form of C++ header files somewhere that we can use. If
>> not,
>> > Manual(@klimek) suggests that maybe we could have the header synopses
>> as C++
>> > header files and have the standard draft includes them so that syntax
>> can be
>> > easily checked, and we can conveniently parse the synopses too.
>>
>> We've had similar plans for IWYU, and I think we eventually parsed the
>> TeX source from https://github.com/cplusplus/draft/tree/master/source
>> with a simple shell script.
>>
>> I didn't do this myself, but I found a couple of examples in our source
>> here:
>>
>> // These headers are defined in C++14 [headers]p3. You can get them
>> with
>> // $ sed -n
>> '/begin{floattable}.*{tab:cpp.c.headers}/,/end{floattable}/p'
>> lib-intro.tex | grep tcode | perl -nle 'm/tcode{<c(.*)>}/ && print qq@
>> { "<$1.h>", kPublic, "<c$1>", kPublic },@' | sort
>> // on
>> https://github.com/cplusplus/draft/blob/master/source/lib-intro.tex
>>
>> // These headers are defined in C++14 [headers]p2. You can get them
>> with
>> // $ sed -n
>> '/begin{floattable}.*{tab:cpp.library.headers}/,/end{floattable}/p'
>> lib-intro.tex | grep tcode | perl -nle 'm/tcode{(.*)}/ && print qq@
>> "$1",@' | sort
>> // on
>> https://github.com/cplusplus/draft/blob/master/source/lib-intro.tex
>>
>> (from
>> https://github.com/include-what-you-use/include-what-you-use/blob/master/iwyu_include_picker.cc
>> )
>>
>> Assuming you want this to be portable I'm sure you can do something
>> similar in C++ relatively easily.
>>
>> FWIW,
>> - Kim
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160510/7f8ab2cd/attachment.html>
More information about the cfe-dev
mailing list