7:30, Tuesday 11 January: added public void apply(Visitor v) { v.caseAssignmentStatement(this);} to each .java file in the abstract syntax directory, replacing "AssignmentStatement" with the appropriate file/class name. It's likely I'm going to have to put the visitor in a package and import it to get things to compile correctly. 7:45: added import visitor.*; to each file in abstractsyntax and created a visitor directory under chap1 then Visitor.java inside it. started it with package visitor; put in all the empty case methods. Everything compiles. Time to go help the kids get dressed. 8:15 am: happy children eating breakfast 8:18 am: started PrintVisitor.java with the assignment statement. realized I need to add public accessors to the abstract syntax structures. Alas. Time to get more mustard for carl. 8:30 am: drafts of several more prints finished. just have IdentifierExp, LastExpressionList, NumberExp, OperationExp and PairExpressionList left. Time to get the kids shoes on and hustle 'em off to school. 9:30 am. okay back to work. 9:39 am: It prints though it isn't really pretty. :-) Worst silly bug was forgetting to have PrintVisitor extend my do-nothing Visitor base class. Time to take an eye-break and think about the max-args implementation. 11:00 Okay, so thinking about max-args, the biggest problem is likely to be that the expression sequence can have statements inside of it so we can have prints inside of prints even though that's only one argument: print ( (print(x,y), 5), (print (a, b, c, d), 2)); So our find largest max args needs to keep the current largest and the current total... I wonder if we can do this with two variables... no, we can't because it's recursive. So the best thing is probably to use the hashtable idea and carry the count in some way... an expression list should probably tell us how long it is... and the global max could be updated everytime we look at one of those... Let's see if that works... 12:04 pm. Yay, xxxxxxxxx has enlightened me on the world's most exciting job -- his. I'm waking up now. Anyway, the hashtable trick works. On to the interpreter. 12:15 pm: IdentifierExp must be interpreted to be it's value, eh? so I look it the string in the symbols table and store that for the node's value. 12:27 pm: I wonder if you can cast objects to be (Integer[]). Guess I'll find out. 12:28 pm: it compiles... 12:29 pm: CRASH! My expressionList appears to be coming back null. I weep. 12:34 pm: hah, it helps if you actually put the result of the PairExpressionList into the symbol table. 12:37 pm: Yay, it appears to run on my test cases!