LWN.net Logo

Pythron

Pythron

Posted Dec 11, 2008 23:42 UTC (Thu) by nix (subscriber, #2304)
In reply to: Pythron by rriggs
Parent article: Python 3.0 released

C++ is nearly impossible to parse, primarily because it continues to rely on the C preprocessor.
I've written a C++ parser, and, believe me, the C preprocessor can be almost completely ignored: it doesn't make anything harder. It is *not* the problem. The rampant context-sensitivity is the problem. A trivial example that everyone knows: is

A foo (b);

a declaration of a variable 'foo' of type 'A', and its initialization via a single-argument constructor, passing the variable 'b', or a declaration of a function 'foo' taking a single parameter of type 'b' and returning an 'A'?

To answer that you have to know if 'b' is a type or not at that point in the program *at parsing time*.


(Log in to post comments)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds