next up previous
Next: About this document ... Up: The Assignment Previous: Symbol Tables for ALLCOT

Test Programs for ALLCOT

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 10) 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: About this document ... Up: The Assignment Previous: Symbol Tables for ALLCOT
Marc Moreno Maza
2004-12-01