http://developer.nvidia.com/view.asp?IO=cg_compiler_code
This release provides the source code for the Cg compiler (cgc.exe) with a "generic" profile, which does some minimal semantic checks and prints out a tree representation of the code. It can be built either with the included Microsoft Visual C++ 6.0 projects and workspace, or with the included Makefile. The release also includes examples, along with a detailed description of the release contents in the Readme.txt file.
Please make sure to look through the accompanying license.txt file before working with the provided code.