I've no ideas about these tools are good as some commercial products,
but they are all free under GPL and offer full source code.
The FreeHDL Project http://www.freehdl.seul.org/
They're using VAUL to parse and analyze arbitrary VHDL code.
VAUL - a VHDL Analyzer and Utility Library **broken link removed**