I wrote one a few years ago but it got lost. Wasn't too difficult- I used VB6.
I got the PPD spec from adobe.com. Once you understand the structure of the ppd, it's relatively simple to parse the file to look for the tags. You don't need to know anything about the printer and its specifics beforehand, because it's the structure you examine, and the printer specifics are the content of the ppd that you suck out.