Here's my latest approach in processTypeDeclArgs along with what I
think each line is doing:
for each declaration:
letStart(); // create a new lexical environment
ReferenceExp ref = new ReferenceExp(decl); // decl the x in a
(declare (integer x))
letVariable(decl, ref); // push x into this new lexical environment
this.lexical.push(decl); // not sure why this is necessary,
Jamison's advice (I think!)
letEnter(); // push this let expr in the lexical environment
decl.setType(this.exp2Type((Pair) typeList)); // set the type
of x in this lexical environment
decl.setFlag(Declaration.TYPE_SPECIFIED);
letexp = letDone(rewrite_body(body)); // this is dodgy, seems
necessary to finish up a LET
I'm aware that I'm handling the case where decl might already be in
the scope and I'll shadow it, but I'm trying to sort out the simpler
case first.