next up previous
Next: An Intermediate Language for ALLCOT Up: The Assignment Previous: Symbol Tables for ALLCOT (10

Test Programs for ALLCOT (5 points)

Update your three ALLCOT test programs, such they correspond to your current version of ALLCOT and such that they are valid ALLCOT programs.

Moreover, add short programs (say about 5) each of them in the order of 10 lines and generating a syntax error (not semantic error).

Example 1  
MyCat: Category == add {
  foo: Integer -> %;
}
MyDom: MyCat == with {
  attrib(n: Integer);
  foo(n: Integer): % == attrib(n);
}
main(): () == {
}
main();

Observe that the following is a valid ALLCOT program (but semantically incorrect).

Example 2  
MyCat: Category == with {
   foo: Integer -> %;
}
MyCat: Integer == Boolean add {
   attrib(b: Boolean);
   bar(p: Program): Compiler == compiler(p);
   ooops(p: Program): Error == crash(p);
}
main(): () == {
   Boolean: String :=  MyCat;
}
main();


next up previous
Next: An Intermediate Language for ALLCOT Up: The Assignment Previous: Symbol Tables for ALLCOT (10
Marc Moreno Maza
2004-12-01