<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, May 11, 2016 at 10:18 AM Eric Liu <<a href="mailto:ioeric@google.com">ioeric@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I think what we really want are synopses that can compile (i.e. with all necessary #include headers) so that we can run clang matcher on them. </div></blockquote><div><br></div><div>Exactly. Richard, I thought it might make sense for the C++ standard to have its code-like snippets in parsable form for verifyability, but if you don't think it'd help, we'll need to look for something else.</div><div>Options:</div><div>a) we create an ugly little script that extracts the functions from the standard and puts them into a bunch of files with #includes (probably by maintaining a side table) and have people use that script + the standard</div><div>b) we just one-time create our own table and try to maintain it (perhaps just as part of the clang repo)</div><div>c) ... ?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><div class="gmail_quote"><div dir="ltr">On Wed, May 11, 2016 at 2:50 AM Richard Smith via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, May 10, 2016 at 2:22 AM, Manuel Klimek via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span><div dir="ltr">On Mon, May 9, 2016 at 7:14 PM Richard Smith via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><p dir="ltr">The below is the sort of thing I'd suggest. You'll probably need some manual massaging to get the extraction exactly right, though.</p></blockquote><div><br></div></span><div>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?</div></div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>The only supported use of the sources on github are to allow the C++ project editor to produce working drafts and standards. They're on github as a convenience to contributors to the C++ standardization process, and could go away or change format or layout or anything else, at any time, if we find a better process. On that basis, it doesn't make a lot of sense to me for the layout of the standard's sources to be driven by external concerns like this one.</div><div><br></div><div>If there's some changes you want, and you can make that change in a way that's aligned with making the sources better as a vehicle for maintaining or producing a standard / working draft, then that's probably the best path forward. For instance, a change that adds a different kind of LaTeX environment around synopsis blocks, providing higher-level semantic markup, would generally be positive for the standard sources and would help you extract the parts you need.</div><div><br></div><div>It's not clear to me what benefit there would be to the standard sources if we separated out these synopses into separate files, and it would make our current organizational system (one .tex file per top-level clause) non-uniform.</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div>Or do you think that will increase the amount of maintenance work too much?</div><span><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<p dir="ltr">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.</p></blockquote></span><div>Generally, we need all symbols users might want to use, and which headers they are defined in.</div></div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>It might be easier to extract this from the index of library names rather than from the synopses (although you may need to insert some markers to indicate which headers contain each library name -- it would be useful to include that information in the index too, which would justify the cost of maintaining those markers in the standard text).</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="gmail_quote">On 9 May 2016 8:51 a.m., "Kim Gräsman" <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Eric,<br>
<br>
On Mon, May 9, 2016 at 3:30 PM, Eric Liu via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
><br>
> As an alternative, we are thinking about parsing header synopses from C++<br>
> standard. So, we are wondering if there are existing syntax-correct header<br>
> synopses in the form of C++ header files somewhere that we can use. If not,<br>
> Manual(@klimek) suggests that maybe we could have the header synopses as C++<br>
> header files and have the standard draft includes them so that syntax can be<br>
> easily checked, and we can conveniently parse the synopses too.<br>
<br>
We've had similar plans for IWYU, and I think we eventually parsed the<br>
TeX source from <a href="https://github.com/cplusplus/draft/tree/master/source" rel="noreferrer" target="_blank">https://github.com/cplusplus/draft/tree/master/source</a><br>
with a simple shell script.<br>
<br>
I didn't do this myself, but I found a couple of examples in our source here:<br>
<br>
  // These headers are defined in C++14 [headers]p3.  You can get them with<br>
  // $ sed -n '/begin{floattable}.*{tab:cpp.c.headers}/,/end{floattable}/p'<br>
lib-intro.tex | grep tcode | perl -nle 'm/tcode{<c(.*)>}/ && print qq@<br>
 { "<$1.h>", kPublic, "<c$1>", kPublic },@' | sort<br>
  // on <a href="https://github.com/cplusplus/draft/blob/master/source/lib-intro.tex" rel="noreferrer" target="_blank">https://github.com/cplusplus/draft/blob/master/source/lib-intro.tex</a><br>
<br>
  // These headers are defined in C++14 [headers]p2.  You can get them with<br>
  // $ sed -n '/begin{floattable}.*{tab:cpp.library.headers}/,/end{floattable}/p'<br>
lib-intro.tex | grep tcode | perl -nle 'm/tcode{(.*)}/ && print qq@<br>
"$1",@' | sort<br>
  // on <a href="https://github.com/cplusplus/draft/blob/master/source/lib-intro.tex" rel="noreferrer" target="_blank">https://github.com/cplusplus/draft/blob/master/source/lib-intro.tex</a><br>
<br>
(from <a href="https://github.com/include-what-you-use/include-what-you-use/blob/master/iwyu_include_picker.cc" rel="noreferrer" target="_blank">https://github.com/include-what-you-use/include-what-you-use/blob/master/iwyu_include_picker.cc</a>)<br>
<br>
Assuming you want this to be portable I'm sure you can do something<br>
similar in C++ relatively easily.<br>
<br>
FWIW,<br>
- Kim<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div></div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div></div></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>
</blockquote></div></div>