You might want to look at Config Modules instead of re-inventing wheel. There are serveral config file parser, you can choose your style and work accordingly.
I checked out the Config Modules and there is one specifically designed for MQ Series software. It looks like that will do exactly what I want. Thanks for the suggestion.
However, I really DO want to re-invent the wheel in this case, if only to better understand how wheels are made.