Cog is a clever programmer's tool. In essense, it's a Python-based text preprocessor; you can embed Python code inside C, or C++, or Python, or HTML, or any kind of text file really, then run Cog on it to automatically generate part of it.
However, while Cog is plenty fast, perhaps you have a massive build system, and you don't want to run Cog automatically over every source file in your tree. This in and of itself is no problem; you just configure your build process such that you only run Cog on the files where you actually have Cog code.
But! What happens when you add Cog to an existing file, and forget to move that file from the "doesn't need Cog" list to the "needs Cog" list? Why, you've introduced a bug into your build process, that's what.
You need Nocog! Nocog is designed to catch exactly that problem. Nocog scans over its input files, and if any of them contain Cog code, it prints an error and returns -1. If none of them contain any Cog code, it prints nothing and returns 0.
Highlights of Nocog:
-marker STRING, so you can also use Nocog with Argent (like Cog but for Ruby).
The Nocog web page is here:
http://www.midwinter.com/~larry/programming/nocog/And you can download a zip file containing the source code and a prebuilt Windows binary here:
Here's the license:
/* ** [BEGIN NOTICE] ** ** Nocog Copyright (C) 2005 Larry Hastings ** ** This software is provided 'as-is', without any express or implied warranty. ** In no event will the authors be held liable for any damages arising from ** the use of this software. ** ** Permission is granted to anyone to use this software for any purpose, ** including commercial applications, and to alter it and redistribute ** it freely, subject to the following restrictions: ** ** 1. The origin of this software must not be misrepresented; you must not ** claim that you wrote the original software. If you use this software ** in a product, an acknowledgment in the product documentation would be ** appreciated but is not required. ** 2. Altered source versions must be plainly marked as such, and must not be ** misrepresented as being the original software. ** 3. This notice may not be removed or altered from any source distribution. ** ** The Nocog homepage is here: ** http://www.midwinter.com/~larry/programming/nocog/ ** ** [END NOTICE] */In non-legalese, my goal was to allow you to do anything you like with the software, except claim that you wrote the original version. If my license prevents you from doing something you'd like to do, contact me (my email address is in the source) and we can discuss it.
-marker, added prebuilt Win32 binary to zip file.