Am Montag, 22. Februar 2010 17:29:08 schrieben Sie:
> On Mon, Feb 22, 2010 at 04:28:54PM +0100, Andreas Lubensky wrote:
> > i'm having some trouble building a regular expression to filter out C
> > and C++ style comments (//... /*...*/). I constructed various regular
> >
> > "((/\\*([^\\*]|(\\*+([^\\*/])))*\\*+/)|(//[^\r\n]*))"
>
> I don't think RE are the right tool for this job. You probably want a
> little state machine instead (something like 'while (token != '*/') {
> skip_token() }).
>
> Why are you trying to do this? Can you do the parsing in a "real"
> scripting language instead of in CMake?
>
> tyler
>
Hello,
it's already hard enough to convince people to pull in CMake (dependencies
omg!!1).
While regular expressions may not be perfect for this task, they should work,
at least i've found many examples in other languages for my problem.
The alternative would be to write a full blown lexer and that seems pretty
over the top.
CMake just seg faulting seems pretty bad. Might it be a bug after all?
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake