At work we have a prebuild step that reads over our source code and automatically generates data based on some annotations in the code. If the prebuild tags are poorly formatted or it finds something it doesn't know how to deal with it prints an error. Just like other builder errors, these can be clicked on to direct you to the line containing the error.
If I wanted to do something similar, what would I have to do?