"Paul Mensonides" <[EMAIL PROTECTED]> wrote in message news:001601c286c9$64eedf40$6401a8c0@;c161550b... > "Andrei Alexandrescu" <[EMAIL PROTECTED]> wrote in message > news:aqf13l$f7e$1@;main.gmane.org... > > A very nice Spirit code sample would be the proverbial dogfood that C++ > eats > > itself. To clarify: > > > > 1. How about an open-source C++ preprocessor (that takes care of #define > and > > #include) written in Spirit? Then that preprocessor could be compared with > > existing preprocessors in terms of speed and conformance. > > This one I'd like to see, but it might be too easy. There isn't much to > Cpp.
Having tried it many years ago in C++ using Yacc/Lex, it is not nearly as easy as it looks. The most difficult area is macro expansion and substitution. The other thing to look out for, which is a non-standard problem, is that every compiler of which I know defines their own macros based on compiler options and programmers often use these macros to include or not include lines of code. Finally there is the recursive inclusion of header files, each with their own preprocessor directives. Of course it is much easier than the rest of the C++ language but I don't think anyone should underestimate how difficult it might be. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost