<p dir="ltr">Taking what Simon said to heart, perhaps the first thing might be to try to tweak things so that errors are not fatal to the whole run.</p>
<p dir="ltr">(I know error recovery is not always the easiest of things in parsers but it would at least result in something rather than nothing).</p>
<div class="gmail_quote">On 21 Apr 2015 12:38, "Scott Kitterman" <<a href="mailto:kde@kitterman.com">kde@kitterman.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tuesday, April 21, 2015 09:56:28 AM Simon Edwards wrote:<br>
> On 2015-04-19 22:07, Scott Kitterman wrote:<br>
> > I do have some additional ideas in terms of making is easier to use,<br>
> > but the<br>
> > biggest thing that would make it easier to use is if it could actually<br>
> > successfully parse everything.<br>
><br>
> This is just a general comment about how to approach this task. When it<br>
> comes the parsing of C++ headers you will need to pick your fights<br>
> carefully. C++ is so big and has so many special constructions that it<br>
> isn't an economical use of time to try to support everything. If you hit<br>
> a .h file which chokes the parser, you need to have a look at what is<br>
> inside it and whether it makes sense to pursue it. It might not even<br>
> have stuff which is relevant to Python, in which case you can skip it.<br>
> It might be full of templates which you can't directly map to Python, in<br>
> which case you may have to skip it and write some custom binding code in<br>
> C++ for SIP.<br>
><br>
> It is par for the course that something new comes along every 6 months<br>
> which the parse can't handle. What twine2 does is also unlike a<br>
> compiler. It tries to parse C++ and handle preprocessor macros etc at<br>
> the same time. A C++ compiler has a two step parser, preprocessor then<br>
> C++ parsing.<br>
><br>
> Also, it is possible to turn on tracing the parser by passing in some<br>
> debug=3 or something option. The docs for the parser library twine2<br>
> should say exactly what to do.<br>
<br>
Thanks.  I appreciate the advice.  To be clear, by everything, I meant<br>
everything in Kf5, not the universe of C++.<br>
<br>
Scott K<br>
_______________________________________________<br>
Kde-bindings mailing list<br>
<a href="mailto:Kde-bindings@kde.org">Kde-bindings@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kde-bindings" target="_blank">https://mail.kde.org/mailman/listinfo/kde-bindings</a><br>
</blockquote></div>