CSC362 2004S, Class 31: Implementing Type Checkers, Revisited Admin: * We interrupt today's regularly scheduled topic for a lab/discussion on type checking. * Project extended through the weekend. * No official lab tomorrow (I'll be here for the 9am lab, but not the 1pm lab) * Cool talk Friday! * Grrr ... digital camera missing * Grrr ... pages missing once again * Splitting up the work * Person 1: Variable and constant declarations; Arrays * Person 2: Procedure and function declarations and calls * Person 3: Expressions; Everything else * Sam plans to try to do it all tonight and will report back on time taken * To divide up work: Try rebelsky.compiler.misc.Traverser and rebelsky.compiler.misc.Checker Instructions: 1. Look at Examples/rebelsky/compiler/misc/Traverser.java Examples/rebelsky/compiler/misc/Checker.java Summarize, in your own words, what a Traverser does. 2. Make a copy of the files for this lab with cvs -d /home/rebelsky/Web/Courses/CS362/2004S/CVS/ checkout TypeCheck 3. Look at BooleanCounter.java and TestBC.java. Summarize, in your own words, what the two classes do. 4. Compile TestBC and run it on the file bool.pas javac TestBC.java java TestBC bool.pas Is the output what you expected? Experiment with bool.pas to see whether TestBC does what you expect it to do. 5. Look at VariableTyper.java and TestVT.java. Summarize, in your own words, what the two classes do. 6. Compile TestVT and run it on types.pas. Reflect on the results. 7. Read and play with at TraverseAndPrint.java and TestTAP.java. 8. How does PrintTyped.java differ from TraverseAndPrint.java? 9. Read and play with Collaborate.java, Devin.java, Eryn.java, and Test.java. 10. Extend Eryn.java to deal with parameters to procedures. 11. Extend Devin.java to deal with constants. 12. Extend Eryn.java to deal with arithmetic expressions.