Test cases

Here are the files. Note that this directory is just

   /net/www/classes/AY2000/cs4240_fall/prj2
on the cities machines, in case you just want to issue a "cp" command from your prompt rather than fetch these files from your web browser.

The "minimum requirements" to get an 'A' are effectively to match my output in the outXX files. The out_verboseXX files are mostly so you can get a better understanding of my implementation, and to see how helpful/verbose error message can be. If you want to try to earn extra credit, you can aim for output like the verbose files; mention in the README that you've done something different/extra.

Here's a brief summary of what-all gets printed in the outXX files.

Error messages

All type mismatches look like this:

   Error, line N: type mismatch to operator "OP"    
even for the non-operators "if" and "while", which expect booleans.

These errors deal with declarations:

   Error, line N: Used undeclared variable: "VAR" 
   Error, line N: Duplicate declaration: "VAR" already declared   

This one comes from the optimizer:

   Error, line N: Division by zero     

Parse tree output

Here's examples of what you need in your decorated parse tree...

Decorations on variables, showing the type. In your AST, nodes with variables should have references into your symbol table.

   x[integer]       
   s[string]

Decorations on operators, showing the types of the operands. In your AST, nodes with operators should know which version of the operator they describe (some operators are overloaded: <[integer] is a different operation than <[string], and you'll want to know this when we reach code generation).

   <[integer]
   :=[boolean]

Constants should be decorated as such:

   3[integer][const]
   "foo"[string][const]

Any node that results from optimization should be labelled as such:

   true[boolean][const]<optimized>
   b[boolean]<optimized>


An index generated by Brian's webindex.pl script...
[FILE]out01
[FILE]out02
[FILE]out03
[FILE]out04
[FILE]out05
[FILE]out06
[FILE]out07
[FILE]out08
[FILE]out09
[FILE]out10
[FILE]out11
[FILE]out12
[FILE]out13
[FILE]out14
[FILE]out_verbose01
[FILE]out_verbose02
[FILE]out_verbose03
[FILE]out_verbose04
[FILE]out_verbose05
[FILE]out_verbose06
[FILE]out_verbose07
[FILE]out_verbose08
[FILE]out_verbose09
[FILE]out_verbose10
[FILE]out_verbose11
[FILE]out_verbose12
[FILE]out_verbose13
[FILE]out_verbose14
[FILE]test01
[FILE]test02
[FILE]test03
[FILE]test04
[FILE]test05
[FILE]test06
[FILE]test07
[FILE]test08
[FILE]test09
[FILE]test10
[FILE]test11
[FILE]test12
[FILE]test13
[FILE]test14

Last updated on Sun Oct 24 11:05:05 EDT 1999 by Brian McNamara