String::Comments::Extract released

grink on 2008-08-14T06:14:32

String::Comments::Extract

    my $comments = String::Comments::Extract::C->extract($source)

String::Comments::Extract is a tool for extracting comments from C/C++/JavaScript/Java. The extractor is implemented using an actual tokenizer (written in C via XS [adapted from JavaScript::Minifier::XS]). By using a tokenizer, it can correctly deal with notoriously problematic cases, such as comment-like structures embedded in strings:

    std::cout << "This is not a // real C++ comment " << std::endl
    printf("/* This is not a real C comment */\n");
    # The extractor will ignore both of the above

The source repository is on GitHub: http://github.com/robertkrimen/string-comments-extract/tree/master

String::Comments::Extract released