[Kde-bindings] Twine2 (PyKDE* code generation tool) Naming

Scott Kitterman kde at kitterman.com
Wed Apr 22 13:21:59 UTC 2015


I did take a look at this and it's not clear that after the errors the parser 
is in a recoverable state (still investigating).  I think there is one error 
that's screwing up parsing of one header file, so I haven't given up on 
actually fixing yet (but anyone who wants to dive in and have a look is 
certainly welcome).

Scott K

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



More information about the Kde-bindings mailing list