Thanks ya'll. You at least led me in the right direction.
I suppose the correct approach is something called "recursive-descent parsing". I found a chapter (24) in Schildt's Complete C Reference on the subject.