If this is really about string parsing, then the regexp tools in j2sdk1.4 and up can make short work of this task.
1.) Remove white space. 2.) Split the string into groups on ")|(" (lame but efficient). 3.) For each group, split the groups into pairs on "&". 4.) Remove all non alpha characters (caps in this case). 5.) For each char in the left side of the pair, print char plus right side of pair.
Now, if this is for a "Data Structures" or "Compiler" class as the title suggests, such an approach would probably get you a failing grade. Go back and look a the stack approach. [ December 31, 2004: Message edited by: Ben Souther ]