Custom pragma handler tutorial or documentation?


I'm an absolute beginner to clang/llvm, so please bear with me. I am
working on Mac OS X (Xcode 4) and want to have some custom #pragma
handlers. For instance, #pragma doThis would create a file during
compilation time and collect there the one line of code directly after
the pragma mark and the name of the (ObjC) class throughout the
project. Is something like this possible at all and if so, where can I
find the appropriate documentation and/or tutorial which explains how
to do it and how to integrate it into your own project?

Thanks in advance!