If you install the source code of an application that reads the configuration file, it will probably contain the Lex source files.
There are different types of configuration files. Some use the Windows 3.0 'inf' style. Others are actually mini-languages. The book "The Art of Unix Programming" by Eric Steven Raymond has a chapter dedicated to configuration files.
The book is now available on the web:
http://www.faqs.org/docs/artu/configurationchapter.html